From ee265f855b9f195ea287133211a1ebb8e4596bf3 Mon Sep 17 00:00:00 2001 From: Andrea Barbasso <´andrea.barbasso@4science.com´> Date: Tue, 12 Mar 2024 20:10:23 +0100 Subject: [PATCH] [DURACOM-191] run optimize imports and lint fix --- .../access-control/access-control-routes.ts | 56 +- .../access-control/access-control.module.ts | 70 +-- .../bulk-access-browse.component.spec.ts | 24 +- .../browse/bulk-access-browse.component.ts | 64 ++- .../bulk-access/bulk-access.component.spec.ts | 12 +- .../bulk-access/bulk-access.component.ts | 6 +- .../bulk-access-settings.component.spec.ts | 18 +- .../bulk-access-settings.component.ts | 10 +- .../epeople-registry.component.spec.ts | 45 +- .../epeople-registry.component.ts | 98 ++-- .../eperson-form.component.spec.ts | 95 ++-- .../eperson-form/eperson-form.component.ts | 55 +- .../group-form/group-form.component.spec.ts | 85 ++- .../group-form/group-form.component.ts | 64 ++- .../members-list.component.spec.ts | 87 ++- .../members-list/members-list.component.ts | 49 +- .../subgroups-list.component.spec.ts | 70 ++- .../subgroup-list/subgroups-list.component.ts | 53 +- .../groups-registry.component.spec.ts | 79 ++- .../groups-registry.component.ts | 52 +- .../admin-curation-tasks.component.spec.ts | 16 +- .../admin-curation-tasks.component.ts | 7 +- .../batch-import-page.component.spec.ts | 12 +- .../batch-import-page.component.ts | 45 +- .../metadata-import-page.component.spec.ts | 12 +- .../metadata-import-page.component.ts | 15 +- .../admin-ldn-services-routes.ts | 18 +- .../admin-ldn-services.module.ts | 2 +- .../ldn-service-form.component.spec.ts | 6 +- .../ldn-service-form.component.ts | 66 ++- .../ldn-itemfilters-data.service.ts | 2 +- .../ldn-services-data.service.ts | 2 +- .../ldn-services-directory.component.spec.ts | 14 +- .../ldn-services-directory.component.ts | 30 +- ...s-publication-claim-page.component.spec.ts | 12 +- ...ations-publication-claim-page.component.ts | 9 +- .../admin-notifications-routes.ts | 80 ++- .../admin-registries-routes.ts | 23 +- .../add-bitstream-format.component.spec.ts | 37 +- .../add-bitstream-format.component.ts | 35 +- .../bitstream-formats-routes.ts | 17 +- .../bitstream-formats.component.spec.ts | 92 ++-- .../bitstream-formats.component.ts | 85 ++- .../edit-bitstream-format.component.spec.ts | 10 +- .../edit-bitstream-format.component.ts | 19 +- .../format-form/format-form.component.ts | 21 +- .../metadata-registry.component.spec.ts | 56 +- .../metadata-registry.component.ts | 50 +- .../metadata-schema-form.component.spec.ts | 15 +- .../metadata-schema-form.component.ts | 33 +- .../metadata-field-form.component.spec.ts | 25 +- .../metadata-field-form.component.ts | 14 +- .../metadata-schema.component.spec.ts | 32 +- .../metadata-schema.component.ts | 40 +- .../admin-reports/admin-reports-routes.ts | 24 +- .../admin-reports/admin-reports.module.ts | 3 +- .../filtered-collections.component.spec.ts | 16 +- .../filtered-collections.component.ts | 16 +- .../filtered-items.component.ts | 37 +- .../filters-section.component.spec.ts | 20 +- .../filters-section.component.ts | 22 +- src/app/admin/admin-routes.ts | 39 +- .../admin-search-page.component.spec.ts | 14 +- .../admin-search-page.component.ts | 10 +- ...arch-result-grid-element.component.spec.ts | 29 +- ...in-search-result-grid-element.component.ts | 32 +- ...arch-result-grid-element.component.spec.ts | 19 +- ...in-search-result-grid-element.component.ts | 32 +- ...arch-result-grid-element.component.spec.ts | 48 +- ...in-search-result-grid-element.component.ts | 30 +- ...arch-result-list-element.component.spec.ts | 25 +- ...in-search-result-list-element.component.ts | 50 +- ...arch-result-list-element.component.spec.ts | 18 +- ...in-search-result-list-element.component.ts | 50 +- ...arch-result-list-element.component.spec.ts | 32 +- ...in-search-result-list-element.component.ts | 28 +- ...in-search-result-actions.component.spec.ts | 10 +- ...m-admin-search-result-actions.component.ts | 19 +- .../admin-sidebar-section.component.spec.ts | 32 +- .../admin-sidebar-section.component.ts | 28 +- .../admin-sidebar.component.spec.ts | 75 ++- .../admin-sidebar/admin-sidebar.component.ts | 24 +- ...le-admin-sidebar-section.component.spec.ts | 12 +- ...andable-admin-sidebar-section.component.ts | 22 +- .../themed-admin-sidebar.component.ts | 8 +- .../admin-workflow-page.component.spec.ts | 8 +- .../admin-workflow-page.component.ts | 10 +- ...m-admin-workflow-actions.component.spec.ts | 16 +- ...w-item-admin-workflow-actions.component.ts | 19 +- ...ion-order-group-selector.component.spec.ts | 28 +- ...ervision-order-group-selector.component.ts | 25 +- ...supervision-order-status.component.spec.ts | 20 +- .../supervision-order-status.component.ts | 41 +- ...m-admin-workflow-actions.component.spec.ts | 12 +- ...e-item-admin-workflow-actions.component.ts | 29 +- ...in-workflow-grid-element.component.spec.ts | 74 ++- ...t-admin-workflow-grid-element.component.ts | 44 +- ...in-workflow-grid-element.component.spec.ts | 70 +-- ...t-admin-workflow-grid-element.component.ts | 48 +- ...in-workflow-list-element.component.spec.ts | 56 +- ...t-admin-workflow-list-element.component.ts | 19 +- ...in-workflow-list-element.component.spec.ts | 52 +- ...t-admin-workflow-list-element.component.ts | 19 +- src/app/app-routing.module.ts | 48 +- src/app/app.component.ts | 21 +- src/app/app.module.ts | 91 +-- ...bitstream-authorizations.component.spec.ts | 26 +- .../bitstream-authorizations.component.ts | 13 +- .../bitstream-download-page.component.spec.ts | 6 +- .../bitstream-download-page.component.ts | 28 +- .../bitstream-page/bitstream-page-routes.ts | 43 +- .../edit-bitstream-page.component.spec.ts | 80 +-- .../edit-bitstream-page.component.ts | 88 ++- .../themed-edit-bitstream-page.component.ts | 8 +- .../breadcrumbs/breadcrumbs.component.spec.ts | 18 +- src/app/breadcrumbs/breadcrumbs.component.ts | 23 +- .../themed-breadcrumbs.component.ts | 8 +- .../browse-by-date.component.spec.ts | 12 +- .../browse-by-date.component.ts | 70 ++- src/app/browse-by/browse-by-guard.ts | 2 +- .../browse-by-metadata.component.spec.ts | 36 +- .../browse-by-metadata.component.ts | 116 ++-- src/app/browse-by/browse-by-page-routes.ts | 17 +- src/app/browse-by/browse-by-page.module.ts | 7 +- .../browse-by-page.component.spec.ts | 10 +- .../browse-by-page.component.ts | 6 +- .../browse-by-switcher/browse-by-decorator.ts | 21 +- .../browse-by-switcher.component.spec.ts | 37 +- .../browse-by-switcher.component.ts | 11 +- .../browse-by-taxonomy.component.spec.ts | 12 +- .../browse-by-taxonomy.component.ts | 78 +-- .../browse-by-title.component.spec.ts | 97 ++-- .../browse-by-title.component.ts | 52 +- .../collection-form.component.ts | 53 +- .../collection-item-mapper.component.spec.ts | 20 +- .../collection-item-mapper.component.ts | 81 ++- .../collection-page/collection-page-routes.ts | 63 +-- .../collection-page.component.ts | 61 ++- .../create-collection-page.component.spec.ts | 23 +- .../create-collection-page.component.ts | 25 +- .../delete-collection-page.component.spec.ts | 27 +- .../delete-collection-page.component.ts | 43 +- ...ollection-access-control.component.spec.ts | 30 +- .../collection-access-control.component.ts | 13 +- ...ollection-authorizations.component.spec.ts | 16 +- .../collection-authorizations.component.ts | 6 +- .../collection-curate.component.spec.ts | 14 +- .../collection-curate.component.ts | 10 +- .../collection-metadata.component.spec.ts | 34 +- .../collection-metadata.component.ts | 42 +- .../collection-roles.component.spec.ts | 56 +- .../collection-roles.component.ts | 13 +- ...llection-source-controls.component.spec.ts | 8 +- .../collection-source-controls.component.ts | 52 +- .../collection-source.component.spec.ts | 22 +- .../collection-source.component.ts | 23 +- .../edit-collection-page-routes.ts | 61 +-- .../edit-collection-page.component.spec.ts | 21 +- .../edit-collection-page.component.ts | 24 +- .../edit-item-template-page.component.spec.ts | 31 +- .../edit-item-template-page.component.ts | 40 +- ...hemed-edit-item-template-page.component.ts | 8 +- .../themed-collection-page.component.ts | 8 +- .../community-list-page-routes.ts | 8 +- .../community-list-page.component.spec.ts | 26 +- .../community-list-page.component.ts | 9 +- .../community-list.component.spec.ts | 38 +- .../community-list.component.ts | 52 +- .../themed-community-list.component.ts | 8 +- .../themed-community-list-page.component.ts | 8 +- .../community-form.component.ts | 51 +- .../community-page/community-page-routes.ts | 49 +- .../community-page.component.ts | 64 ++- .../create-community-page.component.spec.ts | 25 +- .../create-community-page.component.ts | 30 +- .../delete-community-page.component.spec.ts | 8 +- .../delete-community-page.component.ts | 22 +- ...community-access-control.component.spec.ts | 40 +- .../community-access-control.component.ts | 19 +- ...community-authorizations.component.spec.ts | 16 +- .../community-authorizations.component.ts | 6 +- .../community-curate.component.spec.ts | 12 +- .../community-curate.component.ts | 10 +- .../community-metadata.component.spec.ts | 13 +- .../community-metadata.component.ts | 8 +- .../community-roles.component.spec.ts | 29 +- .../community-roles.component.ts | 13 +- .../edit-community-page-routes.ts | 59 +- .../edit-community-page.component.spec.ts | 33 +- .../edit-community-page.component.ts | 18 +- ...page-sub-collection-list.component.spec.ts | 13 +- ...nity-page-sub-collection-list.component.ts | 42 +- ...nity-page-sub-collection-list.component.ts | 8 +- .../sub-com-col-section.component.spec.ts | 8 +- .../sub-com-col-section.component.ts | 24 +- ...-page-sub-community-list.component.spec.ts | 25 +- ...unity-page-sub-community-list.component.ts | 42 +- ...unity-page-sub-community-list.component.ts | 8 +- .../themed-community-page.component.ts | 8 +- .../core/auth/auth-request.service.spec.ts | 13 +- src/app/core/auth/auth.service.spec.ts | 44 +- .../browse/browse-definition-data.service.ts | 6 - src/app/core/cache/builders/link.service.ts | 69 ++- .../notify-info/notify-info.component.spec.ts | 8 +- .../notify-info/notify-info.component.ts | 21 +- .../notify-info/notify-info.service.ts | 7 +- .../config/bulk-access-config-data.service.ts | 2 - ...submission-accesses-config-data.service.ts | 2 +- .../submission-uploads-config-data.service.ts | 2 +- src/app/core/data-services-map.ts | 84 ++- .../core/data/access-status-data.service.ts | 6 - src/app/core/data/bitstream-data.service.ts | 8 - .../data/bitstream-format-data.service.ts | 16 +- src/app/core/data/bundle-data.service.ts | 2 - src/app/core/data/collection-data.service.ts | 4 - src/app/core/data/community-data.service.ts | 5 - .../core/data/configuration-data.service.ts | 4 - .../core/data/dspace-object-data.service.ts | 3 - .../authorization-data.service.ts | 8 - .../feature-data.service.ts | 4 - src/app/core/data/href-only-data.service.ts | 8 +- src/app/core/data/identifier-data.service.ts | 11 +- src/app/core/data/item-data.service.spec.ts | 12 +- src/app/core/data/item-data.service.ts | 42 +- .../core/data/metadata-field-data.service.ts | 22 +- .../core/data/metadata-schema-data.service.ts | 20 +- .../notify-services-status-data.service.ts | 2 +- .../data/processes/process-data.service.ts | 34 +- .../data/processes/script-data.service.ts | 10 +- .../core/data/relationship-data.service.ts | 64 ++- .../data/relationship-type-data.service.ts | 23 +- src/app/core/data/root-data.service.ts | 12 +- src/app/core/data/site-data.service.ts | 5 +- .../data/system-wide-alert-data.service.ts | 20 +- src/app/core/data/version-data.service.ts | 15 +- .../core/data/version-history-data.service.ts | 19 +- .../core/eperson/eperson-data.service.spec.ts | 8 +- src/app/core/eperson/eperson-data.service.ts | 12 - .../core/eperson/group-data.service.spec.ts | 12 +- src/app/core/eperson/group-data.service.ts | 37 +- .../core/feedback/feedback-data.service.ts | 23 +- src/app/core/feedback/feedback.guard.ts | 2 +- .../google-recaptcha.module.ts | 6 +- .../google-recaptcha.service.ts | 2 +- src/app/core/lazy-service.ts | 12 +- .../quality-assurance-event-data.service.ts | 2 +- .../quality-assurance-source-data.service.ts | 2 +- .../quality-assurance-topic-data.service.ts | 2 +- .../source/suggestion-source-data.service.ts | 2 +- .../core/orcid/orcid-history-data.service.ts | 5 +- .../core/orcid/orcid-queue-data.service.ts | 14 +- .../researcher-profile-data.service.ts | 46 +- src/app/core/provide-core.ts | 106 ++-- .../core/registry/registry.service.spec.ts | 27 +- .../resource-policy-data.service.ts | 5 +- src/app/core/services/window.service.ts | 2 +- src/app/core/shared/listable.module.ts | 517 ++++++------------ .../non-hierarchical-browse-definition.ts | 8 +- .../core/shared/search/search.service.spec.ts | 97 ++-- .../statistics/usage-report-data.service.ts | 16 +- .../submission/correctiontype-data.service.ts | 2 +- .../submission-cc-license-data.service.ts | 11 +- .../submission-cc-license-url-data.service.ts | 27 +- .../vocabulary-entry-details.data.service.ts | 10 +- .../vocabularies/vocabulary.data.service.ts | 2 - .../submission/workflowitem-data.service.ts | 1 - .../submission/workspaceitem-data.service.ts | 43 +- .../supervision-order-data.service.ts | 5 +- .../core/tasks/claimed-task-data.service.ts | 6 - .../curation-form.component.spec.ts | 8 +- .../curation-form/curation-form.component.ts | 62 ++- ...it-metadata-field-values.component.spec.ts | 26 +- ...so-edit-metadata-field-values.component.ts | 25 +- ...so-edit-metadata-headers.component.spec.ts | 8 +- .../dso-edit-metadata-headers.component.ts | 10 +- ...o-edit-metadata-value-headers.component.ts | 10 +- .../dso-edit-metadata-value.component.spec.ts | 85 +-- .../dso-edit-metadata-value.component.ts | 51 +- .../dso-edit-metadata.component.spec.ts | 23 +- .../dso-edit-metadata.component.ts | 34 +- .../metadata-field-selector.component.spec.ts | 8 +- .../metadata-field-selector.component.ts | 53 +- .../themed-dso-edit-metadata.component.ts | 8 +- ...urnal-issue-grid-element.component.spec.ts | 8 +- .../journal-issue-grid-element.component.ts | 22 +- ...rnal-volume-grid-element.component.spec.ts | 38 +- .../journal-volume-grid-element.component.ts | 22 +- .../journal-grid-element.component.spec.ts | 12 +- .../journal/journal-grid-element.component.ts | 22 +- ...ue-search-result-grid-element.component.ts | 35 +- ...me-search-result-grid-element.component.ts | 35 +- ...al-search-result-grid-element.component.ts | 35 +- ...urnal-issue-list-element.component.spec.ts | 38 +- .../journal-issue-list-element.component.ts | 22 +- ...rnal-volume-list-element.component.spec.ts | 24 +- .../journal-volume-list-element.component.ts | 23 +- .../journal-list-element.component.spec.ts | 40 +- .../journal/journal-list-element.component.ts | 22 +- ...arch-result-list-element.component.spec.ts | 49 +- ...ue-search-result-list-element.component.ts | 34 +- ...arch-result-list-element.component.spec.ts | 63 ++- ...me-search-result-list-element.component.ts | 34 +- ...arch-result-list-element.component.spec.ts | 35 +- ...al-search-result-list-element.component.ts | 38 +- ...e-sidebar-search-list-element.component.ts | 35 +- ...e-sidebar-search-list-element.component.ts | 35 +- ...l-sidebar-search-list-element.component.ts | 35 +- .../journal-issue/journal-issue.component.ts | 41 +- .../journal-volume.component.ts | 41 +- .../journal/journal.component.spec.ts | 52 +- .../item-pages/journal/journal.component.ts | 45 +- .../org-unit-grid-element.component.spec.ts | 52 +- .../org-unit-grid-element.component.ts | 22 +- .../person-grid-element.component.spec.ts | 18 +- .../person/person-grid-element.component.ts | 22 +- .../project-grid-element.component.spec.ts | 52 +- .../project/project-grid-element.component.ts | 22 +- ...it-search-result-grid-element.component.ts | 36 +- ...on-search-result-grid-element.component.ts | 36 +- ...ct-search-result-grid-element.component.ts | 36 +- .../org-unit-list-element.component.spec.ts | 38 +- .../org-unit-list-element.component.ts | 22 +- .../person-list-element.component.spec.ts | 40 +- .../person/person-list-element.component.ts | 22 +- .../project-list-element.component.spec.ts | 40 +- .../project/project-list-element.component.ts | 23 +- ...arch-result-list-element.component.spec.ts | 80 +-- ...it-search-result-list-element.component.ts | 34 +- ...arch-result-list-element.component.spec.ts | 60 +- ...on-search-result-list-element.component.ts | 47 +- ...arch-result-list-element.component.spec.ts | 41 +- ...ct-search-result-list-element.component.ts | 27 +- ...t-sidebar-search-list-element.component.ts | 29 +- ...n-sidebar-search-list-element.component.ts | 35 +- ...t-sidebar-search-list-element.component.ts | 29 +- .../item-pages/org-unit/org-unit.component.ts | 49 +- .../item-pages/person/person.component.ts | 45 +- .../item-pages/project/project.component.ts | 45 +- ...em-metadata-list-element.component.spec.ts | 21 +- ...it-item-metadata-list-element.component.ts | 15 +- ...em-metadata-list-element.component.spec.ts | 21 +- ...on-item-metadata-list-element.component.ts | 20 +- ...em-metadata-list-element.component.spec.ts | 21 +- ...ct-item-metadata-list-element.component.ts | 17 +- ...-list-submission-element.component.spec.ts | 6 +- ...entry-list-submission-element.component.ts | 14 +- ...-list-submission-element.component.spec.ts | 32 +- ...esult-list-submission-element.component.ts | 33 +- ...g-unit-input-suggestions.component.spec.ts | 21 +- .../org-unit-input-suggestions.component.ts | 53 +- ...-list-submission-element.component.spec.ts | 82 +-- ...esult-list-submission-element.component.ts | 40 +- .../person-input-suggestions.component.ts | 53 +- .../name-variant-modal.component.spec.ts | 6 +- .../name-variant-modal.component.ts | 10 +- src/app/footer/footer.component.spec.ts | 18 +- src/app/footer/footer.component.ts | 20 +- src/app/footer/themed-footer.component.ts | 8 +- src/app/forbidden/forbidden.component.ts | 14 +- .../forbidden/themed-forbidden.component.ts | 8 +- .../forgot-email.component.spec.ts | 16 +- .../forgot-email.component.ts | 8 +- .../themed-forgot-email.component.ts | 8 +- .../forgot-password-form.component.spec.ts | 26 +- .../forgot-password-form.component.ts | 28 +- .../themed-forgot-password-form.component.ts | 8 +- .../forgot-password/forgot-password-routes.ts | 17 +- .../header-navbar-wrapper.component.ts | 29 +- .../themed-header-navbar-wrapper.component.ts | 8 +- .../context-help-toggle.component.spec.ts | 8 +- .../context-help-toggle.component.ts | 17 +- src/app/header/header.component.spec.ts | 49 +- src/app/header/header.component.ts | 41 +- src/app/header/themed-header.component.ts | 8 +- .../health-info-component.component.spec.ts | 4 +- .../health-info-component.component.ts | 27 +- .../health-info/health-info.component.spec.ts | 16 +- .../health-info/health-info.component.ts | 22 +- src/app/health-page/health-page-routes.ts | 8 +- .../health-page/health-page.component.spec.ts | 20 +- src/app/health-page/health-page.component.ts | 33 +- .../health-component.component.spec.ts | 16 +- .../health-component.component.ts | 25 +- .../health-panel.component.spec.ts | 41 +- .../health-panel/health-panel.component.ts | 29 +- .../health-status.component.spec.ts | 18 +- .../health-status/health-status.component.ts | 19 +- .../home-news/home-news.component.ts | 8 +- .../home-news/themed-home-news.component.ts | 8 +- src/app/home-page/home-page-routes.ts | 17 +- src/app/home-page/home-page.component.ts | 66 ++- .../recent-item-list.component.spec.ts | 28 +- .../recent-item-list.component.ts | 67 ++- .../home-page/themed-home-page.component.ts | 8 +- ...emed-top-level-community-list.component.ts | 8 +- ...top-level-community-list.component.spec.ts | 18 +- .../top-level-community-list.component.ts | 49 +- .../import-external-page-routes.ts | 11 +- .../import-external-page.component.spec.ts | 40 +- .../import-external-page.component.ts | 9 +- ...d-user-agreement-content.component.spec.ts | 8 +- .../end-user-agreement-content.component.ts | 12 +- .../end-user-agreement.component.spec.ts | 6 +- .../end-user-agreement.component.ts | 31 +- .../themed-end-user-agreement.component.ts | 8 +- .../feedback-form.component.spec.ts | 8 +- .../feedback-form/feedback-form.component.ts | 58 +- .../themed-feedback-form.component.ts | 8 +- .../info/feedback/feedback.component.spec.ts | 16 +- src/app/info/feedback/feedback.component.ts | 11 +- .../feedback/themed-feedback.component.ts | 8 +- src/app/info/info-routes.ts | 32 +- .../privacy-content.component.spec.ts | 16 +- .../privacy-content.component.ts | 12 +- .../info/privacy/privacy.component.spec.ts | 20 +- src/app/info/privacy/privacy.component.ts | 11 +- .../info/privacy/themed-privacy.component.ts | 8 +- src/app/init.service.ts | 27 +- .../alerts/item-alerts.component.spec.ts | 14 +- .../item-page/alerts/item-alerts.component.ts | 30 +- .../alerts/themed-item-alerts.component.ts | 8 +- ...ream-request-a-copy-page.component.spec.ts | 6 +- ...bitstream-request-a-copy-page.component.ts | 88 ++- .../upload/upload-bitstream.component.spec.ts | 21 +- .../upload/upload-bitstream.component.ts | 59 +- .../abstract-item-update.component.ts | 6 +- .../edit-item-page/edit-item-page-routes.ts | 105 ++-- .../edit-item-page.component.spec.ts | 46 +- .../edit-item-page.component.ts | 38 +- .../edit-item-page/edit-item-page.module.ts | 43 +- .../item-access-control.component.spec.ts | 38 +- .../item-access-control.component.ts | 13 +- .../item-authorizations.component.spec.ts | 52 +- .../item-authorizations.component.ts | 41 +- .../item-bitstreams.component.spec.ts | 20 +- .../item-bitstreams.component.ts | 71 ++- ...em-edit-bitstream-bundle.component.spec.ts | 6 +- .../item-edit-bitstream-bundle.component.ts | 27 +- ...-and-drop-bitstream-list.component.spec.ts | 16 +- ...-drag-and-drop-bitstream-list.component.ts | 42 +- ...em-edit-bitstream-drag-handle.component.ts | 4 +- .../item-edit-bitstream.component.spec.ts | 16 +- .../item-edit-bitstream.component.ts | 15 +- .../item-collection-mapper.component.spec.ts | 6 +- .../item-collection-mapper.component.ts | 58 +- .../item-curate/item-curate.component.spec.ts | 33 +- .../item-curate/item-curate.component.ts | 19 +- .../item-delete/item-delete.component.spec.ts | 58 +- .../item-delete/item-delete.component.ts | 54 +- .../item-move/item-move.component.spec.ts | 24 +- .../item-move/item-move.component.ts | 49 +- .../item-operation.component.spec.ts | 4 +- .../item-operation.component.ts | 12 +- .../item-private.component.spec.ts | 8 +- .../item-private/item-private.component.ts | 16 +- .../item-public/item-public.component.spec.ts | 8 +- .../item-public/item-public.component.ts | 15 +- .../item-register-doi.component.spec.ts | 8 +- .../item-register-doi.component.ts | 28 +- .../item-reinstate.component.spec.ts | 8 +- .../item-reinstate.component.ts | 15 +- .../edit-relationship-list.component.spec.ts | 96 ++-- .../edit-relationship-list.component.ts | 28 +- .../edit-relationship.component.spec.ts | 52 +- .../edit-relationship.component.ts | 35 +- .../item-relationships.component.spec.ts | 35 +- .../item-relationships.component.ts | 32 +- .../item-status/item-status.component.spec.ts | 4 +- .../item-status/item-status.component.ts | 22 +- .../themed-item-status.component.ts | 8 +- .../item-version-history.component.spec.ts | 46 +- .../item-version-history.component.ts | 11 +- .../item-withdraw.component.spec.ts | 8 +- .../item-withdraw/item-withdraw.component.ts | 16 +- .../modify-item-overview.component.spec.ts | 4 +- .../modify-item-overview.component.ts | 15 +- ...tract-simple-item-action.component.spec.ts | 16 +- .../abstract-simple-item-action.component.ts | 48 +- .../virtual-metadata.component.spec.ts | 22 +- .../virtual-metadata.component.ts | 30 +- .../collections/collections.component.spec.ts | 14 +- .../collections/collections.component.ts | 14 +- .../metadata-uri-values.component.spec.ts | 20 +- .../metadata-uri-values.component.ts | 16 +- .../metadata-values.component.spec.ts | 18 +- .../metadata-values.component.ts | 40 +- .../full-file-section.component.spec.ts | 44 +- .../full-file-section.component.ts | 54 +- .../themed-full-file-section.component.ts | 8 +- .../full/full-item-page.component.spec.ts | 76 ++- .../full/full-item-page.component.ts | 56 +- .../full/themed-full-item-page.component.ts | 8 +- src/app/item-page/item-page-routes.ts | 57 +- src/app/item-page/item-page.module.ts | 57 +- src/app/item-page/item-shared.module.ts | 48 +- .../media-viewer-image.component.spec.ts | 10 +- .../media-viewer-image.component.ts | 22 +- .../themed-media-viewer-image.component.ts | 8 +- .../media-viewer-video.component.spec.ts | 18 +- .../media-viewer-video.component.ts | 11 +- .../themed-media-viewer-video.component.ts | 8 +- .../media-viewer.component.spec.ts | 41 +- .../media-viewer/media-viewer.component.ts | 40 +- .../themed-media-viewer.component.ts | 8 +- .../mirador-viewer.component.spec.ts | 72 +-- .../mirador-viewer.component.ts | 41 +- .../orcid-auth/orcid-auth.component.spec.ts | 18 +- .../orcid-page/orcid-page.component.spec.ts | 54 +- .../orcid-page/orcid-page.component.ts | 52 +- .../orcid-queue/orcid-queue.component.spec.ts | 48 +- .../orcid-queue/orcid-queue.component.ts | 39 +- .../orcid-sync-settings.component.spec.ts | 46 +- .../orcid-sync-settings.component.ts | 26 +- .../abstract-incremental-list.component.ts | 6 +- .../file-section.component.spec.ts | 50 +- .../file-section/file-section.component.ts | 31 +- .../themed-file-section.component.ts | 2 +- ...item-page-abstract-field.component.spec.ts | 35 +- .../item-page-abstract-field.component.ts | 6 +- .../item-page-author-field.component.spec.ts | 26 +- .../item-page-author-field.component.ts | 6 +- .../item-page-date-field.component.spec.ts | 4 +- .../date/item-page-date-field.component.ts | 6 +- .../generic-item-page-field.component.spec.ts | 40 +- .../generic-item-page-field.component.ts | 12 +- .../img/item-page-img-field.component.spec.ts | 20 +- .../img/item-page-img-field.component.ts | 16 +- .../item-page-field.component.spec.ts | 49 +- .../item-page-field.component.ts | 6 +- .../item-page-title-field.component.spec.ts | 16 +- .../title/item-page-title-field.component.ts | 17 +- .../title/themed-item-page-field.component.ts | 8 +- .../uri/item-page-uri-field.component.spec.ts | 20 +- .../uri/item-page-uri-field.component.ts | 8 +- .../simple/item-page.component.spec.ts | 79 +-- .../item-page/simple/item-page.component.ts | 63 ++- .../publication/publication.component.spec.ts | 51 +- .../publication/publication.component.ts | 53 +- .../item-types/shared/item.component.spec.ts | 158 +++--- .../item-types/shared/item.component.ts | 6 +- .../untyped-item.component.spec.ts | 49 +- .../untyped-item/untyped-item.component.ts | 51 +- ...data-representation-list.component.spec.ts | 39 +- .../metadata-representation-list.component.ts | 40 +- ...-metadata-representation-list.component.ts | 8 +- .../notify-requests-status.component.spec.ts | 6 +- .../notify-requests-status.component.ts | 36 +- ...request-status-alert-box.component.spec.ts | 4 +- .../request-status-alert-box.component.ts | 15 +- .../qa-event-notification.component.spec.ts | 19 +- .../qa-event-notification.component.ts | 33 +- .../related-entities-search.component.spec.ts | 12 +- .../related-entities-search.component.ts | 16 +- ...-related-entities-search.component.spec.ts | 8 +- ...abbed-related-entities-search.component.ts | 33 +- .../related-items/related-items-component.ts | 41 +- .../related-items.component.spec.ts | 67 +-- .../simple/themed-item-page.component.ts | 8 +- .../version-page.component.spec.ts | 12 +- .../version-page/version-page.component.ts | 28 +- ...em-versions-delete-modal.component.spec.ts | 6 +- .../item-versions-delete-modal.component.ts | 10 +- ...m-versions-summary-modal.component.spec.ts | 6 +- .../item-versions-summary-modal.component.ts | 19 +- .../versions/item-versions.component.spec.ts | 77 ++- .../versions/item-versions.component.ts | 87 ++- .../versions/item-versions.module.ts | 13 +- .../item-versions-notice.component.spec.ts | 20 +- .../notice/item-versions-notice.component.ts | 17 +- src/app/login-page/login-page-routes.ts | 9 +- .../login-page/login-page.component.spec.ts | 18 +- src/app/login-page/login-page.component.ts | 33 +- .../login-page/themed-login-page.component.ts | 8 +- src/app/logout-page/logout-page-routes.ts | 5 +- .../logout-page/logout-page.component.spec.ts | 8 +- src/app/logout-page/logout-page.component.ts | 11 +- .../themed-logout-page.component.ts | 8 +- src/app/lookup-by-id/lookup-by-id-routes.ts | 12 +- src/app/lookup-by-id/lookup-by-id.module.ts | 12 +- .../objectnotfound.component.spec.ts | 28 +- .../objectnotfound.component.ts | 17 +- .../themed-objectnotfound.component.ts | 8 +- src/app/menu.resolver.spec.ts | 30 +- .../collection-selector.component.spec.ts | 38 +- .../collection-selector.component.ts | 10 +- .../my-dspace-configuration.service.ts | 40 +- ...ce-new-external-dropdown.component.spec.ts | 70 ++- ...-dspace-new-external-dropdown.component.ts | 31 +- ...-new-submission-dropdown.component.spec.ts | 70 ++- ...space-new-submission-dropdown.component.ts | 39 +- ...my-dspace-new-submission.component.spec.ts | 24 +- .../my-dspace-new-submission.component.ts | 14 +- .../my-dspace-page/my-dspace-page-routes.ts | 17 +- .../my-dspace-page.component.spec.ts | 37 +- .../my-dspace-page.component.ts | 41 +- .../my-dspace-page/my-dspace-page.module.ts | 37 +- ...-qa-events-notifications.component.spec.ts | 8 +- ...space-qa-events-notifications.component.ts | 14 +- .../themed-my-dspace-page.component.ts | 8 +- ...xpandable-navbar-section.component.spec.ts | 26 +- .../expandable-navbar-section.component.ts | 21 +- ...med-expandable-navbar-section.component.ts | 4 +- .../navbar-section.component.spec.ts | 12 +- .../navbar-section.component.ts | 14 +- src/app/navbar/navbar.component.spec.ts | 18 +- src/app/navbar/navbar.component.ts | 44 +- src/app/navbar/navbar.module.ts | 30 +- src/app/navbar/themed-navbar.component.ts | 8 +- .../notifications-state.service.ts | 2 +- .../provide-suggestion-notifications.ts | 17 +- .../ePerson-data.component.spec.ts | 10 +- .../ePerson-data/ePerson-data.component.ts | 7 +- ...quality-assurance-events.component.spec.ts | 53 +- .../quality-assurance-events.component.ts | 77 ++- ...oject-entry-import-modal.component.spec.ts | 57 +- .../project-entry-import-modal.component.ts | 45 +- ...quality-assurance-source.component.spec.ts | 68 ++- .../quality-assurance-source.component.ts | 38 +- .../quality-assurance-source.service.ts | 2 +- ...quality-assurance-topics.component.spec.ts | 72 +-- .../quality-assurance-topics.component.ts | 59 +- .../quality-assurance-topics.service.ts | 2 +- .../suggestion-actions.component.ts | 28 +- .../suggestion-evidences.component.ts | 11 +- .../suggestion-list-element.component.spec.ts | 12 +- .../suggestion-list-element.component.ts | 12 +- .../publication-claim.component.ts | 36 +- .../suggestion-targets.state.service.ts | 2 +- .../suggestions-notification.component.ts | 17 +- .../suggestions-popup.component.spec.ts | 12 +- .../suggestions-popup.component.ts | 32 +- src/app/notifications/suggestions.service.ts | 2 +- .../page-error/page-error.component.spec.ts | 29 +- src/app/page-error/page-error.component.ts | 17 +- .../page-error/themed-page-error.component.ts | 8 +- .../page-internal-server-error.component.ts | 19 +- ...ed-page-internal-server-error.component.ts | 8 +- .../pagenotfound/pagenotfound.component.ts | 22 +- .../themed-pagenotfound.component.ts | 8 +- .../process-detail-field.component.spec.ts | 14 +- .../process-detail-field.component.ts | 13 +- .../detail/process-detail.component.spec.ts | 58 +- .../detail/process-detail.component.ts | 63 ++- .../form/process-form.component.spec.ts | 30 +- .../form/process-form.component.ts | 54 +- .../parameter-select.component.spec.ts | 32 +- .../parameter-select.component.ts | 43 +- .../boolean-value-input.component.spec.ts | 4 +- .../boolean-value-input.component.ts | 18 +- .../date-value-input.component.spec.ts | 16 +- .../date-value-input.component.ts | 34 +- .../file-value-input.component.spec.ts | 18 +- .../file-value-input.component.ts | 35 +- .../parameter-value-input.component.spec.ts | 25 +- .../parameter-value-input.component.ts | 42 +- .../string-value-input.component.spec.ts | 18 +- .../string-value-input.component.ts | 32 +- .../process-parameters.component.spec.ts | 29 +- .../process-parameters.component.ts | 44 +- .../script-help/script-help.component.spec.ts | 31 +- .../form/script-help/script-help.component.ts | 24 +- .../scripts-select.component.spec.ts | 38 +- .../scripts-select.component.ts | 69 ++- .../new/new-process.component.spec.ts | 10 +- .../process-page/new/new-process.component.ts | 19 +- .../process-overview.component.spec.ts | 25 +- .../overview/process-overview.component.ts | 30 +- .../process-overview-table.component.spec.ts | 10 +- .../table/process-overview-table.component.ts | 60 +- src/app/process-page/process-page-routes.ts | 29 +- .../process-page-shared.module.ts | 63 +-- ...profile-claim-item-modal.component.spec.ts | 25 +- .../profile-claim-item-modal.component.ts | 32 +- ...ofile-page-metadata-form.component.spec.ts | 36 +- .../profile-page-metadata-form.component.ts | 24 +- ...ile-page-researcher-form.component.spec.ts | 8 +- .../profile-page-researcher-form.component.ts | 18 +- src/app/profile-page/profile-page-routes.ts | 9 +- ...ofile-page-security-form.component.spec.ts | 30 +- .../profile-page-security-form.component.ts | 30 +- .../profile-page.component.spec.ts | 56 +- .../profile-page/profile-page.component.ts | 50 +- .../themed-profile-page.component.ts | 8 +- .../notifications-pages-routes.ts | 76 +-- ...-suggestion-targets-page.component.spec.ts | 12 +- ...tions-suggestion-targets-page.component.ts | 9 +- ...ty-assurance-events-page.component.spec.ts | 20 +- ...quality-assurance-events-page.component.ts | 9 +- ...ty-assurance-source-page.component.spec.ts | 13 +- ...quality-assurance-source-page.component.ts | 5 +- ...ty-assurance-topics-page.component.spec.ts | 8 +- ...quality-assurance-topics-page.component.ts | 9 +- .../register-email-form.component.spec.ts | 39 +- .../register-email-form.component.ts | 62 ++- .../register-email-form.module.ts | 17 +- .../themed-registry-email-form.component.ts | 2 +- .../create-profile.component.spec.ts | 16 +- .../create-profile.component.ts | 74 ++- .../themed-create-profile.component.ts | 8 +- .../register-email.component.spec.ts | 14 +- .../register-email.component.ts | 8 +- .../themed-register-email.component.ts | 8 +- src/app/register-page/register-page-routes.ts | 19 +- .../deny-request-copy.component.spec.ts | 12 +- .../deny-request-copy.component.ts | 40 +- .../themed-deny-request-copy.component.ts | 8 +- .../email-request-copy.component.spec.ts | 8 +- .../email-request-copy.component.ts | 34 +- .../themed-email-request-copy.component.ts | 8 +- .../grant-deny-request-copy.component.spec.ts | 8 +- .../grant-deny-request-copy.component.ts | 49 +- .../grant-request-copy.component.spec.ts | 28 +- .../grant-request-copy.component.ts | 48 +- .../themed-grant-request-copy.component.ts | 8 +- src/app/request-copy/request-copy-routes.ts | 18 +- src/app/root.module.ts | 34 +- src/app/root/root.component.spec.ts | 80 +-- src/app/root/root.component.ts | 60 +- src/app/root/themed-root.component.ts | 8 +- .../search-navbar.component.spec.ts | 41 +- .../search-navbar/search-navbar.component.ts | 26 +- .../themed-search-navbar.component.ts | 8 +- ...onfiguration-search-page.component.spec.ts | 4 +- .../configuration-search-page.component.ts | 82 +-- src/app/search-page/search-page-routes.ts | 16 +- src/app/search-page/search-page.component.ts | 22 +- src/app/search-page/search-page.module.ts | 23 +- ...med-configuration-search-page.component.ts | 8 +- .../themed-search-page.component.ts | 8 +- .../abstract-component-loader.component.ts | 2 +- .../dynamic-component-loader.directive.ts | 2 +- ...ccess-control-array-form.component.spec.ts | 6 +- .../access-control-array-form.component.ts | 30 +- .../access-control-array-form/to-date.pipe.ts | 8 +- ...s-control-form-container.component.spec.ts | 25 +- ...access-control-form-container.component.ts | 57 +- ...-select-bitstreams-modal.component.spec.ts | 53 +- ...ntrol-select-bitstreams-modal.component.ts | 28 +- src/app/shared/alert/alert.component.spec.ts | 25 +- src/app/shared/alert/alert.component.ts | 27 +- .../auth-nav-menu.component.spec.ts | 34 +- .../auth-nav-menu/auth-nav-menu.component.ts | 31 +- .../themed-auth-nav-menu.component.ts | 8 +- .../user-menu/themed-user-menu.component.ts | 2 +- .../user-menu/user-menu.component.spec.ts | 59 +- .../user-menu/user-menu.component.ts | 43 +- .../browse-by/browse-by.component.spec.ts | 31 +- .../shared/browse-by/browse-by.component.ts | 59 +- .../browse-by/shared-browse-by.module.ts | 20 +- .../browse-by/themed-browse-by.component.ts | 20 +- .../collection-dropdown.component.spec.ts | 30 +- .../collection-dropdown.component.ts | 30 +- .../themed-collection-dropdown.component.ts | 8 +- .../comcol-form/comcol-form.component.spec.ts | 29 +- .../comcol-form/comcol-form.component.ts | 39 +- .../create-comcol-page.component.spec.ts | 19 +- .../create-comcol-page.component.ts | 6 +- .../delete-comcol-page.component.spec.ts | 19 +- .../delete-comcol-page.component.ts | 6 +- .../comcol-metadata.component.spec.ts | 7 +- .../comcol-metadata.component.ts | 6 +- .../comcol-role/comcol-role.component.spec.ts | 28 +- .../comcol-role/comcol-role.component.ts | 28 +- .../edit-comcol-page.component.spec.ts | 25 +- .../edit-comcol-page.component.ts | 6 +- .../comcol-page-browse-by.component.ts | 34 +- .../themed-comcol-page-browse-by.component.ts | 8 +- .../comcol-page-content.component.ts | 6 +- .../comcol-page-handle.component.spec.ts | 4 +- .../comcol-page-handle.component.ts | 4 +- .../themed-comcol-page-handle.component.ts | 8 +- .../comcol-page-header.component.ts | 6 +- .../comcol-page-logo.component.ts | 4 +- .../comcol-browse-by.component.spec.ts | 10 +- .../comcol-browse-by.component.ts | 8 +- .../comcol-search-section.component.spec.ts | 8 +- .../comcol-search-section.component.ts | 14 +- .../confirmation-modal.component.spec.ts | 8 +- .../confirmation-modal.component.ts | 10 +- .../context-help-wrapper.component.spec.ts | 14 +- .../context-help-wrapper.component.ts | 25 +- src/app/shared/context-help.directive.spec.ts | 16 +- src/app/shared/context-help.directive.ts | 4 +- .../withdrawn-reinstate-modal.component.ts | 18 +- .../ds-select/ds-select.component.spec.ts | 8 +- .../shared/ds-select/ds-select.component.ts | 14 +- .../dso-page/dso-edit-menu.resolver.spec.ts | 59 +- ...-menu-expandable-section.component.spec.ts | 20 +- ...-edit-menu-expandable-section.component.ts | 41 +- .../dso-edit-menu-section.component.spec.ts | 45 +- .../dso-edit-menu-section.component.ts | 18 +- .../dso-edit-menu.component.spec.ts | 8 +- .../dso-edit-menu/dso-edit-menu.component.ts | 16 +- src/app/shared/dso-page/dso-page.module.ts | 20 +- ...ized-collection-selector.component.spec.ts | 18 +- ...uthorized-collection-selector.component.ts | 55 +- .../dso-selector.component.spec.ts | 16 +- .../dso-selector/dso-selector.component.ts | 58 +- ...llection-parent-selector.component.spec.ts | 32 +- ...te-collection-parent-selector.component.ts | 14 +- ...te-collection-parent-selector.component.ts | 4 +- ...ommunity-parent-selector.component.spec.ts | 32 +- ...ate-community-parent-selector.component.ts | 29 +- ...ate-community-parent-selector.component.ts | 4 +- ...ate-item-parent-selector.component.spec.ts | 34 +- .../create-item-parent-selector.component.ts | 18 +- ...d-create-item-parent-selector.component.ts | 4 +- ...o-selector-modal-wrapper.component.spec.ts | 30 +- ...edit-collection-selector.component.spec.ts | 6 +- .../edit-collection-selector.component.ts | 29 +- ...emed-edit-collection-selector.component.ts | 4 +- .../edit-community-selector.component.spec.ts | 42 +- .../edit-community-selector.component.ts | 29 +- ...hemed-edit-community-selector.component.ts | 4 +- .../edit-item-selector.component.spec.ts | 2 +- .../edit-item-selector.component.ts | 14 +- .../themed-edit-item-selector.component.ts | 4 +- .../export-batch-selector.component.spec.ts | 42 +- .../export-batch-selector.component.ts | 62 ++- ...export-metadata-selector.component.spec.ts | 42 +- .../export-metadata-selector.component.ts | 60 +- .../import-batch-selector.component.spec.ts | 14 +- .../import-batch-selector.component.ts | 31 +- .../entity-dropdown.component.spec.ts | 24 +- .../entity-dropdown.component.ts | 20 +- .../eperson-group-list.component.spec.ts | 35 +- .../eperson-group-list.component.ts | 30 +- .../eperson-search-box.component.spec.ts | 31 +- .../eperson-search-box.component.ts | 18 +- .../group-search-box.component.spec.ts | 45 +- .../group-search-box.component.ts | 22 +- src/app/shared/error/error.component.spec.ts | 6 +- src/app/shared/error/error.component.ts | 12 +- .../file-download-link.component.spec.ts | 26 +- .../file-download-link.component.ts | 43 +- .../themed-file-download-link.component.ts | 8 +- ...c-form-control-container.component.spec.ts | 180 +++--- ...ynamic-form-control-container.component.ts | 113 ++-- .../ds-dynamic-form-control-map-fn.ts | 53 +- .../ds-dynamic-form.component.ts | 9 +- .../ds-dynamic-type-bind-relation.service.ts | 2 +- ...ng-metadata-list-element.component.spec.ts | 36 +- ...xisting-metadata-list-element.component.ts | 29 +- ...ng-relation-list-element.component.spec.ts | 22 +- ...xisting-relation-list-element.component.ts | 15 +- .../dynamic-form-array.component.ts | 28 +- .../custom-switch.component.spec.ts | 14 +- .../custom-switch/custom-switch.component.ts | 13 +- ...namic-date-picker-inline.component.spec.ts | 8 +- .../dynamic-date-picker-inline.component.ts | 26 +- .../date-picker/date-picker.component.spec.ts | 35 +- .../date-picker/date-picker.component.ts | 43 +- .../dynamic-disabled.component.spec.ts | 8 +- .../disabled/dynamic-disabled.component.ts | 6 +- .../dynamic-form-group.component.ts | 20 +- .../list/dynamic-list.component.spec.ts | 34 +- .../models/list/dynamic-list.component.ts | 55 +- .../lookup/dynamic-lookup.component.spec.ts | 30 +- .../models/lookup/dynamic-lookup.component.ts | 30 +- .../onebox/dynamic-onebox.component.spec.ts | 28 +- .../models/onebox/dynamic-onebox.component.ts | 39 +- .../dynamic-relation-group.component.spec.ts | 119 ++-- .../dynamic-relation-group.components.ts | 19 +- ...amic-scrollable-dropdown.component.spec.ts | 30 +- .../models/tag/dynamic-tag.component.spec.ts | 60 +- .../models/tag/dynamic-tag.component.ts | 42 +- ...ic-lookup-relation-modal.component.spec.ts | 22 +- ...dynamic-lookup-relation-modal.component.ts | 159 ++++-- ...tion-external-source-tab.component.spec.ts | 46 +- ...-relation-external-source-tab.component.ts | 106 ++-- ...ource-entry-import-modal.component.spec.ts | 28 +- ...nal-source-entry-import-modal.component.ts | 60 +- ...nal-source-entry-import-modal.component.ts | 8 +- ...-relation-external-source-tab.component.ts | 8 +- ...okup-relation-search-tab.component.spec.ts | 16 +- ...ic-lookup-relation-search-tab.component.ts | 67 ++- ...ic-lookup-relation-search-tab.component.ts | 8 +- ...p-relation-selection-tab.component.spec.ts | 8 +- .../form/builder/form-builder.service.ts | 2 +- .../shared/form/chips/chips.component.spec.ts | 18 +- src/app/shared/form/chips/chips.component.ts | 45 +- .../authority-confidence-state.directive.ts | 4 +- src/app/shared/form/form.component.spec.ts | 43 +- src/app/shared/form/form.component.ts | 29 +- src/app/shared/form/form.module.ts | 129 ++--- src/app/shared/form/form.service.ts | 2 +- .../number-picker.component.spec.ts | 26 +- .../number-picker/number-picker.component.ts | 28 +- ...ocabulary-treeview-modal.component.spec.ts | 8 +- .../vocabulary-treeview-modal.component.ts | 15 +- .../vocabulary-treeview.component.spec.ts | 40 +- .../vocabulary-treeview.component.ts | 54 +- .../google-recaptcha.component.spec.ts | 8 +- .../google-recaptcha.component.ts | 12 +- src/app/shared/hover-class.directive.spec.ts | 10 +- src/app/shared/hover-class.directive.ts | 4 +- .../idle-modal/idle-modal.component.spec.ts | 8 +- .../shared/idle-modal/idle-modal.component.ts | 17 +- .../impersonate-navbar.component.spec.ts | 12 +- .../impersonate-navbar.component.ts | 17 +- .../dso-input-suggestions.component.spec.ts | 12 +- .../dso-input-suggestions.component.ts | 45 +- ...filter-input-suggestions.component.spec.ts | 6 +- .../filter-input-suggestions.component.ts | 48 +- .../input-suggestions.component.spec.ts | 6 +- .../input-suggestions.component.ts | 31 +- .../validation-suggestions.component.spec.ts | 8 +- .../validation-suggestions.component.ts | 49 +- .../lang-switch/lang-switch.component.spec.ts | 26 +- .../lang-switch/lang-switch.component.ts | 29 +- .../themed-lang-switch.component.ts | 2 +- .../shared/loading/loading.component.spec.ts | 14 +- src/app/shared/loading/loading.component.ts | 12 +- .../loading/themed-loading.component.ts | 8 +- .../log-in-container.component.spec.ts | 25 +- .../container/log-in-container.component.ts | 24 +- .../shared/log-in/log-in.component.spec.ts | 52 +- src/app/shared/log-in/log-in.component.ts | 37 +- ...log-in-external-provider.component.spec.ts | 12 +- .../log-in-external-provider.component.ts | 38 +- .../methods/log-in.methods-decorator.ts | 4 +- .../log-in-password.component.spec.ts | 37 +- .../password/log-in-password.component.ts | 72 ++- .../shared/log-out/log-out.component.spec.ts | 35 +- src/app/shared/log-out/log-out.component.ts | 19 +- src/app/shared/menu/menu-item.decorator.ts | 2 +- .../external-link-menu-item.component.spec.ts | 8 +- .../external-link-menu-item.component.ts | 11 +- .../link-menu-item.component.spec.ts | 23 +- .../menu-item/link-menu-item.component.ts | 26 +- .../onclick-menu-item.component.spec.ts | 8 +- .../menu-item/onclick-menu-item.component.ts | 20 +- .../text-menu-item.component.spec.ts | 8 +- .../menu-item/text-menu-item.component.ts | 10 +- src/app/shared/menu/menu-section.decorator.ts | 23 +- .../menu-section.component.spec.ts | 8 +- .../menu-section/menu-section.component.ts | 6 +- src/app/shared/menu/menu.component.spec.ts | 4 +- src/app/shared/menu/menu.component.ts | 6 +- src/app/shared/menu/menu.module.ts | 20 +- .../metadata-field-wrapper.component.spec.ts | 35 +- .../metadata-field-wrapper.component.ts | 12 +- ...ta-representation-loader.component.spec.ts | 14 +- ...etadata-representation-loader.component.ts | 10 +- .../metadata-representation.decorator.ts | 62 +-- .../dspace-rest/mocks/response-map.mock.ts | 2 +- ...med-task-actions-approve.component.spec.ts | 22 +- .../claimed-task-actions-approve.component.ts | 55 +- .../claimed-task-actions.component.spec.ts | 27 +- .../claimed-task-actions.component.ts | 31 +- ...ask-actions-decline-task.component.spec.ts | 22 +- ...med-task-actions-decline-task.component.ts | 35 +- ...sk-actions-edit-metadata.component.spec.ts | 31 +- ...ed-task-actions-edit-metadata.component.ts | 53 +- ...aimed-task-action-rating.component.spec.ts | 14 +- ...ed-claimed-task-action-rating.component.ts | 31 +- ...imed-task-actions-reject.component.spec.ts | 20 +- .../claimed-task-actions-reject.component.ts | 51 +- ...k-actions-return-to-pool.component.spec.ts | 22 +- ...d-task-actions-return-to-pool.component.ts | 41 +- ...d-task-action-select-reviewer.component.ts | 40 +- .../claimed-task-actions-decorator.ts | 34 +- ...imed-task-actions-loader.component.spec.ts | 18 +- .../claimed-task-actions-loader.component.ts | 6 +- .../item/item-actions.component.spec.ts | 27 +- .../item/item-actions.component.ts | 30 +- .../mydspace-actions.module.ts | 29 +- .../mydspace-reloadable-actions.spec.ts | 29 +- .../pool-task-actions.component.spec.ts | 44 +- .../pool-task/pool-task-actions.component.ts | 40 +- .../workflowitem-actions.component.spec.ts | 27 +- .../workflowitem-actions.component.ts | 22 +- .../workspaceitem-actions.component.spec.ts | 49 +- .../workspaceitem-actions.component.ts | 30 +- .../shared/ng-for-track-by-id.directive.ts | 6 +- .../notification.component.spec.ts | 18 +- .../notification/notification.component.ts | 40 +- .../notifications-board.component.spec.ts | 22 +- .../notifications-board.component.ts | 21 +- .../notifications.reducers.spec.ts | 12 +- .../notifications.service.spec.ts | 18 +- .../object-collection.component.spec.ts | 22 +- .../object-collection.component.ts | 38 +- .../access-status-badge.component.spec.ts | 10 +- .../access-status-badge.component.ts | 17 +- .../themed-access-status-badge.component.ts | 8 +- .../shared/badges/badges.component.spec.ts | 8 +- .../shared/badges/badges.component.ts | 14 +- .../my-dspace-status-badge.component.spec.ts | 18 +- .../my-dspace-status-badge.component.ts | 12 +- ...themed-my-dspace-status-badge.component.ts | 8 +- .../status-badge.component.spec.ts | 6 +- .../status-badge/status-badge.component.ts | 12 +- .../themed-status-badge.component.ts | 8 +- .../shared/badges/themed-badges.component.ts | 8 +- .../type-badge/themed-type-badge.component.ts | 8 +- .../type-badge/type-badge.component.spec.ts | 6 +- .../badges/type-badge/type-badge.component.ts | 22 +- .../importable-list-item-control.component.ts | 12 +- ...-object-component-loader.component.spec.ts | 52 +- ...table-object-component-loader.component.ts | 8 +- .../item-collection.component.ts | 35 +- .../item-submitter.component.spec.ts | 20 +- .../item-submitter.component.ts | 17 +- .../abstract-listable-element.component.ts | 6 +- ...ctable-list-item-control.component.spec.ts | 10 +- .../selectable-list-item-control.component.ts | 19 +- ...ch-result-detail-element.component.spec.ts | 8 +- ...-search-result-detail-element.component.ts | 56 +- ...tem-detail-preview-field.component.spec.ts | 18 +- .../item-detail-preview-field.component.ts | 17 +- .../item-detail-preview.component.spec.ts | 28 +- .../item-detail-preview.component.ts | 43 +- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 14 +- ...ch-result-detail-element.component.spec.ts | 26 +- ...-search-result-detail-element.component.ts | 39 +- .../search-result-detail-element.component.ts | 15 +- ...ch-result-detail-element.component.spec.ts | 8 +- ...-search-result-detail-element.component.ts | 14 +- ...ch-result-detail-element.component.spec.ts | 10 +- ...-search-result-detail-element.component.ts | 14 +- .../object-detail.component.spec.ts | 6 +- .../object-detail/object-detail.component.ts | 47 +- .../collection-grid-element.component.spec.ts | 30 +- .../collection-grid-element.component.ts | 41 +- .../community-grid-element.component.spec.ts | 18 +- .../community-grid-element.component.ts | 44 +- .../item/item-grid-element.component.spec.ts | 8 +- .../item/item-grid-element.component.ts | 24 +- .../object-grid/object-grid.component.ts | 63 ++- ...arch-result-grid-element.component.spec.ts | 45 +- ...on-search-result-grid-element.component.ts | 23 +- ...arch-result-grid-element.component.spec.ts | 46 +- ...ty-search-result-grid-element.component.ts | 29 +- ...arch-result-grid-element.component.spec.ts | 48 +- ...em-search-result-grid-element.component.ts | 32 +- .../search-result-grid-element.component.ts | 6 +- .../bitstream-list-item.component.spec.ts | 9 +- .../bitstream-list-item.component.ts | 8 +- ...rowse-entry-list-element.component.spec.ts | 12 +- .../browse-entry-list-element.component.ts | 20 +- .../bundle-list-element.component.ts | 20 +- .../collection-list-element.component.spec.ts | 14 +- .../collection-list-element.component.ts | 22 +- .../community-list-element.component.spec.ts | 14 +- .../community-list-element.component.ts | 22 +- .../identifier-data.component.ts | 16 +- .../item/item-list-element.component.spec.ts | 28 +- .../item/item-list-element.component.ts | 22 +- ...able-notification-object.component.spec.ts | 8 +- .../listable-notification-object.component.ts | 12 +- ...nk-metadata-list-element.component.spec.ts | 6 +- ...se-link-metadata-list-element.component.ts | 17 +- ...em-metadata-list-element.component.spec.ts | 19 +- .../item-metadata-list-element.component.ts | 13 +- ...a-representation-list-element.component.ts | 6 +- ...resentation-list-element.component.spec.ts | 6 +- ...a-representation-list-element.component.ts | 6 +- ...xt-metadata-list-element.component.spec.ts | 27 +- ...in-text-metadata-list-element.component.ts | 17 +- ...arch-result-list-element.component.spec.ts | 54 +- ...ed-search-result-list-element.component.ts | 52 +- ...arch-result-list-element.component.spec.ts | 18 +- ...ed-search-result-list-element.component.ts | 49 +- ...arch-result-list-element.component.spec.ts | 18 +- ...sk-search-result-list-element.component.ts | 61 ++- ...arch-result-list-element.component.spec.ts | 28 +- ...ed-search-result-list-element.component.ts | 38 +- .../item-list-preview.component.spec.ts | 78 +-- .../item-list-preview.component.ts | 51 +- .../themed-item-list-preview.component.ts | 8 +- ...-list-element-submission.component.spec.ts | 25 +- ...esult-list-element-submission.component.ts | 18 +- ...arch-result-list-element.component.spec.ts | 33 +- ...ol-search-result-list-element.component.ts | 52 +- ...arch-result-list-element.component.spec.ts | 25 +- ...em-search-result-list-element.component.ts | 59 +- ...arch-result-list-element.component.spec.ts | 46 +- ...em-search-result-list-element.component.ts | 60 +- .../object-list/object-list.component.spec.ts | 4 +- .../object-list/object-list.component.ts | 54 +- ...arch-result-list-element.component.spec.ts | 16 +- ...on-search-result-list-element.component.ts | 19 +- ...arch-result-list-element.component.spec.ts | 18 +- ...ty-search-result-list-element.component.ts | 19 +- ...arch-result-list-element.component.spec.ts | 52 +- ...em-search-result-list-element.component.ts | 34 +- .../search-result-list-element.component.ts | 6 +- ...n-sidebar-search-list-element.component.ts | 18 +- ...y-sidebar-search-list-element.component.ts | 18 +- ...n-sidebar-search-list-element.component.ts | 22 +- ...ebar-search-list-element.component.spec.ts | 8 +- .../sidebar-search-list-element.component.ts | 24 +- .../themed-object-list.component.ts | 8 +- .../collection-select.component.spec.ts | 81 ++- .../collection-select.component.ts | 31 +- .../item-select/item-select.component.spec.ts | 32 +- .../item-select/item-select.component.ts | 39 +- .../page-size-selector.component.spec.ts | 32 +- .../page-size-selector.component.ts | 35 +- .../pagination/pagination.component.spec.ts | 71 ++- .../shared/pagination/pagination.component.ts | 53 +- .../resource-policy-create.component.spec.ts | 66 ++- .../resource-policy-create.component.ts | 37 +- .../resource-policy-edit.component.spec.ts | 56 +- .../edit/resource-policy-edit.component.ts | 37 +- .../resource-policy-entry.component.spec.ts | 22 +- .../entry/resource-policy-entry.component.ts | 41 +- .../resource-policy-form.component.spec.ts | 74 ++- .../form/resource-policy-form.component.ts | 49 +- .../resource-policies.component.spec.ts | 22 +- .../resource-policies.component.ts | 57 +- .../resource-policies.module.ts | 24 +- .../results-back-button.component.spec.ts | 21 +- .../results-back-button.component.ts | 21 +- .../themed-results-back-button.component.ts | 8 +- src/app/shared/roles/role.directive.ts | 4 +- src/app/shared/rss-feed/rss.component.spec.ts | 12 +- src/app/shared/rss-feed/rss.component.ts | 42 +- .../scope-selector-modal.component.spec.ts | 20 +- .../scope-selector-modal.component.ts | 25 +- .../search-form/search-form.component.spec.ts | 16 +- .../search-form/search-form.component.ts | 39 +- .../themed-search-form.component.ts | 8 +- .../advanced-search.component.spec.ts | 8 +- .../advanced-search.component.ts | 30 +- .../search-export-csv.component.spec.ts | 6 +- .../search-export-csv.component.ts | 38 +- .../search-authority-filter.component.ts | 41 +- .../search-boolean-filter.component.ts | 35 +- .../search-facet-option.component.spec.ts | 50 +- .../search-facet-option.component.ts | 41 +- ...earch-facet-range-option.component.spec.ts | 24 +- .../search-facet-range-option.component.ts | 34 +- ...ch-facet-selected-option.component.spec.ts | 48 +- .../search-facet-selected-option.component.ts | 30 +- .../search-facet-filter-wrapper.component.ts | 17 +- .../search-facet-filter.component.spec.ts | 42 +- .../search-facet-filter.component.ts | 47 +- .../search-filter-type-decorator.ts | 2 +- .../search-filter.component.spec.ts | 40 +- .../search-filter/search-filter.component.ts | 51 +- .../search-hierarchy-filter.component.spec.ts | 43 +- .../search-range-filter.component.spec.ts | 44 +- .../search-range-filter.component.ts | 66 ++- .../search-text-filter.component.ts | 43 +- .../search-filters.component.spec.ts | 21 +- .../search-filters.component.ts | 41 +- .../themed-search-filters.component.ts | 8 +- .../search-label.component.spec.ts | 43 +- .../search-label/search-label.component.ts | 29 +- .../search-labels.component.spec.ts | 15 +- .../search-labels/search-labels.component.ts | 30 +- .../search-results.component.spec.ts | 18 +- .../search-results.component.ts | 47 +- .../themed-search-results.component.ts | 8 +- .../search-settings.component.spec.ts | 49 +- .../search-settings.component.ts | 34 +- .../themed-search-settings.component.ts | 8 +- .../search-sidebar.component.spec.ts | 33 +- .../search-sidebar.component.ts | 34 +- .../themed-search-sidebar.component.ts | 8 +- ...rch-switch-configuration.component.spec.ts | 43 +- .../search-switch-configuration.component.ts | 38 +- .../shared/search/search.component.spec.ts | 115 ++-- src/app/shared/search/search.component.ts | 76 ++- src/app/shared/search/search.module.ts | 69 +-- .../shared/search/themed-search.component.ts | 6 +- .../page-with-sidebar.component.spec.ts | 26 +- .../sidebar/page-with-sidebar.component.ts | 17 +- .../sidebar/sidebar-dropdown.component.ts | 10 +- .../date/starts-with-date.component.spec.ts | 8 +- .../date/starts-with-date.component.ts | 27 +- .../starts-with-abstract.component.ts | 17 +- .../starts-with/starts-with-decorator.spec.ts | 4 +- .../starts-with-loader.component.spec.ts | 34 +- .../starts-with-loader.component.ts | 7 +- .../text/starts-with-text.component.spec.ts | 8 +- .../text/starts-with-text.component.ts | 20 +- .../subscription-modal.component.spec.ts | 22 +- .../subscription-modal.component.ts | 68 ++- .../subscription-view.component.spec.ts | 22 +- .../subscription-view.component.ts | 23 +- .../subscriptions-data.service.ts | 14 +- .../subscriptions/subscriptions.module.ts | 19 +- .../shared/testing/browser-only-mock.pipe.ts | 2 +- .../ng-component-outlet-directive.stub.ts | 2 +- .../testing/query-params-directive.stub.ts | 2 +- src/app/shared/testing/route-service.stub.ts | 5 +- .../testing/router-link-directive.stub.ts | 2 +- src/app/shared/testing/test-module.ts | 13 +- src/app/shared/testing/utils.test.ts | 20 +- .../theme-support/themed.component.spec.ts | 14 +- .../abstract-trackable.component.spec.ts | 8 +- .../trackable/abstract-trackable.component.ts | 6 +- .../truncatable-part.component.spec.ts | 34 +- .../truncatable-part.component.ts | 24 +- .../truncatable/truncatable.component.spec.ts | 8 +- .../truncatable/truncatable.component.ts | 8 +- .../file-dropzone-no-uploader.component.ts | 28 +- src/app/shared/upload/upload.module.ts | 23 +- .../uploader/uploader.component.spec.ts | 33 +- .../upload/uploader/uploader.component.ts | 28 +- src/app/shared/utils/auto-focus.directive.ts | 4 +- src/app/shared/utils/browser-only.pipe.ts | 4 +- src/app/shared/utils/capitalize.pipe.ts | 4 +- .../shared/utils/click-outside.directive.ts | 4 +- src/app/shared/utils/console.pipe.ts | 4 +- src/app/shared/utils/debounce.directive.ts | 4 +- src/app/shared/utils/drag-click.directive.ts | 4 +- src/app/shared/utils/emphasize.pipe.ts | 4 +- src/app/shared/utils/enum-keys-pipe.ts | 4 +- src/app/shared/utils/file-size-pipe.ts | 4 +- .../utils/file-value-accessor.directive.ts | 16 +- .../utils/in-list-validator.directive.ts | 12 +- src/app/shared/utils/markdown.pipe.ts | 4 +- .../metadatafield-validator.directive.ts | 12 +- src/app/shared/utils/object-keys-pipe.ts | 4 +- src/app/shared/utils/object-ngfor.pipe.ts | 4 +- src/app/shared/utils/object-values-pipe.ts | 6 +- .../shared/utils/require-file.validator.ts | 18 +- src/app/shared/utils/safe-url-pipe.ts | 4 +- src/app/shared/utils/short-number.pipe.ts | 4 +- src/app/shared/utils/split.pipe.ts | 2 +- src/app/shared/utils/truncate.pipe.ts | 4 +- src/app/shared/utils/var.directive.ts | 4 +- .../view-mode-switch.component.spec.ts | 40 +- .../view-mode-switch.component.ts | 36 +- ...llection-statistics-page.component.spec.ts | 25 +- .../collection-statistics-page.component.ts | 36 +- ...ed-collection-statistics-page.component.ts | 8 +- ...ommunity-statistics-page.component.spec.ts | 25 +- .../community-statistics-page.component.ts | 26 +- ...med-community-statistics-page.component.ts | 8 +- .../item-statistics-page.component.spec.ts | 25 +- .../item-statistics-page.component.ts | 21 +- .../themed-item-statistics-page.component.ts | 8 +- .../site-statistics-page.component.spec.ts | 25 +- .../site-statistics-page.component.ts | 14 +- .../themed-site-statistics-page.component.ts | 8 +- .../statistics-page/statistics-page-routes.ts | 45 +- .../statistics-page/statistics-page.module.ts | 25 +- .../statistics-page.directive.ts | 3 +- .../statistics-table.component.spec.ts | 14 +- .../statistics-table.component.ts | 42 +- .../dspace/view-tracker.component.ts | 8 +- src/app/statistics/statistics.module.ts | 18 +- .../edit/submission-edit.component.spec.ts | 65 ++- .../edit/submission-edit.component.ts | 37 +- .../edit/themed-submission-edit.component.ts | 8 +- ...bmission-form-collection.component.spec.ts | 64 ++- .../submission-form-collection.component.ts | 36 +- .../submission-form-footer.component.spec.ts | 45 +- .../submission-form-footer.component.ts | 26 +- ...mission-form-section-add.component.spec.ts | 39 +- .../submission-form-section-add.component.ts | 14 +- .../form/submission-form.component.spec.ts | 55 +- .../form/submission-form.component.ts | 14 +- .../submission-upload-files.component.spec.ts | 47 +- .../submission-upload-files.component.ts | 35 +- ...port-external-collection.component.spec.ts | 28 +- ...on-import-external-collection.component.ts | 15 +- ...-import-external-preview.component.spec.ts | 16 +- ...ssion-import-external-preview.component.ts | 6 +- ...mport-external-searchbar.component.spec.ts | 18 +- ...ion-import-external-searchbar.component.ts | 14 +- ...bmission-import-external.component.spec.ts | 68 ++- .../submission-import-external.component.ts | 67 ++- ...ed-submission-import-external.component.ts | 8 +- src/app/submission/provide-submission.ts | 19 +- .../accesses/section-accesses.component.ts | 49 +- .../accesses/section-accesses.service.ts | 2 +- ...sion-section-cc-licenses.component.spec.ts | 42 +- ...ubmission-section-cc-licenses.component.ts | 51 +- .../section-container.component.spec.ts | 39 +- .../container/section-container.component.ts | 26 +- .../section-form-operations.service.spec.ts | 2 +- .../form/section-form-operations.service.ts | 2 +- .../form/section-form.component.spec.ts | 54 +- .../sections/form/section-form.component.ts | 48 +- .../section-identifiers.component.spec.ts | 65 ++- .../section-identifiers.component.ts | 34 +- .../license/section-license.component.spec.ts | 52 +- .../license/section-license.component.ts | 44 +- .../coar-notify-config-data.service.ts | 2 +- .../section-coar-notify.component.spec.ts | 8 +- .../section-coar-notify.component.ts | 65 ++- .../submission/sections/sections-decorator.ts | 8 +- .../submission/sections/sections.directive.ts | 6 +- .../submission/sections/sections.service.ts | 2 +- .../content-accordion.component.spec.ts | 12 +- .../content-accordion.component.ts | 14 +- .../metadata-information.component.spec.ts | 12 +- .../metadata-information.component.ts | 11 +- .../publication-information.component.spec.ts | 22 +- .../publication-information.component.ts | 16 +- .../publisher-policy.component.spec.ts | 30 +- .../publisher-policy.component.ts | 17 +- .../section-sherpa-policies.component.spec.ts | 74 +-- .../section-sherpa-policies.component.ts | 41 +- ...tion-upload-access-conditions.component.ts | 15 +- ...section-upload-file-edit.component.spec.ts | 89 +-- .../section-upload-file-edit.component.ts | 53 +- .../section-upload-file.component.spec.ts | 76 +-- .../file/section-upload-file.component.ts | 29 +- .../themed-section-upload-file.component.ts | 4 +- ...section-upload-file-view.component.spec.ts | 25 +- .../section-upload-file-view.component.ts | 30 +- .../upload/section-upload.component.spec.ts | 57 +- .../upload/section-upload.component.ts | 40 +- .../sections/upload/section-upload.service.ts | 2 +- src/app/submission/submission.module.ts | 95 ++-- .../submission-submit.component.spec.ts | 14 +- .../submit/submission-submit.component.ts | 8 +- .../themed-submission-submit.component.ts | 8 +- src/app/submit-page/submit-page-routes.ts | 8 +- .../subscriptions-page-routes.ts | 3 +- .../subscriptions-page.component.spec.ts | 33 +- .../subscriptions-page.component.ts | 52 +- .../subscriptions-page.module.ts | 11 +- .../suggestions-page-routes.ts | 13 +- .../suggestions-page.component.spec.ts | 16 +- .../suggestions-page.component.ts | 71 ++- ...system-wide-alert-banner.component.spec.ts | 6 +- .../system-wide-alert-banner.component.ts | 44 +- .../system-wide-alert-form.component.spec.ts | 6 +- .../system-wide-alert-form.component.ts | 53 +- .../system-wide-alert-routes.ts | 7 +- .../system-wide-alert.module.ts | 27 +- .../thumbnail/themed-thumbnail.component.ts | 8 +- src/app/thumbnail/thumbnail.component.spec.ts | 38 +- src/app/thumbnail/thumbnail.component.ts | 25 +- ...ced-workflow-action-page.component.spec.ts | 32 +- ...advanced-workflow-action-page.component.ts | 9 +- ...d-workflow-action-rating.component.spec.ts | 38 +- ...vanced-workflow-action-rating.component.ts | 41 +- ...w-action-select-reviewer.component.spec.ts | 40 +- ...rkflow-action-select-reviewer.component.ts | 53 +- .../reviewers-list.component.spec.ts | 86 ++- .../reviewers-list.component.ts | 37 +- ...advanced-workflow-action.component.spec.ts | 53 +- .../advanced-workflow-action.component.ts | 18 +- ...-workflow-actions-loader.component.spec.ts | 43 +- ...anced-workflow-actions-loader.component.ts | 6 +- ...orkflow-item-action-page.component.spec.ts | 66 ++- .../workflow-item-action-page.component.ts | 30 +- .../themed-workflow-item-delete.component.ts | 8 +- .../workflow-item-delete.component.spec.ts | 18 +- .../workflow-item-delete.component.ts | 31 +- ...hemed-workflow-item-send-back.component.ts | 8 +- .../workflow-item-send-back.component.spec.ts | 18 +- .../workflow-item-send-back.component.ts | 29 +- .../workflowitems-edit-page-routes.ts | 48 +- ...ed-workspaceitems-delete-page.component.ts | 26 +- ...rkspaceitems-delete-page.component.spec.ts | 32 +- .../workspaceitems-delete-page.component.ts | 62 ++- .../workspaceitems-edit-page-routes.ts | 32 +- src/config/app-config.interface.ts | 10 +- src/modules/app/browser-app.module.ts | 28 +- src/modules/app/server-app.module.ts | 40 +- src/test.ts | 5 +- .../admin-sidebar/admin-sidebar.component.ts | 14 +- .../edit-bitstream-page.component.ts | 32 +- .../app/breadcrumbs/breadcrumbs.component.ts | 27 +- .../browse-by-date.component.ts | 35 +- .../browse-by-metadata.component.ts | 35 +- .../browse-by-taxonomy.component.ts | 41 +- .../browse-by-title.component.ts | 36 +- .../collection-page.component.ts | 37 +- .../edit-item-template-page.component.ts | 21 +- .../community-list-page.component.ts | 12 +- .../community-list.component.ts | 26 +- .../community-page.component.ts | 41 +- ...nity-page-sub-collection-list.component.ts | 2 +- ...unity-page-sub-community-list.component.ts | 15 +- .../dso-edit-metadata.component.ts | 38 +- .../journal-issue/journal-issue.component.ts | 41 +- .../journal-volume.component.ts | 41 +- .../item-pages/journal/journal.component.ts | 45 +- .../item-pages/person/person.component.ts | 41 +- .../custom/app/footer/footer.component.ts | 12 +- .../app/forbidden/forbidden.component.ts | 6 +- .../forgot-email.component.ts | 10 +- .../forgot-password-form.component.ts | 17 +- .../header-navbar-wrapper.component.ts | 11 +- .../custom/app/header/header.component.ts | 16 +- .../home-news/home-news.component.ts | 12 +- .../app/home-page/home-page.component.ts | 24 +- .../top-level-community-list.component.ts | 19 +- .../end-user-agreement.component.ts | 12 +- .../feedback-form/feedback-form.component.ts | 11 +- .../app/info/feedback/feedback.component.ts | 6 +- .../app/info/privacy/privacy.component.ts | 2 +- .../item-page/alerts/item-alerts.component.ts | 11 +- .../item-status/item-status.component.ts | 28 +- .../full-file-section.component.ts | 20 +- .../full/full-item-page.component.ts | 42 +- .../media-viewer-image.component.ts | 6 +- .../media-viewer-video.component.ts | 11 +- .../media-viewer/media-viewer.component.ts | 19 +- .../file-section/file-section.component.ts | 19 +- .../title/item-page-title-field.component.ts | 6 +- .../item-page/simple/item-page.component.ts | 40 +- .../publication/publication.component.ts | 72 +-- .../untyped-item/untyped-item.component.ts | 71 +-- .../metadata-representation-list.component.ts | 23 +- .../app/login-page/login-page.component.ts | 6 +- .../app/logout-page/logout-page.component.ts | 4 +- .../objectnotfound.component.ts | 11 +- .../my-dspace-page.component.ts | 37 +- .../expandable-navbar-section.component.ts | 16 +- .../custom/app/navbar/navbar.component.ts | 16 +- .../pagenotfound/pagenotfound.component.ts | 11 +- .../profile-page/profile-page.component.ts | 28 +- .../register-email-form.component.ts | 20 +- .../create-profile.component.ts | 20 +- .../register-email.component.ts | 10 +- .../deny-request-copy.component.ts | 20 +- .../email-request-copy.component.ts | 11 +- .../grant-request-copy.component.ts | 20 +- src/themes/custom/app/root/root.component.ts | 31 +- .../search-navbar/search-navbar.component.ts | 11 +- .../configuration-search-page.component.ts | 46 +- .../app/search-page/search-page.component.ts | 10 +- .../auth-nav-menu/auth-nav-menu.component.ts | 30 +- .../user-menu/user-menu.component.ts | 19 +- .../shared/browse-by/browse-by.component.ts | 23 +- .../comcol-page-browse-by.component.ts | 17 +- .../comcol-page-handle.component.ts | 7 +- ...te-collection-parent-selector.component.ts | 11 +- ...ate-community-parent-selector.component.ts | 9 +- .../create-item-parent-selector.component.ts | 13 +- .../edit-collection-selector.component.ts | 11 +- .../edit-community-selector.component.ts | 11 +- .../edit-item-selector.component.ts | 11 +- .../file-download-link.component.ts | 13 +- ...-relation-external-source-tab.component.ts | 46 +- ...nal-source-entry-import-modal.component.ts | 23 +- ...ic-lookup-relation-search-tab.component.ts | 33 +- .../lang-switch/lang-switch.component.ts | 11 +- .../app/shared/log-in/log-in.component.ts | 12 +- .../access-status-badge.component.ts | 11 +- .../shared/badges/badges.component.ts | 33 +- .../my-dspace-status-badge.component.ts | 6 +- .../status-badge/status-badge.component.ts | 8 +- .../badges/type-badge/type-badge.component.ts | 8 +- .../browse-entry-list-element.component.ts | 9 +- .../collection-list-element.component.ts | 6 +- .../community-list-element.component.ts | 10 +- .../object-list/object-list.component.ts | 22 +- ...em-search-result-list-element.component.ts | 35 +- ...n-sidebar-search-list-element.component.ts | 22 +- .../results-back-button.component.ts | 8 +- .../search-form/search-form.component.ts | 10 +- .../search-filters.component.ts | 22 +- .../search-results.component.ts | 26 +- .../search-settings.component.ts | 21 +- .../search-sidebar.component.ts | 24 +- .../date/starts-with-date.component.ts | 16 +- .../text/starts-with-text.component.ts | 22 +- .../collection-statistics-page.component.ts | 16 +- .../community-statistics-page.component.ts | 16 +- .../item-statistics-page.component.ts | 16 +- .../site-statistics-page.component.ts | 16 +- .../edit/submission-edit.component.ts | 4 +- .../submission-import-external.component.ts | 29 +- .../file/section-upload-file.component.ts | 20 +- .../submit/submission-submit.component.ts | 12 +- .../app/thumbnail/thumbnail.component.ts | 12 +- .../workflow-item-delete.component.ts | 18 +- .../workflow-item-send-back.component.ts | 18 +- .../workspace-items-delete.component.ts | 16 +- src/themes/custom/eager-theme.module.ts | 48 +- src/themes/custom/lazy-theme.module.ts | 99 +--- .../header-navbar-wrapper.component.ts | 15 +- .../dspace/app/header/header.component.ts | 39 +- .../home-news/home-news.component.ts | 8 +- .../dspace/app/navbar/navbar.component.ts | 42 +- src/themes/dspace/eager-theme.module.ts | 44 +- src/themes/dspace/lazy-theme.module.ts | 5 +- 1481 files changed, 23238 insertions(+), 16561 deletions(-) diff --git a/src/app/access-control/access-control-routes.ts b/src/app/access-control/access-control-routes.ts index c553fdd6ce..6dab471c40 100644 --- a/src/app/access-control/access-control-routes.ts +++ b/src/app/access-control/access-control-routes.ts @@ -1,29 +1,29 @@ -import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; -import { GroupFormComponent } from './group-registry/group-form/group-form.component'; -import { GroupsRegistryComponent } from './group-registry/groups-registry.component'; -import { EPERSON_PATH, GROUP_PATH } from './access-control-routing-paths'; +import { Route } from '@angular/router'; + import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { GroupPageGuard } from './group-registry/group-page.guard'; +import { GroupAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; +import { SiteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { - GroupAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; -import { - SiteAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; + EPERSON_PATH, + GROUP_PATH, +} from './access-control-routing-paths'; import { BulkAccessComponent } from './bulk-access/bulk-access.component'; +import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component'; import { EPersonResolver } from './epeople-registry/eperson-resolver.service'; -import { Route } from '@angular/router'; +import { GroupFormComponent } from './group-registry/group-form/group-form.component'; +import { GroupPageGuard } from './group-registry/group-page.guard'; +import { GroupsRegistryComponent } from './group-registry/groups-registry.component'; export const ROUTES: Route[] = [ { path: EPERSON_PATH, component: EPeopleRegistryComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople'}, - canActivate: [SiteAdministratorGuard] + data: { title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople' }, + canActivate: [SiteAdministratorGuard], }, { path: `${EPERSON_PATH}/create`, @@ -31,7 +31,7 @@ export const ROUTES: Route[] = [ resolve: { breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'admin.access-control.epeople.add.title', breadcrumbKey: 'admin.access-control.epeople.add'}, + data: { title: 'admin.access-control.epeople.add.title', breadcrumbKey: 'admin.access-control.epeople.add' }, canActivate: [SiteAdministratorGuard], }, { @@ -41,46 +41,46 @@ export const ROUTES: Route[] = [ breadcrumb: I18nBreadcrumbResolver, ePerson: EPersonResolver, }, - data: {title: 'admin.access-control.epeople.edit.title', breadcrumbKey: 'admin.access-control.epeople.edit'}, + data: { title: 'admin.access-control.epeople.edit.title', breadcrumbKey: 'admin.access-control.epeople.edit' }, canActivate: [SiteAdministratorGuard], }, { path: GROUP_PATH, component: GroupsRegistryComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups'}, - canActivate: [GroupAdministratorGuard] + data: { title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups' }, + canActivate: [GroupAdministratorGuard], }, { path: `${GROUP_PATH}/create`, component: GroupFormComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup'}, - canActivate: [GroupAdministratorGuard] + data: { title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup' }, + canActivate: [GroupAdministratorGuard], }, { path: `${GROUP_PATH}/:groupId/edit`, component: GroupFormComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'admin.access-control.groups.title.singleGroup', - breadcrumbKey: 'admin.access-control.groups.singleGroup' + breadcrumbKey: 'admin.access-control.groups.singleGroup', }, - canActivate: [GroupPageGuard] + canActivate: [GroupPageGuard], }, { path: 'bulk-access', component: BulkAccessComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access'}, - canActivate: [SiteAdministratorGuard] + data: { title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access' }, + canActivate: [SiteAdministratorGuard], }, ]; diff --git a/src/app/access-control/access-control.module.ts b/src/app/access-control/access-control.module.ts index 6cc8c63165..7daeb6c43e 100644 --- a/src/app/access-control/access-control.module.ts +++ b/src/app/access-control/access-control.module.ts @@ -1,21 +1,27 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { AbstractControl } from '@angular/forms'; +import { + AbstractControl, + AbstractControl, +} from '@angular/forms'; import { RouterModule } from '@angular/router'; +import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; +import { + DYNAMIC_ERROR_MESSAGES_MATCHER, + DynamicErrorMessagesMatcher, +} from '@ng-dynamic-forms/core'; + +import { FormModule } from '../shared/form/form.module'; +import { SearchModule } from '../shared/search/search.module'; +import { BulkAccessBrowseComponent } from './bulk-access/browse/bulk-access-browse.component'; +import { BulkAccessComponent } from './bulk-access/bulk-access.component'; +import { BulkAccessSettingsComponent } from './bulk-access/settings/bulk-access-settings.component'; import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component'; import { GroupFormComponent } from './group-registry/group-form/group-form.component'; import { MembersListComponent } from './group-registry/group-form/members-list/members-list.component'; import { SubgroupsListComponent } from './group-registry/group-form/subgroup-list/subgroups-list.component'; import { GroupsRegistryComponent } from './group-registry/groups-registry.component'; -import { FormModule } from '../shared/form/form.module'; -import { DYNAMIC_ERROR_MESSAGES_MATCHER, DynamicErrorMessagesMatcher } from '@ng-dynamic-forms/core'; -import { AbstractControl } from '@angular/forms'; -import { BulkAccessComponent } from './bulk-access/bulk-access.component'; -import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; -import { BulkAccessBrowseComponent } from './bulk-access/browse/bulk-access-browse.component'; -import { BulkAccessSettingsComponent } from './bulk-access/settings/bulk-access-settings.component'; -import { SearchModule } from '../shared/search/search.module'; /** * Condition for displaying error messages on email form field @@ -26,30 +32,30 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher = }; @NgModule({ - imports: [ - CommonModule, - RouterModule, - FormModule, - NgbAccordionModule, - SearchModule, - EPeopleRegistryComponent, - EPersonFormComponent, - GroupsRegistryComponent, - GroupFormComponent, - SubgroupsListComponent, - MembersListComponent, - BulkAccessComponent, - BulkAccessBrowseComponent, - BulkAccessSettingsComponent - ], - exports: [ - MembersListComponent, - ], - providers: [ - { - provide: DYNAMIC_ERROR_MESSAGES_MATCHER, + imports: [ + CommonModule, + RouterModule, + FormModule, + NgbAccordionModule, + SearchModule, + EPeopleRegistryComponent, + EPersonFormComponent, + GroupsRegistryComponent, + GroupFormComponent, + SubgroupsListComponent, + MembersListComponent, + BulkAccessComponent, + BulkAccessBrowseComponent, + BulkAccessSettingsComponent, + ], + exports: [ + MembersListComponent, + ], + providers: [ + { + provide: DYNAMIC_ERROR_MESSAGES_MATCHER, useValue: ValidateEmailErrorStateMatcher, - }, + }, ], }) /** diff --git a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts index 5c1a078093..f9eb487d73 100644 --- a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts +++ b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts @@ -13,20 +13,16 @@ import { of } from 'rxjs'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { PageInfo } from '../../../core/shared/page-info.model'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { SelectableListItemControlComponent } from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec'; -import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; -import { BulkAccessBrowseComponent } from './bulk-access-browse.component'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; +import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { ThemedSearchComponent } from '../../../shared/search/themed-search.component'; -import { - SelectableListItemControlComponent -} from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; +import { BulkAccessBrowseComponent } from './bulk-access-browse.component'; describe('BulkAccessBrowseComponent', () => { let component: BulkAccessBrowseComponent; @@ -48,7 +44,7 @@ describe('BulkAccessBrowseComponent', () => { NgbAccordionModule, NgbNavModule, TranslateModule.forRoot(), - BulkAccessBrowseComponent + BulkAccessBrowseComponent, ], providers: [ { provide: SelectableListService, useValue: selectableListService }, @@ -64,9 +60,9 @@ describe('BulkAccessBrowseComponent', () => { PaginationComponent, ThemedSearchComponent, SelectableListItemControlComponent, - ListableObjectComponentLoaderComponent - ] - } + ListableObjectComponentLoaderComponent, + ], + }, }) .compileComponents(); })); diff --git a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts index 9e96d997b7..03b576317f 100644 --- a/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts +++ b/src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts @@ -1,52 +1,62 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; +import { + NgbAccordionModule, + NgbNavModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgxPaginationModule } from 'ngx-pagination'; import { BehaviorSubject, + BehaviorSubject, + Subscription, Subscription, } from 'rxjs'; import { distinctUntilChanged, + distinctUntilChanged, + map, map, } from 'rxjs/operators'; -import { BehaviorSubject, Subscription } from 'rxjs'; -import { distinctUntilChanged, map } from 'rxjs/operators'; - -import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; -import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer'; import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { PageInfo } from '../../../core/shared/page-info.model'; -import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { hasValue } from '../../../shared/empty.util'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { NgbAccordionModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedSearchComponent } from '../../../shared/search/themed-search.component'; -import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; -import { NgxPaginationModule } from 'ngx-pagination'; -import { - SelectableListItemControlComponent -} from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; -import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer'; -import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { SelectableListItemControlComponent } from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; +import { + SelectableListState, + SelectableListState, +} from '../../../shared/object-list/selectable-list/selectable-list.reducer'; +import { + SelectableListService, + SelectableListService, +} from '../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; +import { ThemedSearchComponent } from '../../../shared/search/themed-search.component'; +import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; @Component({ selector: 'ds-bulk-access-browse', @@ -55,8 +65,8 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], imports: [ PaginationComponent, @@ -70,9 +80,9 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut NgForOf, NgxPaginationModule, SelectableListItemControlComponent, - ListableObjectComponentLoaderComponent + ListableObjectComponentLoaderComponent, ], - standalone: true + standalone: true, }) export class BulkAccessBrowseComponent implements OnInit, OnDestroy { diff --git a/src/app/access-control/bulk-access/bulk-access.component.spec.ts b/src/app/access-control/bulk-access/bulk-access.component.spec.ts index 57901c6347..8bfbe1fe5d 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.spec.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.spec.ts @@ -9,15 +9,15 @@ import { of } from 'rxjs'; import { Process } from '../../process-page/processes/process.model'; import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer'; import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component'; import { BulkAccessComponent } from './bulk-access.component'; +import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component'; describe('BulkAccessComponent', () => { let component: BulkAccessComponent; @@ -77,13 +77,13 @@ describe('BulkAccessComponent', () => { imports: [ RouterTestingModule, TranslateModule.forRoot(), - BulkAccessComponent + BulkAccessComponent, ], providers: [ { provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock }, { provide: NotificationsService, useValue: NotificationsServiceStub }, { provide: SelectableListService, useValue: selectableListServiceMock }, - { provide: ThemeService, useValue: getMockThemeService() } + { provide: ThemeService, useValue: getMockThemeService() }, ], schemas: [NO_ERRORS_SCHEMA], }) @@ -91,8 +91,8 @@ describe('BulkAccessComponent', () => { remove: { imports: [ BulkAccessSettingsComponent, - ] - } + ], + }, }) .compileComponents(); }); diff --git a/src/app/access-control/bulk-access/bulk-access.component.ts b/src/app/access-control/bulk-access/bulk-access.component.ts index 658aca0d78..bd8e893b59 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.ts @@ -3,6 +3,7 @@ import { OnInit, ViewChild, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, @@ -15,7 +16,6 @@ import { import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service'; import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer'; import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service'; -import { TranslateModule } from '@ngx-translate/core'; import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component'; import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component'; @@ -26,9 +26,9 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com imports: [ TranslateModule, BulkAccessSettingsComponent, - BulkAccessBrowseComponent + BulkAccessBrowseComponent, ], - standalone: true + standalone: true, }) export class BulkAccessComponent implements OnInit { diff --git a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts index bcc42e324f..76e958e418 100644 --- a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts +++ b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts @@ -1,4 +1,7 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -6,11 +9,8 @@ import { import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; import { BulkAccessSettingsComponent } from './bulk-access-settings.component'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; describe('BulkAccessSettingsComponent', () => { let component: BulkAccessSettingsComponent; @@ -49,11 +49,11 @@ describe('BulkAccessSettingsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent], - schemas: [NO_ERRORS_SCHEMA] -}) + imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(BulkAccessSettingsComponent, { - remove: { imports: [AccessControlFormContainerComponent]} + remove: { imports: [AccessControlFormContainerComponent] }, }) .compileComponents(); }); diff --git a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts index b7d5caa9c3..264cefc708 100644 --- a/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts +++ b/src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts @@ -1,12 +1,12 @@ +import { NgIf } from '@angular/common'; import { Component, ViewChild, } from '@angular/core'; - -import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; + +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @Component({ selector: 'ds-bulk-access-settings', @@ -17,9 +17,9 @@ import { NgIf } from '@angular/common'; NgbAccordionModule, TranslateModule, NgIf, - AccessControlFormContainerComponent + AccessControlFormContainerComponent, ], - standalone: true + standalone: true, }) export class BulkAccessSettingsComponent { diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts index 19d342f31c..38863183cc 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.spec.ts @@ -19,6 +19,7 @@ import { By, } from '@angular/platform-browser'; import { Router } from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; import { NgbModal, NgbModule, @@ -29,38 +30,42 @@ import { of as observableOf, } from 'rxjs'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; import { FindListOptions } from '../../core/data/find-list-options.model'; import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; -import { RequestService } from '../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; -import { PaginationService } from '../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../core/pagination/pagination.service'; import { PageInfo } from '../../core/shared/page-info.model'; import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { getMockFormBuilderService } from '../../shared/mocks/form-builder-service.mock'; +import { RouterMock } from '../../shared/mocks/router.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { RequestService } from '../../core/data/request.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { RouterStub } from '../../shared/testing/router.stub'; import { EPeopleRegistryComponent } from './epeople-registry.component'; import { EPersonFormComponent } from './eperson-form/eperson-form.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { RouterTestingModule } from '@angular/router/testing'; -import { RouterMock } from '../../shared/mocks/router.mock'; describe('EPeopleRegistryComponent', () => { let component: EPeopleRegistryComponent; @@ -154,15 +159,15 @@ describe('EPeopleRegistryComponent', () => { paginationService = new PaginationServiceStub(); awaitTestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]), + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), EPeopleRegistryComponent], providers: [ - {provide: EPersonDataService, useValue: ePersonDataServiceStub}, - {provide: NotificationsService, useValue: new NotificationsServiceStub()}, - {provide: AuthorizationDataService, useValue: authorizationService}, - {provide: FormBuilderService, useValue: builderService}, - {provide: Router, useValue: new RouterMock()}, - {provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])}, + { provide: EPersonDataService, useValue: ePersonDataServiceStub }, + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: FormBuilderService, useValue: builderService }, + { provide: Router, useValue: new RouterMock() }, + { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, { provide: PaginationService, useValue: paginationService }, ], schemas: [NO_ERRORS_SCHEMA], @@ -173,8 +178,8 @@ describe('EPeopleRegistryComponent', () => { EPersonFormComponent, ThemedLoadingComponent, PaginationComponent, - ] - } + ], + }, }) .compileComponents(); })); diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.ts b/src/app/access-control/epeople-registry/epeople-registry.component.ts index c149db0457..3c899611ca 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -1,12 +1,30 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; -import { Router, RouterModule } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + RouterModule, +} from '@angular/router'; +import { + NgbModal, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -19,49 +37,67 @@ import { take, } from 'rxjs/operators'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; +import { + FeatureID, + FeatureID, +} from '../../core/data/feature-authorization/feature-id'; import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; -import { RequestService } from '../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; -import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { NoContent } from '../../core/shared/NoContent.model'; +import { + EpersonDtoModel, + EpersonDtoModel, +} from '../../core/eperson/models/eperson-dto.model'; +import { + PaginationService, + PaginationService, +} from '../../core/pagination/pagination.service'; +import { + NoContent, + NoContent, +} from '../../core/shared/NoContent.model'; import { getAllSucceededRemoteData, + getAllSucceededRemoteData, + getFirstCompletedRemoteData, getFirstCompletedRemoteData, } from '../../core/shared/operators'; -import { PageInfo } from '../../core/shared/page-info.model'; -import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component'; +import { + PageInfo, + PageInfo, +} from '../../core/shared/page-info.model'; +import { + ConfirmationModalComponent, + ConfirmationModalComponent, +} from '../../shared/confirmation-modal/confirmation-modal.component'; import { hasValue } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { getAllSucceededRemoteData, getFirstCompletedRemoteData } from '../../core/shared/operators'; -import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { RequestService } from '../../core/data/request.service'; -import { PageInfo } from '../../core/shared/page-info.model'; -import { NoContent } from '../../core/shared/NoContent.model'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { EPersonFormComponent } from './eperson-form/eperson-form.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths'; +import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { getEPersonEditRoute, + getEPersonEditRoute, + getEPersonsRoute, getEPersonsRoute, } from '../access-control-routing-paths'; +import { EPersonFormComponent } from './eperson-form/eperson-form.component'; @Component({ selector: 'ds-epeople-registry', @@ -76,9 +112,9 @@ import { ThemedLoadingComponent, PaginationComponent, NgClass, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * A component used for managing all existing epeople within the repository. diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts index e4843d040b..bb07b3513c 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts @@ -3,8 +3,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed, - waitForAsync,} from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, + UntypedFormGroup, Validators, } from '@angular/forms'; import { @@ -13,6 +18,8 @@ import { } from '@angular/platform-browser'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; @@ -26,54 +33,72 @@ import { } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; -import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service'; +import { + EpersonRegistrationService, + EpersonRegistrationService, +} from '../../../core/data/eperson-registration.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { + FindListOptions, + FindListOptions, +} from '../../../core/data/find-list-options.model'; import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; -import { RequestService } from '../../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../../core/data/request.service'; import { EPersonDataService } from '../../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../../core/pagination/pagination.service'; import { PageInfo } from '../../../core/shared/page-info.model'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../shared/form/form.component'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { EPersonFormComponent } from './eperson-form.component'; -import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; +import { + ActivatedRouteStub, + ActivatedRouteStub, +} from '../../../shared/testing/active-router.stub'; import { AuthServiceStub } from '../../../shared/testing/auth-service.stub'; import { EPersonMock, + EPersonMock, + EPersonMock2, EPersonMock2, } from '../../../shared/testing/eperson.mock'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; -import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { RouterStub } from '../../../shared/testing/router.stub'; +import { + PaginationServiceStub, + PaginationServiceStub, +} from '../../../shared/testing/pagination-service.stub'; +import { + RouterStub, + RouterStub, +} from '../../../shared/testing/router.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; -import { RequestService } from '../../../core/data/request.service'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { FindListOptions } from '../../../core/data/find-list-options.model'; -import { ValidateEmailNotTaken } from './validators/email-taken.validator'; -import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { FormComponent } from '../../../shared/form/form.component'; import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model'; import { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe'; import { EPeopleRegistryComponent } from '../epeople-registry.component'; -import { EPersonFormComponent } from './eperson-form.component'; -import { ValidateEmailNotTaken } from './validators/email-taken.validator'; -import { RouterStub } from '../../../shared/testing/router.stub'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + EPersonFormComponent, + EPersonFormComponent, +} from './eperson-form.component'; +import { + ValidateEmailNotTaken, + ValidateEmailNotTaken, +} from './validators/email-taken.validator'; describe('EPersonFormComponent', () => { let component: EPersonFormComponent; @@ -233,17 +258,17 @@ describe('EPersonFormComponent', () => { route = new ActivatedRouteStub(); router = new RouterStub(); TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), EPersonFormComponent, HasNoValuePipe, ], - providers: [ + providers: [ { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataService }, { provide: FormBuilderService, useValue: builderService }, @@ -256,11 +281,11 @@ describe('EPersonFormComponent', () => { { provide: ActivatedRoute, useValue: route }, { provide: Router, useValue: router }, EPeopleRegistryComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(EPersonFormComponent, { - remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]} + remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent] }, }) .compileComponents(); })); diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts index a09993c456..d6cc13a84d 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -8,8 +13,11 @@ import { } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterLink, } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { @@ -18,7 +26,10 @@ import { DynamicFormLayout, DynamicInputModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, @@ -34,8 +45,14 @@ import { } from 'rxjs/operators'; import { AuthService } from '../../../core/auth/auth.service'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service'; +import { + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; +import { + EpersonRegistrationService, + EpersonRegistrationService, +} from '../../../core/data/eperson-registration.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; import { PaginatedList } from '../../../core/data/paginated-list.model'; @@ -53,26 +70,28 @@ import { getRemoteDataPayload, } from '../../../core/shared/operators'; import { PageInfo } from '../../../core/shared/page-info.model'; -import { Registration } from '../../../core/shared/registration.model'; -import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component'; +import { + Registration, + Registration, +} from '../../../core/shared/registration.model'; +import { + TYPE_REQUEST_FORGOT, + TYPE_REQUEST_FORGOT, +} from '../../../register-email-form/register-email-form.component'; import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component'; import { hasValue } from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../shared/form/form.component'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { ValidateEmailNotTaken } from './validators/email-taken.validator'; -import { Registration } from '../../../core/shared/registration.model'; -import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service'; -import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { FormComponent } from '../../../shared/form/form.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { getEPersonsRoute } from '../../access-control-routing-paths'; -import { ValidateEmailNotTaken } from './validators/email-taken.validator'; +import { + ValidateEmailNotTaken, + ValidateEmailNotTaken, +} from './validators/email-taken.validator'; @Component({ selector: 'ds-eperson-form', @@ -85,9 +104,9 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator'; NgClass, ThemedLoadingComponent, PaginationComponent, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * A form used for creating and editing EPeople diff --git a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts index c2b54a583e..0c8c64a470 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.spec.ts @@ -1,15 +1,38 @@ import { CommonModule } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, + UntypedFormGroup, + Validators, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service'; @@ -17,7 +40,10 @@ import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service'; import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; -import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { EPersonDataService } from '../../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; @@ -27,23 +53,26 @@ import { HALEndpointService } from '../../../core/shared/hal-endpoint.service'; import { NoContent } from '../../../core/shared/NoContent.model'; import { PageInfo } from '../../../core/shared/page-info.model'; import { UUIDService } from '../../../core/shared/uuid.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { ContextHelpDirective } from '../../../shared/context-help.directive'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../shared/form/form.component'; import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock'; import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock'; import { RouterMock } from '../../../shared/mocks/router.mock'; import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { GroupMock, GroupMock2, } from '../../../shared/testing/group-mock'; +import { + GroupMock, + GroupMock2, +} from '../../../shared/testing/group-mock'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock'; import { GroupFormComponent } from './group-form.component'; -import { ValidateGroupExists } from './validators/group-exists.validator'; -import { FormComponent } from '../../../shared/form/form.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { ContextHelpDirective } from '../../../shared/context-help.directive'; import { MembersListComponent } from './members-list/members-list.component'; import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component'; +import { ValidateGroupExists } from './validators/group-exists.validator'; describe('GroupFormComponent', () => { let component: GroupFormComponent; @@ -197,14 +226,14 @@ describe('GroupFormComponent', () => { router = new RouterMock(); notificationService = new NotificationsServiceStub(); return TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), GroupFormComponent], - providers: [ + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, @@ -219,22 +248,22 @@ describe('GroupFormComponent', () => { { provide: RemoteDataBuildService, useValue: {} }, { provide: HALEndpointService, useValue: {} }, { - provide: ActivatedRoute, + provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) }, }, { provide: Router, useValue: router }, { provide: AuthorizationDataService, useValue: authorizationService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(GroupFormComponent, { remove: { imports: [ - FormComponent, - AlertComponent, - ContextHelpDirective, - MembersListComponent, - SubgroupsListComponent - ]} + FormComponent, + AlertComponent, + ContextHelpDirective, + MembersListComponent, + SubgroupsListComponent, + ] }, }) .compileComponents(); })); diff --git a/src/app/access-control/group-registry/group-form/group-form.component.ts b/src/app/access-control/group-registry/group-form/group-form.component.ts index 27bdcfb75b..9fcbcbfeff 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.ts +++ b/src/app/access-control/group-registry/group-form/group-form.component.ts @@ -1,6 +1,21 @@ -import { ChangeDetectorRef, Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + EventEmitter, + HostListener, + OnDestroy, + OnInit, + Output, +} from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormControlModel, @@ -8,10 +23,25 @@ import { DynamicInputModel, DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription, } from 'rxjs'; -import { catchError, debounceTime, filter, map, switchMap, take, } from 'rxjs/operators'; +import { + combineLatest as observableCombineLatest, + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + catchError, + debounceTime, + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; import { environment } from '../../../../environments/environment'; import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths'; @@ -36,20 +66,26 @@ import { getFirstSucceededRemoteDataPayload, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component'; -import { hasValue, hasValueOperator, isNotEmpty, } from '../../../shared/empty.util'; +import { ContextHelpDirective } from '../../../shared/context-help.directive'; +import { + hasValue, + hasValueOperator, + isNotEmpty, +} from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../shared/form/form.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { getGroupEditRoute, getGroupsRoute, } from '../../access-control-routing-paths'; -import { ValidateGroupExists } from './validators/group-exists.validator'; -import { FormComponent } from '../../../shared/form/form.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ContextHelpDirective } from '../../../shared/context-help.directive'; +import { + getGroupEditRoute, + getGroupsRoute, +} from '../../access-control-routing-paths'; import { MembersListComponent } from './members-list/members-list.component'; import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component'; +import { ValidateGroupExists } from './validators/group-exists.validator'; @Component({ selector: 'ds-group-form', @@ -62,9 +98,9 @@ import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component TranslateModule, ContextHelpDirective, MembersListComponent, - SubgroupsListComponent + SubgroupsListComponent, ], - standalone: true + standalone: true, }) /** * A form used for creating and editing groups diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts index 0c7093e623..9cc7727557 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts @@ -1,16 +1,46 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + flush, + inject, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { RestResponse } from '../../../../core/cache/response.models'; -import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { EPersonDataService } from '../../../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../../../core/eperson/group-data.service'; @@ -18,20 +48,23 @@ import { EPerson } from '../../../../core/eperson/models/eperson.model'; import { Group } from '../../../../core/eperson/models/group.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { ContextHelpDirective } from '../../../../shared/context-help.directive'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { RouterMock } from '../../../../shared/mocks/router.mock'; import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { EPersonMock, EPersonMock2, } from '../../../../shared/testing/eperson.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { + EPersonMock, + EPersonMock2, +} from '../../../../shared/testing/eperson.mock'; import { GroupMock } from '../../../../shared/testing/group-mock'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { ContextHelpDirective } from '../../../../shared/context-help.directive'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock'; import { MembersListComponent } from './members-list.component'; @@ -122,14 +155,14 @@ describe('MembersListComponent', () => { paginationService = new PaginationServiceStub(); return TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), MembersListComponent], - providers: [MembersListComponent, + providers: [MembersListComponent, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -138,15 +171,15 @@ describe('MembersListComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(MembersListComponent, { - remove: { - imports: [PaginationComponent, ContextHelpDirective] - } -}) -.compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(MembersListComponent, { + remove: { + imports: [PaginationComponent, ContextHelpDirective], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts index ede96a1a55..92f764fe98 100644 --- a/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts +++ b/src/app/access-control/group-registry/group-form/members-list/members-list.component.ts @@ -1,9 +1,37 @@ -import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, Observable, Subscription } from 'rxjs'; -import { map, switchMap, take } from 'rxjs/operators'; +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + Subscription, +} from 'rxjs'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; @@ -18,11 +46,10 @@ import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../../core/shared/operators'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { ContextHelpDirective } from '../../../../shared/context-help.directive'; +import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { getEPersonEditRoute } from '../../../access-control-routing-paths'; // todo: optimize imports @@ -77,9 +104,9 @@ export interface EPersonListActionConfig { AsyncPipe, RouterLink, NgClass, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * The list of members in the edit group page diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts index a97516f215..5b39102ca8 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts @@ -1,35 +1,67 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + flush, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { RestResponse } from '../../../../core/cache/response.models'; -import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { GroupDataService } from '../../../../core/eperson/group-data.service'; import { Group } from '../../../../core/eperson/models/group.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { ContextHelpDirective } from '../../../../shared/context-help.directive'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { RouterMock } from '../../../../shared/mocks/router.mock'; import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { GroupMock, GroupMock2, } from '../../../../shared/testing/group-mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { + GroupMock, + GroupMock2, +} from '../../../../shared/testing/group-mock'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; -import { ContextHelpDirective } from '../../../../shared/context-help.directive'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock'; import { SubgroupsListComponent } from './subgroups-list.component'; @@ -94,7 +126,7 @@ describe('SubgroupsListComponent', () => { return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), groupNonMembers)); } return createSuccessfulRemoteDataObject$( - buildPaginatedList(new PageInfo(), []) + buildPaginatedList(new PageInfo(), []), ); }, addSubGroupToGroup(parentGroup, subgroupToAdd: Group): Observable { @@ -161,12 +193,12 @@ describe('SubgroupsListComponent', () => { ], schemas: [NO_ERRORS_SCHEMA], }) - .overrideComponent(SubgroupsListComponent, { - remove: { - imports: [ContextHelpDirective, PaginationComponent] - } - }) - .compileComponents(); + .overrideComponent(SubgroupsListComponent, { + remove: { + imports: [ContextHelpDirective, PaginationComponent], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts index 7b0c5adfce..fc25dd4fc9 100644 --- a/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts +++ b/src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts @@ -1,9 +1,36 @@ -import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, Observable, Subscription, } from 'rxjs'; -import { map, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + Subscription, +} from 'rxjs'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; @@ -12,14 +39,16 @@ import { GroupDataService } from '../../../../core/eperson/group-data.service'; import { Group } from '../../../../core/eperson/models/group.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { NoContent } from '../../../../core/shared/NoContent.model'; -import { getAllCompletedRemoteData, getFirstCompletedRemoteData, } from '../../../../core/shared/operators'; +import { + getAllCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { ContextHelpDirective } from '../../../../shared/context-help.directive'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { followLink } from '../../../../shared/utils/follow-link-config.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { ContextHelpDirective } from '../../../../shared/context-help.directive'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; /** * Keys to keep track of specific subscriptions @@ -41,9 +70,9 @@ enum SubKey { TranslateModule, ReactiveFormsModule, PaginationComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * The list of subgroups in the edit group page diff --git a/src/app/access-control/group-registry/groups-registry.component.spec.ts b/src/app/access-control/group-registry/groups-registry.component.spec.ts index 44a01fe477..9f847faf0b 100644 --- a/src/app/access-control/group-registry/groups-registry.component.spec.ts +++ b/src/app/access-control/group-registry/groups-registry.component.spec.ts @@ -1,18 +1,47 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ComponentFixture, + fakeAsync, + inject, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { Observable, of, of as observableOf, } from 'rxjs'; +import { provideMockStore } from '@ngrx/store/testing'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + of, +} from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { ConfigurationDataService } from '../../core/data/configuration-data.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { RequestService } from '../../core/data/request.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; @@ -24,18 +53,24 @@ import { RouteService } from '../../core/services/route.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { NoContent } from '../../core/shared/NoContent.model'; import { PageInfo } from '../../core/shared/page-info.model'; -import { DSONameServiceMock, UNDEFINED_NAME, } from '../../shared/mocks/dso-name.service.mock'; +import { + DSONameServiceMock, + UNDEFINED_NAME, +} from '../../shared/mocks/dso-name.service.mock'; import { RouterMock } from '../../shared/mocks/router.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock'; -import { GroupMock, GroupMock2, } from '../../shared/testing/group-mock'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { + EPersonMock, + EPersonMock2, +} from '../../shared/testing/eperson.mock'; +import { + GroupMock, + GroupMock2, +} from '../../shared/testing/group-mock'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { provideMockStore } from '@ngrx/store/testing'; -import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; import { routeServiceStub } from '../../shared/testing/route-service.stub'; import { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock'; import { GroupsRegistryComponent } from './groups-registry.component'; @@ -173,14 +208,14 @@ describe('GroupsRegistryComponent', () => { setIsAuthorized(true, true); paginationService = new PaginationServiceStub(); return TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), GroupsRegistryComponent], - providers: [GroupsRegistryComponent, + providers: [GroupsRegistryComponent, { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, @@ -195,9 +230,9 @@ describe('GroupsRegistryComponent', () => { { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, provideMockStore(), - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/access-control/group-registry/groups-registry.component.ts b/src/app/access-control/group-registry/groups-registry.component.ts index 7853075642..d97284488a 100644 --- a/src/app/access-control/group-registry/groups-registry.component.ts +++ b/src/app/access-control/group-registry/groups-registry.component.ts @@ -1,7 +1,28 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, + NgSwitch, + NgSwitchCase, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -10,13 +31,22 @@ import { of as observableOf, Subscription, } from 'rxjs'; -import { catchError, defaultIfEmpty, map, switchMap, tap, } from 'rxjs/operators'; +import { + catchError, + defaultIfEmpty, + map, + switchMap, + tap, +} from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { RequestService } from '../../core/data/request.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; @@ -36,13 +66,11 @@ import { } from '../../core/shared/operators'; import { PageInfo } from '../../core/shared/page-info.model'; import { hasValue } from '../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { followLink } from '../../shared/utils/follow-link-config.model'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase } from '@angular/common'; -import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'ds-groups-registry', @@ -58,9 +86,9 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; NgSwitch, NgSwitchCase, NgbTooltipModule, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * A component used for managing all existing groups within the repository. diff --git a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts index cdcbfa291e..c2981f1fb6 100644 --- a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts +++ b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts @@ -1,5 +1,4 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { CurationFormComponent } from '../../curation-form/curation-form.component'; import { ComponentFixture, TestBed, @@ -7,6 +6,7 @@ import { } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { CurationFormComponent } from '../../curation-form/curation-form.component'; import { AdminCurationTasksComponent } from './admin-curation-tasks.component'; describe('AdminCurationTasksComponent', () => { @@ -16,14 +16,14 @@ describe('AdminCurationTasksComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), AdminCurationTasksComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) - .overrideComponent(AdminCurationTasksComponent, { - remove: { - imports: [CurationFormComponent] - } - }) - .compileComponents(); + .overrideComponent(AdminCurationTasksComponent, { + remove: { + imports: [CurationFormComponent], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts index 549139c34f..657f972468 100644 --- a/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts +++ b/src/app/admin/admin-curation-tasks/admin-curation-tasks.component.ts @@ -1,7 +1,8 @@ import { Component } from '@angular/core'; -import { CurationFormComponent } from '../../curation-form/curation-form.component'; import { TranslateModule } from '@ngx-translate/core'; +import { CurationFormComponent } from '../../curation-form/curation-form.component'; + /** * Component responsible for rendering the system wide Curation Task UI */ @@ -10,9 +11,9 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: './admin-curation-tasks.component.html', imports: [ CurationFormComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class AdminCurationTasksComponent { diff --git a/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts b/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts index 7bfb3241de..7607c2e716 100644 --- a/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts +++ b/src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts @@ -54,20 +54,20 @@ describe('BatchImportPageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - BatchImportPageComponent, FileValueAccessorDirective, FileValidator - ], - providers: [ + BatchImportPageComponent, FileValueAccessorDirective, FileValidator, + ], + providers: [ { provide: NotificationsService, useValue: notificationService }, { provide: ScriptDataService, useValue: scriptService }, { provide: Router, useValue: router }, { provide: Location, useValue: locationStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts index da6fb840ae..61e4625792 100644 --- a/src/app/admin/admin-import-batch-page/batch-import-page.component.ts +++ b/src/app/admin/admin-import-batch-page/batch-import-page.component.ts @@ -1,19 +1,28 @@ -import { Location } from '@angular/common'; +import { + Location, + Location, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { Location, NgIf } from '@angular/common'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { BATCH_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service'; -import { Router } from '@angular/router'; -import { ProcessParameter } from '../../process-page/processes/process-parameter.model'; -import { Router } from '@angular/router'; +import { FormsModule } from '@angular/forms'; +import { + Router, + Router, +} from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { UiSwitchModule } from 'ngx-ui-switch'; import { take } from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { BATCH_IMPORT_SCRIPT_NAME, + BATCH_IMPORT_SCRIPT_NAME, + ScriptDataService, ScriptDataService, } from '../../core/data/processes/script-data.service'; import { RemoteData } from '../../core/data/remote-data'; @@ -21,18 +30,20 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths'; import { Process } from '../../process-page/processes/process.model'; -import { ProcessParameter } from '../../process-page/processes/process-parameter.model'; +import { + ProcessParameter, + ProcessParameter, +} from '../../process-page/processes/process-parameter.model'; import { ImportBatchSelectorComponent } from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component'; import { isEmpty, isNotEmpty, } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { FormsModule } from '@angular/forms'; -import { UiSwitchModule } from 'ngx-ui-switch'; import { - FileDropzoneNoUploaderComponent -} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component'; + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; +import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component'; @Component({ selector: 'ds-batch-import-page', @@ -42,9 +53,9 @@ import { TranslateModule, FormsModule, UiSwitchModule, - FileDropzoneNoUploaderComponent + FileDropzoneNoUploaderComponent, ], - standalone: true + standalone: true, }) export class BatchImportPageComponent { /** diff --git a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts index 52179995f3..b47bc7fea7 100644 --- a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts +++ b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts @@ -54,20 +54,20 @@ describe('MetadataImportPageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - MetadataImportPageComponent, FileValueAccessorDirective, FileValidator - ], - providers: [ + MetadataImportPageComponent, FileValueAccessorDirective, FileValidator, + ], + providers: [ { provide: NotificationsService, useValue: notificationService }, { provide: ScriptDataService, useValue: scriptService }, { provide: Router, useValue: router }, { provide: Location, useValue: locationStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts index 8143b7230e..103f7c42de 100644 --- a/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts +++ b/src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts @@ -1,7 +1,11 @@ import { Location } from '@angular/common'; import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { METADATA_IMPORT_SCRIPT_NAME, @@ -10,14 +14,11 @@ import { import { RemoteData } from '../../core/data/remote-data'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths'; -import { FormsModule } from '@angular/forms'; -import { - FileDropzoneNoUploaderComponent -} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component'; import { Process } from '../../process-page/processes/process.model'; import { ProcessParameter } from '../../process-page/processes/process-parameter.model'; import { isNotEmpty } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component'; @Component({ selector: 'ds-metadata-import-page', @@ -25,9 +26,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s imports: [ TranslateModule, FormsModule, - FileDropzoneNoUploaderComponent + FileDropzoneNoUploaderComponent, ], - standalone: true + standalone: true, }) /** diff --git a/src/app/admin/admin-ldn-services/admin-ldn-services-routes.ts b/src/app/admin/admin-ldn-services/admin-ldn-services-routes.ts index 53e1381824..1299ed53dc 100644 --- a/src/app/admin/admin-ldn-services/admin-ldn-services-routes.ts +++ b/src/app/admin/admin-ldn-services/admin-ldn-services-routes.ts @@ -1,5 +1,5 @@ -import { Routes , -} from '@angular/router'; +import { Routes } from '@angular/router'; + import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver'; import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component'; @@ -28,11 +28,11 @@ const moduleRoutes: Routes = [ ]; export const ROUTES = moduleRoutes.map(route => { - return {...route, data: { - ...route.data, - relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path) - .map((relatedRoute) => { - return {path: relatedRoute.path, data: relatedRoute.data}; - }), - }}; + return { ...route, data: { + ...route.data, + relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path) + .map((relatedRoute) => { + return { path: relatedRoute.path, data: relatedRoute.data }; + }), + } }; }); diff --git a/src/app/admin/admin-ldn-services/admin-ldn-services.module.ts b/src/app/admin/admin-ldn-services/admin-ldn-services.module.ts index 15b7327a8f..00780cd92c 100644 --- a/src/app/admin/admin-ldn-services/admin-ldn-services.module.ts +++ b/src/app/admin/admin-ldn-services/admin-ldn-services.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; + import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service'; -import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component'; @NgModule({ imports: [ diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts index 8e46eef547..28f18a8a73 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts @@ -114,8 +114,8 @@ describe('LdnServiceFormEditComponent', () => { activatedRoute = new MockActivatedRoute(routeParams, routeUrlSegments); await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent], - providers: [ + imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent], + providers: [ { provide: LdnServicesService, useValue: ldnServicesService }, { provide: LdnItemfiltersService, useValue: ldnItemfiltersService }, { provide: Router, useValue: new RouterStub() }, @@ -129,7 +129,7 @@ describe('LdnServiceFormEditComponent', () => { RouteService, provideMockStore({}), ], -}) + }) .compileComponents(); fixture = TestBed.createComponent(LdnServiceFormComponent); diff --git a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts index 5bc37eca89..26b347a175 100644 --- a/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts +++ b/src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts @@ -1,27 +1,63 @@ -import { animate, state, style, transition, trigger, } from '@angular/animations'; -import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; -import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type'; -import { ActivatedRoute, Router } from '@angular/router'; -import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service'; -import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns'; -import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { LdnService } from '../ldn-services-model/ldn-services.model'; +import { + animate, + state, + style, + transition, + trigger, +} from '@angular/animations'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + TemplateRef, + ViewChild, +} from '@angular/core'; +import { + FormArray, + FormBuilder, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + NgbDropdownModule, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { combineLatestWith, Observable, Subscription, } from 'rxjs'; +import { + combineLatestWith, + Observable, + Subscription, +} from 'rxjs'; import { RemoteData } from 'src/app/core/data/remote-data'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { IpV4Validator } from '../../../shared/utils/ipV4.validator'; import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service'; +import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service'; +import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type'; import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters'; import { NotifyServicePattern } from '../ldn-services-model/ldn-service-patterns.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { LdnService } from '../ldn-services-model/ldn-services.model'; +import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns'; /** * Component for editing LDN service through a form that allows to create or edit the properties of a service @@ -44,8 +80,8 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; NgIf, NgbDropdownModule, NgForOf, - AsyncPipe - ] + AsyncPipe, + ], }) export class LdnServiceFormComponent implements OnInit, OnDestroy { formModel: FormGroup; diff --git a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-itemfilters-data.service.ts b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-itemfilters-data.service.ts index 5ae3f44c48..b55c0fdda1 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-itemfilters-data.service.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-itemfilters-data.service.ts @@ -22,7 +22,7 @@ import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters'; /** * A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(LDN_SERVICE_CONSTRAINT_FILTERS) export class LdnItemfiltersService extends IdentifiableDataService implements FindAllData { private findAllData: FindAllDataImpl; diff --git a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.ts b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.ts index 2d2a731d03..2ffabf14b5 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service.ts @@ -56,7 +56,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model'; * @implements {PatchData} * @implements {CreateData} */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(LDN_SERVICE) export class LdnServicesService extends IdentifiableDataService implements FindAllData, DeleteData, PatchData, CreateData { createData: CreateDataImpl; diff --git a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.spec.ts b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.spec.ts index a9a6819712..1f4fd0bf5c 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.spec.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.spec.ts @@ -50,25 +50,25 @@ describe('LdnServicesOverviewComponent', () => { 'patch': createSuccessfulRemoteDataObject$({}), }); await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent], - providers: [ + imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent], + providers: [ { - provide: LdnServicesService, + provide: LdnServicesService, useValue: ldnServicesService, }, { provide: PaginationService, useValue: paginationService }, { - provide: NgbModal, useValue: { - open: () => { - }, + provide: NgbModal, useValue: { + open: () => { }, + }, }, { provide: ChangeDetectorRef, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: TranslateService, useValue: translateServiceStub }, ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts index 86e1a7cd42..35a80f8e1e 100644 --- a/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts +++ b/src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -7,11 +12,21 @@ import { TemplateRef, ViewChild, } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { Observable, Subscription, } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service'; import { PaginationService } from 'src/app/core/pagination/pagination.service'; @@ -21,13 +36,10 @@ import { RemoteData } from '../../../core/data/remote-data'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component'; import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { RouterLink } from '@angular/router'; - -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { LdnService } from '../ldn-services-model/ldn-services.model'; /** @@ -48,9 +60,9 @@ import { LdnService } from '../ldn-services-model/ldn-services.model'; TruncatableComponent, TruncatablePartComponent, NgClass, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) export class LdnServicesOverviewComponent implements OnInit, OnDestroy { diff --git a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts index e740a881af..ca39996188 100644 --- a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts +++ b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts @@ -15,17 +15,17 @@ describe('NotificationsSuggestionTargetsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), NotificationsSuggestionTargetsPageComponent, - ], - providers: [ + ], + providers: [ NotificationsSuggestionTargetsPageComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts index d556d7c86c..24af9350ee 100644 --- a/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts +++ b/src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts @@ -1,16 +1,15 @@ import { Component } from '@angular/core'; -import { - PublicationClaimComponent -} from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component'; + +import { PublicationClaimComponent } from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component'; @Component({ selector: 'ds-admin-notifications-publication-claim-page', templateUrl: './admin-notifications-publication-claim-page.component.html', styleUrls: ['./admin-notifications-publication-claim-page.component.scss'], imports: [ - PublicationClaimComponent + PublicationClaimComponent, ], - standalone: true + standalone: true, }) export class AdminNotificationsPublicationClaimPageComponent { diff --git a/src/app/admin/admin-notifications/admin-notifications-routes.ts b/src/app/admin/admin-notifications/admin-notifications-routes.ts index 02ffdb0249..da4fbf959a 100644 --- a/src/app/admin/admin-notifications/admin-notifications-routes.ts +++ b/src/app/admin/admin-notifications/admin-notifications-routes.ts @@ -1,39 +1,27 @@ -import { Route, RouterModule } from '@angular/router'; +import { + Route, + RouterModule, +} from '@angular/router'; import { AuthenticatedGuard } from '../../core/auth/authenticated.guard'; import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; -import { PUBLICATION_CLAIMS_PATH, QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths'; import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver'; import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service'; -import { - SourceDataResolver -} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-data.resolver'; -import { - QualityAssuranceSourcePageResolver -} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; -import { - QualityAssuranceEventsPageResolver -} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.resolver'; -import { - QualityAssuranceTopicsPageResolver -} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; -import { - AdminNotificationsPublicationClaimPageComponent -} from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component'; -import { - AdminNotificationsPublicationClaimPageResolver -} from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service'; -import { - QualityAssuranceTopicsPageComponent -} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component'; -import { - QualityAssuranceSourcePageComponent -} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component'; -import { - QualityAssuranceEventsPageComponent -} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component'; import { provideSuggestionNotifications } from '../../notifications/provide-suggestion-notifications'; +import { AdminNotificationsPublicationClaimPageResolver } from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service'; +import { QualityAssuranceEventsPageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component'; +import { QualityAssuranceEventsPageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.resolver'; +import { SourceDataResolver } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-data.resolver'; +import { QualityAssuranceSourcePageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component'; +import { QualityAssuranceSourcePageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; +import { QualityAssuranceTopicsPageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component'; +import { QualityAssuranceTopicsPageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; +import { AdminNotificationsPublicationClaimPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component'; +import { + PUBLICATION_CLAIMS_PATH, + QUALITY_ASSURANCE_EDIT_PATH, +} from './admin-notifications-routing-paths'; const providers = [ I18nBreadcrumbResolver, @@ -56,14 +44,14 @@ export const ROUTES: Route[] = [ pathMatch: 'full', resolve: { breadcrumb: I18nBreadcrumbResolver, - suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver + suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver, }, providers, data: { title: 'admin.notifications.publicationclaim.page.title', breadcrumbKey: 'admin.notifications.publicationclaim', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -72,14 +60,14 @@ export const ROUTES: Route[] = [ pathMatch: 'full', resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver + openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver, }, providers, data: { title: 'admin.quality-assurance.page.title', breadcrumbKey: 'admin.quality-assurance', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [ AuthenticatedGuard ], @@ -88,14 +76,14 @@ export const ROUTES: Route[] = [ pathMatch: 'full', resolve: { breadcrumb: I18nBreadcrumbResolver, - openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver + openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver, }, providers, data: { title: 'admin.quality-assurance.page.title', breadcrumbKey: 'admin.quality-assurance', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -105,14 +93,14 @@ export const ROUTES: Route[] = [ resolve: { breadcrumb: I18nBreadcrumbResolver, openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver, - sourceData: SourceDataResolver + sourceData: SourceDataResolver, }, providers, data: { title: 'admin.notifications.source.breadcrumbs', breadcrumbKey: 'admin.notifications.source', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -121,15 +109,15 @@ export const ROUTES: Route[] = [ pathMatch: 'full', resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver + openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver, }, providers, data: { title: 'admin.notifications.event.page.title', breadcrumbKey: 'admin.notifications.event', - showBreadcrumbsFluid: false - } - } - ]) + showBreadcrumbsFluid: false, + }, + }, + ]), ]; diff --git a/src/app/admin/admin-registries/admin-registries-routes.ts b/src/app/admin/admin-registries/admin-registries-routes.ts index f10e5a0fad..b7c1bf1751 100644 --- a/src/app/admin/admin-registries/admin-registries-routes.ts +++ b/src/app/admin/admin-registries/admin-registries-routes.ts @@ -1,32 +1,33 @@ -import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component'; import { Route } from '@angular/router'; -import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component'; + import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { BITSTREAMFORMATS_MODULE_PATH } from './admin-registries-routing-paths'; +import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component'; +import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component'; export const ROUTES: Route[] = [ { path: 'metadata', - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata'}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata' }, children: [ { path: '', - component: MetadataRegistryComponent + component: MetadataRegistryComponent, }, { path: ':schemaName', - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: MetadataSchemaComponent, - data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'} - } - ] + data: { title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema' }, + }, + ], }, { path: BITSTREAMFORMATS_MODULE_PATH, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, loadChildren: () => import('./bitstream-formats/bitstream-formats-routes') .then((m) => m.ROUTES), - data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'} + data: { title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats' }, }, ]; diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts index 4acb1264b8..2859665d0e 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts @@ -14,20 +14,21 @@ import { of as observableOf } from 'rxjs'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level'; +import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; +import { FormService } from '../../../../shared/form/form.service'; +import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; +import { getMockFormService } from '../../../../shared/mocks/form-service.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../../../shared/testing/router.stub'; -import { AddBitstreamFormatComponent } from './add-bitstream-format.component'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { FormService } from '../../../../shared/form/form.service'; -import { getMockFormService } from '../../../../shared/mocks/form-service.mock'; -import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { FormatFormComponent } from '../format-form/format-form.component'; -import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; +import { AddBitstreamFormatComponent } from './add-bitstream-format.component'; describe('AddBitstreamFormatComponent', () => { let comp: AddBitstreamFormatComponent; @@ -66,12 +67,12 @@ describe('AddBitstreamFormatComponent', () => { ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) - .overrideComponent(AddBitstreamFormatComponent, { - remove: { - imports: [FormatFormComponent] - } - }) - .compileComponents(); + .overrideComponent(AddBitstreamFormatComponent, { + remove: { + imports: [FormatFormComponent], + }, + }) + .compileComponents(); }; const initBeforeEach = () => { @@ -113,12 +114,12 @@ describe('AddBitstreamFormatComponent', () => { ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) - .overrideComponent(AddBitstreamFormatComponent, { - remove: { - imports: [FormatFormComponent] - } - }) - .compileComponents(); + .overrideComponent(AddBitstreamFormatComponent, { + remove: { + imports: [FormatFormComponent], + }, + }) + .compileComponents(); })); beforeEach(initBeforeEach); it('should send the updated form to the service, show a notification and navigate to ', () => { diff --git a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts index c76a5c2209..2e704f6a6c 100644 --- a/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts @@ -1,19 +1,30 @@ import { Component } from '@angular/core'; -import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; +import { + BitstreamFormatDataService, + BitstreamFormatDataService, +} from '../../../../core/data/bitstream-format-data.service'; import { RemoteData } from '../../../../core/data/remote-data'; -import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; +import { + BitstreamFormat, + BitstreamFormat, +} from '../../../../core/shared/bitstream-format.model'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { + NotificationsService, + NotificationsService, +} from '../../../../shared/notifications/notifications.service'; +import { + getBitstreamFormatsModuleRoute, + getBitstreamFormatsModuleRoute, +} from '../../admin-registries-routing-paths'; import { FormatFormComponent } from '../format-form/format-form.component'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; /** * This component renders the page to create a new bitstream format. @@ -23,9 +34,9 @@ import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-p templateUrl: './add-bitstream-format.component.html', imports: [ FormatFormComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class AddBitstreamFormatComponent { diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routes.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routes.ts index 21192c3167..e9ba5d6dcb 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routes.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routes.ts @@ -1,9 +1,10 @@ import { Route } from '@angular/router'; + +import { I18nBreadcrumbResolver } from '../../../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.component'; +import { BitstreamFormatsComponent } from './bitstream-formats.component'; import { BitstreamFormatsResolver } from './bitstream-formats.resolver'; import { EditBitstreamFormatComponent } from './edit-bitstream-format/edit-bitstream-format.component'; -import { BitstreamFormatsComponent } from './bitstream-formats.component'; -import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.component'; -import { I18nBreadcrumbResolver } from '../../../core/breadcrumbs/i18n-breadcrumb.resolver'; const BITSTREAMFORMAT_EDIT_PATH = ':id/edit'; const BITSTREAMFORMAT_ADD_PATH = 'add'; @@ -14,14 +15,14 @@ export const ROUTES: Route[] = [ { path: '', providers, - component: BitstreamFormatsComponent + component: BitstreamFormatsComponent, }, { path: BITSTREAMFORMAT_ADD_PATH, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, providers, component: AddBitstreamFormatComponent, - data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'} + data: { breadcrumbKey: 'admin.registries.bitstream-formats.create' }, }, { path: BITSTREAMFORMAT_EDIT_PATH, @@ -29,8 +30,8 @@ export const ROUTES: Route[] = [ component: EditBitstreamFormatComponent, resolve: { bitstreamFormat: BitstreamFormatsResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'} + data: { breadcrumbKey: 'admin.registries.bitstream-formats.edit' }, }, ]; diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts index f22b9ba554..0f5eea4601 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts @@ -1,25 +1,37 @@ -import { BitstreamFormatsComponent } from './bitstream-formats.component'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { of, of as observableOf } from 'rxjs'; import { CommonModule } from '@angular/common'; import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { cold, getTestScheduler, hot, } from 'jasmine-marbles'; -import { of as observableOf } from 'rxjs'; +import { + of as observableOf, + of as observableOf, + of, +} from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service'; +import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; +import { GroupDataService } from '../../../core/eperson/group-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { BitstreamFormat } from '../../../core/shared/bitstream-format.model'; import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level'; @@ -37,12 +49,10 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications- import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe'; -import { BitstreamFormatsComponent } from './bitstream-formats.component'; -import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { provideMockStore } from '@ngrx/store/testing'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; +import { + BitstreamFormatsComponent, + BitstreamFormatsComponent, +} from './bitstream-formats.component'; describe('BitstreamFormatsComponent', () => { let comp: BitstreamFormatsComponent; @@ -108,7 +118,7 @@ describe('BitstreamFormatsComponent', () => { bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', { findAll: observableOf(mockFormatsRD), find: createSuccessfulRemoteDataObject$(mockFormatsList[0]), - getSelectedBitstreamFormats: hot('a', {a: mockFormatsList}), + getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }), selectBitstreamFormat: {}, deselectBitstreamFormat: {}, deselectAllBitstreamFormats: {}, @@ -124,7 +134,7 @@ describe('BitstreamFormatsComponent', () => { const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', { - findByPropertyName: of({payload: {value: 'test'}}), + findByPropertyName: of({ payload: { value: 'test' } }), }); paginationService = new PaginationServiceStub(); @@ -134,12 +144,12 @@ describe('BitstreamFormatsComponent', () => { providers: [ provideMockStore(), { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - {provide: HostWindowService, useValue: new HostWindowServiceStub(0)}, - {provide: NotificationsService, useValue: notificationsServiceStub}, - {provide: PaginationService, useValue: paginationService}, - {provide: GroupDataService, useValue: groupDataService}, - {provide: ConfigurationDataService, useValue: configurationDataService} + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService }, + { provide: GroupDataService, useValue: groupDataService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); @@ -266,7 +276,7 @@ describe('BitstreamFormatsComponent', () => { }); const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', { - findByPropertyName: of({payload: {value: 'test'}}), + findByPropertyName: of({ payload: { value: 'test' } }), }); paginationService = new PaginationServiceStub(); @@ -278,21 +288,21 @@ describe('BitstreamFormatsComponent', () => { BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], providers: [ provideMockStore(), - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - {provide: HostWindowService, useValue: new HostWindowServiceStub(0)}, - {provide: NotificationsService, useValue: notificationsServiceStub}, - {provide: PaginationService, useValue: paginationService}, - {provide: GroupDataService, useValue: groupDataService}, - {provide: ConfigurationDataService, useValue: configurationDataService} + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService }, + { provide: GroupDataService, useValue: groupDataService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(BitstreamFormatsComponent, { - remove: {imports: [PaginationComponent]}, - add: {imports: [TestPaginationComponent]} + remove: { imports: [PaginationComponent] }, + add: { imports: [TestPaginationComponent] }, }) .compileComponents(); - } + }, )); beforeEach(initBeforeEach); @@ -336,7 +346,7 @@ describe('BitstreamFormatsComponent', () => { }); const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', { - findByPropertyName: of({payload: {value: 'test'}}), + findByPropertyName: of({ payload: { value: 'test' } }), }); paginationService = new PaginationServiceStub(); @@ -345,22 +355,22 @@ describe('BitstreamFormatsComponent', () => { imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], providers: [ provideMockStore(), - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - {provide: HostWindowService, useValue: new HostWindowServiceStub(0)}, - {provide: NotificationsService, useValue: notificationsServiceStub}, - {provide: PaginationService, useValue: paginationService}, - {provide: PaginationService, useValue: paginationService}, - {provide: GroupDataService, useValue: groupDataService}, - {provide: ConfigurationDataService, useValue: configurationDataService} + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService }, + { provide: PaginationService, useValue: paginationService }, + { provide: GroupDataService, useValue: groupDataService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(BitstreamFormatsComponent, { - remove: {imports: [PaginationComponent]}, - add: {imports: [TestPaginationComponent]} + remove: { imports: [PaginationComponent] }, + add: { imports: [TestPaginationComponent] }, }) .compileComponents(); - } + }, )); beforeEach(initBeforeEach); diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts index 6561b8c411..67b3072eff 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts @@ -1,47 +1,80 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { combineLatest as observableCombineLatest, Observable} from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { BitstreamFormat } from '../../../core/shared/bitstream-format.model'; -import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service'; -import { map, mergeMap, switchMap, take, toArray } from 'rxjs/operators'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NoContent } from '../../../core/shared/NoContent.model'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, + Component, + OnDestroy, OnDestroy, OnInit, + OnInit, } from '@angular/core'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + Router, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, + combineLatest as observableCombineLatest, + Observable, Observable, } from 'rxjs'; import { map, + map, + mergeMap, mergeMap, switchMap, + switchMap, take, + take, + toArray, toArray, } from 'rxjs/operators'; -import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service'; +import { + BitstreamFormatDataService, + BitstreamFormatDataService, +} from '../../../core/data/bitstream-format-data.service'; import { FindListOptions } from '../../../core/data/find-list-options.model'; -import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { RemoteData } from '../../../core/data/remote-data'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { BitstreamFormat } from '../../../core/shared/bitstream-format.model'; -import { NoContent } from '../../../core/shared/NoContent.model'; +import { + PaginatedList, + PaginatedList, +} from '../../../core/data/paginated-list.model'; +import { + RemoteData, + RemoteData, +} from '../../../core/data/remote-data'; +import { + PaginationService, + PaginationService, +} from '../../../core/pagination/pagination.service'; +import { + BitstreamFormat, + BitstreamFormat, +} from '../../../core/shared/bitstream-format.model'; +import { + NoContent, + NoContent, +} from '../../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../../shared/pagination/pagination-component-options.model'; /** * This component renders a list of bitstream formats @@ -55,9 +88,9 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio RouterLink, TranslateModule, PaginationComponent, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class BitstreamFormatsComponent implements OnInit, OnDestroy { diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts index 4b3ca6266c..17276ef2ac 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts @@ -24,9 +24,9 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../../../shared/remote-data.utils'; -import { FormatFormComponent } from '../format-form/format-form.component'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../../../shared/testing/router.stub'; +import { FormatFormComponent } from '../format-form/format-form.component'; import { EditBitstreamFormatComponent } from './edit-bitstream-format.component'; describe('EditBitstreamFormatComponent', () => { @@ -73,8 +73,8 @@ describe('EditBitstreamFormatComponent', () => { }) .overrideComponent(EditBitstreamFormatComponent, { remove: { - imports: [FormatFormComponent] - } + imports: [FormatFormComponent], + }, }) .compileComponents(); }; @@ -129,8 +129,8 @@ describe('EditBitstreamFormatComponent', () => { }) .overrideComponent(EditBitstreamFormatComponent, { remove: { - imports: [FormatFormComponent] - } + imports: [FormatFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts index 36d52566fa..846d77dcb4 100644 --- a/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, @@ -6,20 +7,24 @@ import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { RemoteData } from '../../../../core/data/remote-data'; import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { FormatFormComponent } from '../format-form/format-form.component'; -import { AsyncPipe } from '@angular/common'; /** * This component renders the edit page of a bitstream format. @@ -31,9 +36,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ FormatFormComponent, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class EditBitstreamFormatComponent implements OnInit { diff --git a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts index be955c203c..08889ce28b 100644 --- a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts +++ b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts @@ -1,4 +1,11 @@ -import { Component, EventEmitter, Input, OnInit, Output, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; import { Router } from '@angular/router'; import { DynamicCheckboxModel, @@ -9,14 +16,16 @@ import { DynamicSelectModel, DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; -import { hasValue, isEmpty } from '../../../../shared/empty.util'; import { environment } from '../../../../../environments/environment'; import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level'; -import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; +import { + hasValue, + isEmpty, +} from '../../../../shared/empty.util'; import { FormComponent } from '../../../../shared/form/form.component'; -import { NgIf } from '@angular/common'; +import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; /** * The component responsible for rendering the form to create/edit a bitstream format @@ -26,9 +35,9 @@ import { NgIf } from '@angular/common'; templateUrl: './format-form.component.html', imports: [ FormComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class FormatFormComponent implements OnInit { diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts index 9f2bd128d2..8fe31a0fd4 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts @@ -1,37 +1,45 @@ import { CommonModule } from '@angular/common'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { RouterLink } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; import { RestResponse } from '../../../core/cache/response.models'; +import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { GroupDataService } from '../../../core/eperson/group-data.service'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { RegistryService } from '../../../core/registry/registry.service'; +import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; +import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { FormService } from '../../../shared/form/form.service'; import { HostWindowService } from '../../../shared/host-window.service'; +import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock'; +import { getMockFormService } from '../../../shared/mocks/form-service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { getMockFormService } from '../../../shared/mocks/form-service.mock'; -import { FormService } from '../../../shared/form/form.service'; -import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; -import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub'; -import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; -import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; -import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component'; -import { RouterLink } from '@angular/router'; -import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock'; import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe'; import { MetadataRegistryComponent } from './metadata-registry.component'; +import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component'; describe('MetadataRegistryComponent', () => { let comp: MetadataRegistryComponent; @@ -83,25 +91,25 @@ describe('MetadataRegistryComponent', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); const mockGroupService = jasmine.createSpyObj('groupService', - { + { // findByHref: jasmine.createSpy('findByHref'), // findAll: jasmine.createSpy('findAll'), // searchGroups: jasmine.createSpy('searchGroups'), - getUUIDFromString: jasmine.createSpy('getUUIDFromString'), - }, - { - linkPath: 'groups' - } -); + getUUIDFromString: jasmine.createSpy('getUUIDFromString'), + }, + { + linkPath: 'groups', + }, + ); beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ + TestBed.configureTestingModule({ imports: [ CommonModule, RouterTestingModule.withRoutes([]), @@ -135,7 +143,7 @@ describe('MetadataRegistryComponent', () => { }) .overrideComponent(MetadataRegistryComponent, { remove: { - imports: [MetadataSchemaFormComponent, RouterLink] + imports: [MetadataSchemaFormComponent, RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }) diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts index 708bab8d9c..a148559bd2 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts @@ -1,22 +1,44 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { RegistryService } from '../../../core/registry/registry.service'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, zip } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Observable, + zip, +} from 'rxjs'; +import { + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; + import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { filter, map, switchMap, take } from 'rxjs/operators'; -import { hasValue } from '../../../shared/empty.util'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { RemoteData } from '../../../core/data/remote-data'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { RegistryService } from '../../../core/registry/registry.service'; import { NoContent } from '../../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { toFindListOptions } from '../../../shared/pagination/pagination.utils'; -import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; +import { hasValue } from '../../../shared/empty.util'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; +import { toFindListOptions } from '../../../shared/pagination/pagination.utils'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component'; @Component({ selector: 'ds-metadata-registry', @@ -30,9 +52,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo NgIf, NgForOf, NgClass, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * A component used for managing all existing metadata schemas within the repository. diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts index 3367f726ad..8a08b59800 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts @@ -1,16 +1,21 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; -import { FormComponent } from '../../../../shared/form/form.component'; -import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../../shared/form/form.component'; +import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe'; import { MetadataSchemaFormComponent } from './metadata-schema-form.component'; @@ -50,8 +55,8 @@ describe('MetadataSchemaFormComponent', () => { }) .overrideComponent(MetadataSchemaFormComponent, { remove: { - imports: [FormComponent] - } + imports: [FormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts index 7af74e7d77..068c7f1bab 100644 --- a/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts +++ b/src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts @@ -1,4 +1,14 @@ -import { Component, EventEmitter, OnDestroy, OnInit, Output, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + OnDestroy, + OnInit, + Output, +} from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { DynamicFormControlModel, @@ -6,14 +16,23 @@ import { DynamicFormLayout, DynamicInputModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { combineLatest, Observable, } from 'rxjs'; -import { switchMap, take, tap, } from 'rxjs/operators'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + combineLatest, + Observable, +} from 'rxjs'; +import { + switchMap, + take, + tap, +} from 'rxjs/operators'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; -import { AsyncPipe, NgIf } from '@angular/common'; import { FormComponent } from '../../../../shared/form/form.component'; @Component({ @@ -23,9 +42,9 @@ import { FormComponent } from '../../../../shared/form/form.component'; NgIf, AsyncPipe, TranslateModule, - FormComponent + FormComponent, ], - standalone: true + standalone: true, }) /** * A form used for creating and editing metadata schemas diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts index d9725969da..8044811ece 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts @@ -1,6 +1,11 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; @@ -8,10 +13,10 @@ import { of as observableOf } from 'rxjs'; import { MetadataField } from '../../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; -import { FormComponent } from '../../../../shared/form/form.component'; -import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../../../shared/form/form.component'; +import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe'; import { MetadataFieldFormComponent } from './metadata-field-form.component'; @@ -51,15 +56,15 @@ describe('MetadataFieldFormComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe], + providers: [ { provide: RegistryService, useValue: registryServiceStub }, - { provide: FormBuilderService, useValue: getMockFormBuilderService() } - ], - schemas: [NO_ERRORS_SCHEMA] -}) + { provide: FormBuilderService, useValue: getMockFormBuilderService() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(MetadataFieldFormComponent, { - remove: { imports: [FormComponent]} + remove: { imports: [FormComponent] }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts index 7372206512..bfadd018ef 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -14,7 +18,10 @@ import { DynamicInputModel, DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -22,7 +29,6 @@ import { MetadataField } from '../../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; -import { AsyncPipe, NgIf } from '@angular/common'; import { FormComponent } from '../../../../shared/form/form.component'; @Component({ @@ -32,9 +38,9 @@ import { FormComponent } from '../../../../shared/form/form.component'; NgIf, FormComponent, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * A form used for creating and editing metadata fields diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts index ce95efbb5e..3276b1a3c7 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts @@ -1,19 +1,31 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { RestResponse } from '../../../core/cache/response.models'; +import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; +import { GroupDataService } from '../../../core/eperson/group-data.service'; import { MetadataField } from '../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { RegistryService } from '../../../core/registry/registry.service'; +import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; +import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { HostWindowService } from '../../../shared/host-window.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; @@ -22,16 +34,12 @@ import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component'; -import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; -import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub'; -import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; -import { createPaginatedList } from '../../../shared/testing/utils.test'; import { RouterStub } from '../../../shared/testing/router.stub'; +import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub'; +import { createPaginatedList } from '../../../shared/testing/utils.test'; import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe'; import { VarDirective } from '../../../shared/utils/var.directive'; +import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component'; import { MetadataSchemaComponent } from './metadata-schema.component'; describe('MetadataSchemaComponent', () => { @@ -141,9 +149,9 @@ describe('MetadataSchemaComponent', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); const groupDataService = jasmine.createSpyObj('groupsDataService', { diff --git a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts index b49aaebd7d..c5c1d650b1 100644 --- a/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts +++ b/src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts @@ -1,6 +1,22 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { ActivatedRoute, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -9,7 +25,11 @@ import { of as observableOf, zip, } from 'rxjs'; -import { map, switchMap, take, } from 'rxjs/operators'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; @@ -18,15 +38,17 @@ import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { RegistryService } from '../../../core/registry/registry.service'; import { NoContent } from '../../../core/shared/NoContent.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { toFindListOptions } from '../../../shared/pagination/pagination.utils'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; import { VarDirective } from '../../../shared/utils/var.directive'; import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; @Component({ selector: 'ds-metadata-schema', @@ -41,9 +63,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo NgIf, NgForOf, NgClass, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * A component used for managing all existing metadata fields within the current metadata schema. diff --git a/src/app/admin/admin-reports/admin-reports-routes.ts b/src/app/admin/admin-reports/admin-reports-routes.ts index 732ff35b59..e90e6d2288 100644 --- a/src/app/admin/admin-reports/admin-reports-routes.ts +++ b/src/app/admin/admin-reports/admin-reports-routes.ts @@ -1,28 +1,28 @@ +import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component'; import { FilteredItemsComponent } from './filtered-items/filtered-items.component'; -import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; export const ROUTES = [ { path: 'collections', - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections'}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections' }, children: [ { path: '', - component: FilteredCollectionsComponent - } - ] + component: FilteredCollectionsComponent, + }, + ], }, { path: 'queries', - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items'}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items' }, children: [ { path: '', - component: FilteredItemsComponent - } - ] - } + component: FilteredItemsComponent, + }, + ], + }, ]; diff --git a/src/app/admin/admin-reports/admin-reports.module.ts b/src/app/admin/admin-reports/admin-reports.module.ts index 74fe3f7b01..271fa7c0ad 100644 --- a/src/app/admin/admin-reports/admin-reports.module.ts +++ b/src/app/admin/admin-reports/admin-reports.module.ts @@ -1,8 +1,9 @@ import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; -import { FormModule } from '../../shared/form/form.module'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; +import { FormModule } from '../../shared/form/form.module'; + @NgModule({ imports: [ CommonModule, diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts index 81dc9c87de..dff6445225 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts @@ -39,23 +39,23 @@ describe('FiltersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), HttpClientTestingModule, - FilteredCollectionsComponent - ], - providers: [ + FilteredCollectionsComponent, + ], + providers: [ FormBuilder, DspaceRestService, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}); + }); })); beforeEach(waitForAsync(() => { diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts index e92353c6ef..b4bebfc924 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts @@ -1,3 +1,7 @@ +import { + KeyValuePipe, + NgForOf, +} from '@angular/common'; import { Component, ViewChild, @@ -6,7 +10,11 @@ import { FormBuilder, FormGroup, } from '@angular/forms'; -import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbAccordion, + NgbAccordionModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { RestRequestMethod } from 'src/app/core/data/rest-request-method'; import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service'; @@ -15,8 +23,6 @@ import { environment } from 'src/environments/environment'; import { FiltersComponent } from '../filters-section/filters-section.component'; import { FilteredCollections } from './filtered-collections.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { KeyValuePipe, NgForOf } from '@angular/common'; /** * Component representing the Filtered Collections content report @@ -30,9 +36,9 @@ import { KeyValuePipe, NgForOf } from '@angular/common'; NgbAccordionModule, FiltersComponent, KeyValuePipe, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class FilteredCollectionsComponent { diff --git a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts index 2be6bc321e..559a74ded9 100644 --- a/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts +++ b/src/app/admin/admin-reports/filtered-items/filtered-items.component.ts @@ -1,8 +1,30 @@ -import { Component, ViewChild } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { map, Observable } from 'rxjs'; +import { + AsyncPipe, + NgForOf, +} from '@angular/common'; +import { + Component, + ViewChild, +} from '@angular/core'; +import { + FormArray, + FormBuilder, + FormControl, + FormGroup, + ReactiveFormsModule, +} from '@angular/forms'; +import { + NgbAccordion, + NgbAccordionModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + map, + Observable, +} from 'rxjs'; import { CollectionDataService } from 'src/app/core/data/collection-data.service'; import { CommunityDataService } from 'src/app/core/data/community-data.service'; import { MetadataFieldDataService } from 'src/app/core/data/metadata-field-data.service'; @@ -24,7 +46,6 @@ import { FilteredItems } from './filtered-items-model'; import { OptionVO } from './option-vo.model'; import { PresetQuery } from './preset-query.model'; import { QueryPredicate } from './query-predicate.model'; -import { AsyncPipe, NgForOf } from '@angular/common'; /** * Component representing the Filtered Items content report. @@ -39,9 +60,9 @@ import { AsyncPipe, NgForOf } from '@angular/common'; TranslateModule, AsyncPipe, NgForOf, - FiltersComponent + FiltersComponent, ], - standalone: true + standalone: true, }) export class FilteredItemsComponent { diff --git a/src/app/admin/admin-reports/filters-section/filters-section.component.spec.ts b/src/app/admin/admin-reports/filters-section/filters-section.component.spec.ts index 864ab3d7d3..14bc6df593 100644 --- a/src/app/admin/admin-reports/filters-section/filters-section.component.spec.ts +++ b/src/app/admin/admin-reports/filters-section/filters-section.component.spec.ts @@ -20,20 +20,20 @@ describe('FiltersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - FiltersComponent - ], - providers: [ + FiltersComponent, + ], + providers: [ FormBuilder, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}); + }); })); beforeEach(waitForAsync(() => { diff --git a/src/app/admin/admin-reports/filters-section/filters-section.component.ts b/src/app/admin/admin-reports/filters-section/filters-section.component.ts index 0f36ea3b2e..85b7932ab4 100644 --- a/src/app/admin/admin-reports/filters-section/filters-section.component.ts +++ b/src/app/admin/admin-reports/filters-section/filters-section.component.ts @@ -1,10 +1,18 @@ -import { Component, Input } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { FilterGroup } from './filter-group.model'; +import { NgForOf } from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { + FormBuilder, + FormControl, + FormGroup, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { Filter } from './filter.model'; -import { NgForOf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; +import { FilterGroup } from './filter-group.model'; /** * Component representing the Query Filters section used in both @@ -17,9 +25,9 @@ import { TranslateModule } from '@ngx-translate/core'; imports: [ NgForOf, ReactiveFormsModule, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class FiltersComponent { diff --git a/src/app/admin/admin-routes.ts b/src/app/admin/admin-routes.ts index 4064c53172..937f32c2e9 100644 --- a/src/app/admin/admin-routes.ts +++ b/src/app/admin/admin-routes.ts @@ -1,21 +1,22 @@ import { Route } from '@angular/router'; -import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component'; -import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component'; + import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component'; +import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component'; +import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component'; import { LDN_PATH, NOTIFICATIONS_MODULE_PATH, REGISTRIES_MODULE_PATH, - REPORTS_MODULE_PATH + REPORTS_MODULE_PATH, } from './admin-routing-paths'; -import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component'; +import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component'; +import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component'; const providers = [ I18nBreadcrumbResolver, - I18nBreadcrumbsService + I18nBreadcrumbsService, ]; export const ROUTES: Route[] = [ @@ -34,44 +35,44 @@ export const ROUTES: Route[] = [ { path: 'search', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminSearchPageComponent, - data: {title: 'admin.search.title', breadcrumbKey: 'admin.search'} + data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' }, }, { path: 'workflow', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminWorkflowPageComponent, - data: {title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow'} + data: { title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow' }, }, { path: 'curation-tasks', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: AdminCurationTasksComponent, - data: {title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks'} + data: { title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks' }, }, { path: 'metadata-import', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: MetadataImportPageComponent, - data: {title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import'} + data: { title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import' }, }, { path: 'batch-import', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, component: BatchImportPageComponent, - data: {title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import'} + data: { title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import' }, }, { path: 'system-wide-alert', providers, - resolve: {breadcrumb: I18nBreadcrumbResolver}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, loadChildren: () => import('../system-wide-alert/system-wide-alert-routes').then((m) => m.ROUTES), - data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'} + data: { title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert' }, }, { path: LDN_PATH, @@ -81,7 +82,7 @@ export const ROUTES: Route[] = [ path: 'services', loadChildren: () => import('./admin-ldn-services/admin-ldn-services-routes') .then((m) => m.ROUTES), - } + }, ], }, { diff --git a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts index d4512b2e73..dd502ed112 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.spec.ts @@ -1,13 +1,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { AdminSearchPageComponent } from './admin-search-page.component'; describe('AdminSearchPageComponent', () => { @@ -18,13 +18,13 @@ describe('AdminSearchPageComponent', () => { await TestBed.configureTestingModule({ imports: [AdminSearchPageComponent], providers: [ - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(AdminSearchPageComponent, { remove: { - imports: [ConfigurationSearchPageComponent] - } + imports: [ConfigurationSearchPageComponent], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-page.component.ts b/src/app/admin/admin-search-page/admin-search-page.component.ts index 885267e8b7..d6215be971 100644 --- a/src/app/admin/admin-search-page/admin-search-page.component.ts +++ b/src/app/admin/admin-search-page/admin-search-page.component.ts @@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model'; import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; @Component({ - selector: 'ds-admin-search-page', - templateUrl: './admin-search-page.component.html', - styleUrls: ['./admin-search-page.component.scss'], - standalone: true, - imports: [ConfigurationSearchPageComponent] + selector: 'ds-admin-search-page', + templateUrl: './admin-search-page.component.html', + styleUrls: ['./admin-search-page.component.scss'], + standalone: true, + imports: [ConfigurationSearchPageComponent], }) /** diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts index 83fd018b37..212931711d 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.spec.ts @@ -6,7 +6,10 @@ import { import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; import { AuthService } from '../../../../../core/auth/auth.service'; @@ -17,19 +20,21 @@ import { Collection } from '../../../../../core/shared/collection.model'; import { FileService } from '../../../../../core/shared/file.service'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; -import { SharedModule } from '../../../../../shared/shared.module'; import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub'; import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub'; import { FileServiceStub } from '../../../../../shared/testing/file-service.stub'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component'; +import { + TruncatableService, + TruncatableService, +} from '../../../../../shared/truncatable/truncatable.service'; +import { + CollectionAdminSearchResultGridElementComponent, + CollectionAdminSearchResultGridElementComponent, +} from './collection-admin-search-result-grid-element.component'; describe('CollectionAdminSearchResultGridElementComponent', () => { let component: CollectionAdminSearchResultGridElementComponent; @@ -51,13 +56,13 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - CollectionAdminSearchResultGridElementComponent - ], - providers: [ + CollectionAdminSearchResultGridElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, @@ -66,7 +71,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, ], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts index ccd460d2d3..afe06927c9 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component.ts @@ -1,29 +1,31 @@ import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; -import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; import { - Collection + getCollectionEditRoute, + getCollectionEditRoute, +} from '../../../../../collection-page/collection-page-routing-paths'; +import { + Collection, + Collection, } from '../../../../../core/shared/collection.model'; import { Context } from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; -import { Collection } from '../../../../../core/shared/collection.model'; -import { - SearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; -import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; -import { RouterLink } from '@angular/router'; -import { CollectionSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; +import { CollectionSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component'; +import { + SearchResultGridElementComponent, + SearchResultGridElementComponent, +} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; @listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch) @Component({ - selector: 'ds-collection-admin-search-result-list-element', - styleUrls: ['./collection-admin-search-result-grid-element.component.scss'], - templateUrl: './collection-admin-search-result-grid-element.component.html', - standalone: true, - imports: [CollectionSearchResultGridElementComponent, RouterLink] + selector: 'ds-collection-admin-search-result-list-element', + styleUrls: ['./collection-admin-search-result-grid-element.component.scss'], + templateUrl: './collection-admin-search-result-grid-element.component.html', + standalone: true, + imports: [CollectionSearchResultGridElementComponent, RouterLink], }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts index d4ff77ba5c..f17d4b001e 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.spec.ts @@ -18,16 +18,17 @@ import { Community } from '../../../../../core/shared/community.model'; import { FileService } from '../../../../../core/shared/file.service'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; -import { SharedModule } from '../../../../../shared/shared.module'; import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub'; import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub'; import { FileServiceStub } from '../../../../../shared/testing/file-service.stub'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; +import { + TruncatableService, + TruncatableService, +} from '../../../../../shared/truncatable/truncatable.service'; import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component'; describe('CommunityAdminSearchResultGridElementComponent', () => { @@ -50,13 +51,13 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - CommunityAdminSearchResultGridElementComponent - ], - providers: [ + CommunityAdminSearchResultGridElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, @@ -64,9 +65,9 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { { provide: FileService, useClass: FileServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts index a10f4c9bf4..6fb51ff3ff 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component.ts @@ -1,29 +1,31 @@ import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; -import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; import { - Community + getCommunityEditRoute, + getCommunityEditRoute, +} from '../../../../../community-page/community-page-routing-paths'; +import { + Community, + Community, } from '../../../../../core/shared/community.model'; import { Context } from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; -import { Community } from '../../../../../core/shared/community.model'; -import { - SearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; -import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; -import { RouterLink } from '@angular/router'; -import { CommunitySearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; +import { CommunitySearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'; +import { + SearchResultGridElementComponent, + SearchResultGridElementComponent, +} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; @listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch) @Component({ - selector: 'ds-community-admin-search-result-grid-element', - styleUrls: ['./community-admin-search-result-grid-element.component.scss'], - templateUrl: './community-admin-search-result-grid-element.component.html', - standalone: true, - imports: [CommunitySearchResultGridElementComponent, RouterLink] + selector: 'ds-community-admin-search-result-grid-element', + styleUrls: ['./community-admin-search-result-grid-element.component.scss'], + templateUrl: './community-admin-search-result-grid-element.component.html', + standalone: true, + imports: [CommunitySearchResultGridElementComponent, RouterLink], }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts index 521031e772..3eb8d9caf7 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -13,22 +17,20 @@ import { RemoteData } from '../../../../../core/data/remote-data'; import { Bitstream } from '../../../../../core/shared/bitstream.model'; import { FileService } from '../../../../../core/shared/file.service'; import { Item } from '../../../../../core/shared/item.model'; +import { ListableModule } from '../../../../../core/shared/listable.module'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; -import { - AccessStatusObject -} from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model'; +import { AccessStatusObject } from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub'; import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub'; import { FileServiceStub } from '../../../../../shared/testing/file-service.stub'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; +import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { ItemAdminSearchResultGridElementComponent } from './item-admin-search-result-grid-element.component'; -import { ListableModule } from '../../../../../core/shared/listable.module'; describe('ItemAdminSearchResultGridElementComponent', () => { let component: ItemAdminSearchResultGridElementComponent; @@ -61,24 +63,24 @@ describe('ItemAdminSearchResultGridElementComponent', () => { init(); TestBed.configureTestingModule( { - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ListableModule, - ItemAdminSearchResultGridElementComponent - ], - providers: [ - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: ThemeService, useValue: mockThemeService }, - { provide: AccessStatusDataService, useValue: mockAccessStatusDataService }, - { provide: AuthService, useClass: AuthServiceStub }, - { provide: FileService, useClass: FileServiceStub }, - { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, - ], + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ListableModule, + ItemAdminSearchResultGridElementComponent, + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: ThemeService, useValue: mockThemeService }, + { provide: AccessStatusDataService, useValue: mockAccessStatusDataService }, + { provide: AuthService, useClass: AuthServiceStub }, + { provide: FileService, useClass: FileServiceStub }, + { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts index 56d6bd1e3e..fd5e641f52 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.ts @@ -1,4 +1,11 @@ -import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild, } from '@angular/core'; +import { + Component, + ComponentRef, + ElementRef, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; @@ -6,30 +13,25 @@ import { Context } from '../../../../../core/shared/context.model'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - DynamicComponentLoaderDirective -} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { hasValue } from '../../../../../shared/empty.util'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { getListableObjectComponent, listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; - -import { - SearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; +import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; +import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; @listableObjectComponent(ItemSearchResult, ViewMode.GridElement, Context.AdminSearch) @Component({ - selector: 'ds-item-admin-search-result-grid-element', - styleUrls: ['./item-admin-search-result-grid-element.component.scss'], - templateUrl: './item-admin-search-result-grid-element.component.html', - standalone: true, - imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective] + selector: 'ds-item-admin-search-result-grid-element', + styleUrls: ['./item-admin-search-result-grid-element.component.scss'], + templateUrl: './item-admin-search-result-grid-element.component.html', + standalone: true, + imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective], }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts index e936f946e0..cb2f1af9b7 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.spec.ts @@ -1,6 +1,5 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { - ComponentFixture, TestBed, waitForAsync, @@ -16,13 +15,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { Collection } from '../../../../../core/shared/collection.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; -import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { CollectionAdminSearchResultListElementComponent } from './collection-admin-search-result-list-element.component'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; +import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; +import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; +import { CollectionAdminSearchResultListElementComponent } from './collection-admin-search-result-list-element.component'; describe('CollectionAdminSearchResultListElementComponent', () => { let component: CollectionAdminSearchResultListElementComponent; @@ -40,19 +39,19 @@ describe('CollectionAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - CollectionAdminSearchResultListElementComponent - ], - providers: [ + CollectionAdminSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - { provide: ThemeService, useValue: getMockThemeService() } - ], - schemas: [NO_ERRORS_SCHEMA], -}) + { provide: ThemeService, useValue: getMockThemeService() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts index f2aa49742a..de9470ffa2 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component.ts @@ -1,33 +1,41 @@ import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; -import { Collection } from '../../../../../core/shared/collection.model'; -import { Context } from '../../../../../core/shared/context.model'; +import { + getCollectionEditRoute, + getCollectionEditRoute, +} from '../../../../../collection-page/collection-page-routing-paths'; +import { + Collection, + Collection, +} from '../../../../../core/shared/collection.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { Context } from '../../../../../core/shared/context.model'; + CollectionSearchResult, + CollectionSearchResult, +} from '../../../../../shared/object-collection/shared/collection-search-result.model'; import { - SearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; -import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; -import { Collection } from '../../../../../core/shared/collection.model'; -import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; + listableObjectComponent, + listableObjectComponent, +} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { CollectionSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component'; -import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; -import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; +import { + SearchResultListElementComponent, + SearchResultListElementComponent, +} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch) @Component({ - selector: 'ds-collection-admin-search-result-list-element', - styleUrls: ['./collection-admin-search-result-list-element.component.scss'], - templateUrl: './collection-admin-search-result-list-element.component.html', - standalone: true, - imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule] + selector: 'ds-collection-admin-search-result-list-element', + styleUrls: ['./collection-admin-search-result-list-element.component.scss'], + templateUrl: './collection-admin-search-result-list-element.component.html', + standalone: true, + imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule], }) /** * The component for displaying a list element for a collection search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts index 5103a4f01f..660b8af1d4 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.spec.ts @@ -15,11 +15,11 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { Community } from '../../../../../core/shared/community.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; describe('CommunityAdminSearchResultListElementComponent', () => { let component: CommunityAdminSearchResultListElementComponent; @@ -37,18 +37,18 @@ describe('CommunityAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - CommunityAdminSearchResultListElementComponent - ], - providers: [ + CommunityAdminSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA], -}) + { provide: APP_CONFIG, useValue: environment }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts index ce0cfaf7f0..b955eedd58 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component.ts @@ -1,33 +1,41 @@ import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; -import { Community } from '../../../../../core/shared/community.model'; -import { Context } from '../../../../../core/shared/context.model'; +import { + getCommunityEditRoute, + getCommunityEditRoute, +} from '../../../../../community-page/community-page-routing-paths'; +import { + Community, + Community, +} from '../../../../../core/shared/community.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { Context } from '../../../../../core/shared/context.model'; + CommunitySearchResult, + CommunitySearchResult, +} from '../../../../../shared/object-collection/shared/community-search-result.model'; import { - SearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; -import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; -import { Community } from '../../../../../core/shared/community.model'; -import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; + listableObjectComponent, + listableObjectComponent, +} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { CommunitySearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component'; -import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; -import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; +import { + SearchResultListElementComponent, + SearchResultListElementComponent, +} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch) @Component({ - selector: 'ds-community-admin-search-result-list-element', - styleUrls: ['./community-admin-search-result-list-element.component.scss'], - templateUrl: './community-admin-search-result-list-element.component.html', - standalone: true, - imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule] + selector: 'ds-community-admin-search-result-list-element', + styleUrls: ['./community-admin-search-result-list-element.component.scss'], + templateUrl: './community-admin-search-result-list-element.component.html', + standalone: true, + imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule], }) /** * The component for displaying a list element for a community search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts index 9b7b1cd9ae..a3631473e9 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -9,15 +13,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { ItemAdminSearchResultListElementComponent } from './item-admin-search-result-list-element.component'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; +import { ItemAdminSearchResultListElementComponent } from './item-admin-search-result-list-element.component'; describe('ItemAdminSearchResultListElementComponent', () => { let component: ItemAdminSearchResultListElementComponent; @@ -35,20 +37,20 @@ describe('ItemAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - ItemAdminSearchResultListElementComponent - ], - providers: [ + ItemAdminSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA], -}) + { provide: APP_CONFIG, useValue: environment }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ItemAdminSearchResultListElementComponent, { - remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent]} + remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent] }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts index 797c6fef5c..117ced30ae 100644 --- a/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.ts @@ -1,27 +1,27 @@ import { Component } from '@angular/core'; -import { Context } from '../../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { Context } from '../../../../../core/shared/context.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { - SearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; -import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; + listableObjectComponent, + listableObjectComponent, +} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; +import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.AdminSearch) @Component({ - selector: 'ds-item-admin-search-result-list-element', - styleUrls: ['./item-admin-search-result-list-element.component.scss'], - templateUrl: './item-admin-search-result-list-element.component.html', - standalone: true, - imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent] + selector: 'ds-item-admin-search-result-list-element', + styleUrls: ['./item-admin-search-result-list-element.component.scss'], + templateUrl: './item-admin-search-result-list-element.component.html', + standalone: true, + imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent], }) /** * The component for displaying a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts index 9705be9f61..c598c5b40d 100644 --- a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts @@ -36,13 +36,13 @@ describe('ItemAdminSearchResultActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - ItemAdminSearchResultActionsComponent - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ItemAdminSearchResultActionsComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts index 5a60dc15c5..89d51481d7 100644 --- a/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts +++ b/src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts @@ -1,7 +1,13 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../core/shared/item.model'; import { URLCombiner } from '../../../core/url-combiner/url-combiner'; @@ -13,17 +19,14 @@ import { ITEM_EDIT_REINSTATE_PATH, ITEM_EDIT_WITHDRAW_PATH, } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { NgClass, NgIf } from '@angular/common'; import { getItemEditRoute } from '../../../item-page/item-page-routing-paths'; @Component({ - selector: 'ds-item-admin-search-result-actions-element', - styleUrls: ['./item-admin-search-result-actions.component.scss'], - templateUrl: './item-admin-search-result-actions.component.html', - standalone: true, - imports: [NgClass, RouterLink, NgIf, TranslateModule] + selector: 'ds-item-admin-search-result-actions-element', + styleUrls: ['./item-admin-search-result-actions.component.scss'], + templateUrl: './item-admin-search-result-actions.component.html', + standalone: true, + imports: [NgClass, RouterLink, NgIf, TranslateModule], }) /** * The component for displaying the actions for a list element for an item search result on the admin search page diff --git a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts index 7740848aa5..f69c8cf503 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts @@ -25,13 +25,13 @@ describe('AdminSidebarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent], - providers: [ - { provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } }, - { provide: MenuService, useValue: menuService }, - { provide: CSSVariableService, useClass: CSSVariableServiceStub }, + imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent], + providers: [ + { provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } }, + { provide: MenuService, useValue: menuService }, + { provide: CSSVariableService, useClass: CSSVariableServiceStub }, ], -}).overrideComponent(AdminSidebarSectionComponent, { + }).overrideComponent(AdminSidebarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -64,13 +64,13 @@ describe('AdminSidebarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent], - providers: [ - { provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } }, - { provide: MenuService, useValue: menuService }, - { provide: CSSVariableService, useClass: CSSVariableServiceStub }, + imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent], + providers: [ + { provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } }, + { provide: MenuService, useValue: menuService }, + { provide: CSSVariableService, useClass: CSSVariableServiceStub }, ], -}).overrideComponent(AdminSidebarSectionComponent, { + }).overrideComponent(AdminSidebarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -103,10 +103,10 @@ describe('AdminSidebarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [RouterTestingModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [RouterTestingModule], }) class TestComponent { } diff --git a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts index 0a6f8d9149..2786236b09 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts @@ -1,21 +1,25 @@ +import { NgClass } from '@angular/common'; import { Component, Inject, Injector, OnInit, } from '@angular/core'; -import { Router } from '@angular/router'; - -import { isEmpty } from '../../../shared/empty.util'; -import { MenuService } from '../../../shared/menu/menu.service'; -import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model'; -import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator'; -import { MenuSection } from '../../../shared/menu/menu-section.model'; -import { MenuID } from '../../../shared/menu/menu-id.model'; -import { isEmpty } from '../../../shared/empty.util'; -import { Router, RouterLink } from '@angular/router'; +import { + Router, + Router, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { NgClass } from '@angular/common'; + +import { + isEmpty, + isEmpty, +} from '../../../shared/empty.util'; +import { MenuService } from '../../../shared/menu/menu.service'; +import { MenuID } from '../../../shared/menu/menu-id.model'; +import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model'; +import { MenuSection } from '../../../shared/menu/menu-section.model'; import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-section.component'; /** @@ -26,7 +30,7 @@ import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-sec templateUrl: './admin-sidebar-section.component.html', styleUrls: ['./admin-sidebar-section.component.scss'], standalone: true, - imports: [NgClass, RouterLink, TranslateModule] + imports: [NgClass, RouterLink, TranslateModule], }) export class AdminSidebarSectionComponent extends MenuSectionComponent implements OnInit { diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts index 9436d20a3e..cee5d7b5c0 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts @@ -10,35 +10,56 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + ActivatedRoute, + ActivatedRoute, +} from '@angular/router'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; +import { + NgbModal, + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; -import { AuthService } from '../../core/auth/auth.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; +import { + AuthService, + AuthService, +} from '../../core/auth/auth.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; import { ScriptDataService } from '../../core/data/processes/script-data.service'; -import { Item } from '../../core/shared/item.model'; +import { + Item, + Item, +} from '../../core/shared/item.model'; import { MenuService } from '../../shared/menu/menu.service'; import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject, +} from '../../shared/remote-data.utils'; import { CSSVariableService } from '../../shared/sass-helper/css-variable.service'; -import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; +import { + AuthServiceStub, + AuthServiceStub, +} from '../../shared/testing/auth-service.stub'; import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub'; -import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; -import { AuthService } from '../../core/auth/auth.service'; -import { of as observableOf } from 'rxjs'; -import { By } from '@angular/platform-browser'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ActivatedRoute } from '@angular/router'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import createSpy = jasmine.createSpy; -import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; -import { Item } from '../../core/shared/item.model'; import { MenuServiceStub } from '../../shared/testing/menu-service.stub'; import { ThemeService } from '../../shared/theme-support/theme.service'; import { AdminSidebarComponent } from './admin-sidebar.component'; @@ -73,8 +94,8 @@ describe('AdminSidebarComponent', () => { const mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({})} as NgbModalRef - ) + { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + ), }; @@ -84,8 +105,8 @@ describe('AdminSidebarComponent', () => { }); scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, { provide: MenuService, useValue: menuService }, @@ -95,10 +116,10 @@ describe('AdminSidebarComponent', () => { { provide: AuthorizationDataService, useValue: authorizationService }, { provide: ScriptDataService, useValue: scriptService }, { provide: ActivatedRoute, useValue: routeStub }, - { provide: NgbModal, useValue: mockNgbModal } - ], + { provide: NgbModal, useValue: mockNgbModal }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(AdminSidebarComponent, { + }).overrideComponent(AdminSidebarComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, }, diff --git a/src/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/app/admin/admin-sidebar/admin-sidebar.component.ts index 699e570820..cd26a11995 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -1,3 +1,10 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component, HostListener, @@ -6,6 +13,8 @@ import { OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -27,20 +36,17 @@ import { MenuService } from '../../shared/menu/menu.service'; import { MenuID } from '../../shared/menu/menu-id.model'; import { CSSVariableService } from '../../shared/sass-helper/css-variable.service'; import { ThemeService } from '../../shared/theme-support/theme.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf, NgClass, NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common'; /** * Component representing the admin sidebar */ @Component({ - selector: 'ds-admin-sidebar', - templateUrl: './admin-sidebar.component.html', - styleUrls: ['./admin-sidebar.component.scss'], - animations: [slideSidebar], - standalone: true, - imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule] + selector: 'ds-admin-sidebar', + templateUrl: './admin-sidebar.component.html', + styleUrls: ['./admin-sidebar.component.scss'], + animations: [slideSidebar], + standalone: true, + imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule], }) export class AdminSidebarComponent extends MenuComponent implements OnInit { /** diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts index 5d64dfdb13..85393ae201 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts @@ -24,14 +24,14 @@ describe('ExpandableAdminSidebarSectionComponent', () => { const iconString = 'test'; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent], - providers: [ + imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent], + providers: [ { provide: 'sectionDataProvider', useValue: { icon: iconString, model: {} } }, { provide: MenuService, useValue: menuService }, { provide: CSSVariableService, useClass: CSSVariableServiceStub }, { provide: Router, useValue: new RouterStub() }, ], -}).overrideComponent(ExpandableAdminSidebarSectionComponent, { + }).overrideComponent(ExpandableAdminSidebarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -74,9 +74,9 @@ describe('ExpandableAdminSidebarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { } diff --git a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts index 3314ee97a3..46ac650853 100644 --- a/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts +++ b/src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts @@ -1,3 +1,10 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component, Inject, @@ -5,24 +12,25 @@ import { OnInit, } from '@angular/core'; import { Router } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as combineLatestObservable, + combineLatest as combineLatestObservable, + Observable, Observable, } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + map, + map, +} from 'rxjs/operators'; import { bgColor } from '../../../shared/animations/bgColor'; import { rotate } from '../../../shared/animations/rotate'; import { slide } from '../../../shared/animations/slide'; import { MenuService } from '../../../shared/menu/menu.service'; -import { combineLatest as combineLatestObservable, Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; import { MenuID } from '../../../shared/menu/menu-id.model'; -import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator'; import { CSSVariableService } from '../../../shared/sass-helper/css-variable.service'; import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sidebar-section.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/common'; /** * Represents a expandable section in the sidebar @@ -33,7 +41,7 @@ import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/com styleUrls: ['./expandable-admin-sidebar-section.component.scss'], animations: [rotate, slide, bgColor], standalone: true, - imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule] + imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule], }) export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit { diff --git a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts index e7822e2c89..165f48384a 100644 --- a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts @@ -11,10 +11,10 @@ import { AdminSidebarComponent } from './admin-sidebar.component'; * Themed wrapper for AdminSidebarComponent */ @Component({ - selector: 'ds-themed-admin-sidebar', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-admin-sidebar', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedAdminSidebarComponent extends ThemedComponent { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts index 787b5774cf..ff326fbc27 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts @@ -1,11 +1,11 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; import { AdminWorkflowPageComponent } from './admin-workflow-page.component'; describe('AdminSearchPageComponent', () => { @@ -20,9 +20,9 @@ describe('AdminSearchPageComponent', () => { .overrideComponent(AdminWorkflowPageComponent, { remove: { imports: [ - ConfigurationSearchPageComponent - ] - } + ConfigurationSearchPageComponent, + ], + }, }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts index 890dd8edf9..fdc34fe4ab 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-page.component.ts @@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model'; import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; @Component({ - selector: 'ds-admin-workflow-page', - templateUrl: './admin-workflow-page.component.html', - styleUrls: ['./admin-workflow-page.component.scss'], - standalone: true, - imports: [ConfigurationSearchPageComponent] + selector: 'ds-admin-workflow-page', + templateUrl: './admin-workflow-page.component.html', + styleUrls: ['./admin-workflow-page.component.scss'], + standalone: true, + imports: [ConfigurationSearchPageComponent], }) /** diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts index ce19de185f..f524042283 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -35,13 +39,13 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - WorkflowItemAdminWorkflowActionsComponent - ], - schemas: [NO_ERRORS_SCHEMA], -}) + WorkflowItemAdminWorkflowActionsComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts index b0796b1624..29e1b65eda 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts @@ -1,23 +1,26 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { getWorkflowItemDeleteRoute, getWorkflowItemSendBackRoute, } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { NgClass, NgIf } from '@angular/common'; @Component({ - selector: 'ds-workflow-item-admin-workflow-actions-element', - styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'], - templateUrl: './workflow-item-admin-workflow-actions.component.html', - standalone: true, - imports: [NgClass, RouterLink, NgIf, TranslateModule] + selector: 'ds-workflow-item-admin-workflow-actions-element', + styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'], + templateUrl: './workflow-item-admin-workflow-actions.component.html', + standalone: true, + imports: [NgClass, RouterLink, NgIf, TranslateModule], }) /** * The component for displaying the actions for a list element for a workflow-item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts index 522ba3df63..ec0d446f1a 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts @@ -7,15 +7,19 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { NgbActiveModal, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbActiveModal, + NgbPaginationModule, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; + import { Group } from '../../../../../../core/eperson/models/group.model'; import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model'; import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service'; +import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component'; import { NotificationsService } from '../../../../../../shared/notifications/notifications.service'; import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector.component'; -import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component'; describe('SupervisionOrderGroupSelectorComponent', () => { let component: SupervisionOrderGroupSelectorComponent; @@ -39,20 +43,20 @@ describe('SupervisionOrderGroupSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - NgbPaginationModule, - TranslateModule.forRoot(), - SupervisionOrderGroupSelectorComponent - ], - providers: [ + imports: [ + NgbPaginationModule, + TranslateModule.forRoot(), + SupervisionOrderGroupSelectorComponent, + ], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, { provide: NotificationsService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(SupervisionOrderGroupSelectorComponent, { - remove: { imports: [EpersonGroupListComponent]} + remove: { imports: [EpersonGroupListComponent] }, }) .compileComponents(); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts index cb8bc81744..597940ca10 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts @@ -1,6 +1,15 @@ -import { Component, EventEmitter, Output, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Output, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators'; import { NotificationsService } from 'src/app/shared/notifications/notifications.service'; @@ -11,8 +20,6 @@ import { SupervisionOrder } from '../../../../../../core/supervision-order/model import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service'; import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component'; import { ErrorComponent } from '../../../../../../shared/error/error.component'; -import { NgIf } from '@angular/common'; -import { FormsModule } from '@angular/forms'; /** * Component to wrap a dropdown - for type of order - @@ -22,11 +29,11 @@ import { FormsModule } from '@angular/forms'; */ @Component({ - selector: 'ds-supervision-group-selector', - styleUrls: ['./supervision-order-group-selector.component.scss'], - templateUrl: './supervision-order-group-selector.component.html', - standalone: true, - imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule] + selector: 'ds-supervision-group-selector', + styleUrls: ['./supervision-order-group-selector.component.scss'], + templateUrl: './supervision-order-group-selector.component.html', + standalone: true, + imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule], }) export class SupervisionOrderGroupSelectorComponent { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts index 322efcabeb..50aff84355 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts @@ -24,21 +24,21 @@ describe('SupervisionOrderStatusComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbTooltipModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - SupervisionOrderStatusComponent, VarDirective - ], - schemas: [ + SupervisionOrderStatusComponent, VarDirective, + ], + schemas: [ NO_ERRORS_SCHEMA, ], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts index 6d949e07dd..fbd48d4078 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts @@ -1,6 +1,28 @@ -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core'; -import { BehaviorSubject, from, Observable, } from 'rxjs'; -import { map, mergeMap, reduce, } from 'rxjs/operators'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnChanges, + Output, + SimpleChanges, +} from '@angular/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + from, + Observable, +} from 'rxjs'; +import { + map, + mergeMap, + reduce, +} from 'rxjs/operators'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../../../../core/data/remote-data'; @@ -8,9 +30,6 @@ import { Group } from '../../../../../../core/eperson/models/group.model'; import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators'; import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model'; import { isNotEmpty } from '../../../../../../shared/empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { VarDirective } from '../../../../../../shared/utils/var.directive'; export interface SupervisionOrderListEntry { @@ -19,11 +38,11 @@ export interface SupervisionOrderListEntry { } @Component({ - selector: 'ds-supervision-order-status', - templateUrl: './supervision-order-status.component.html', - styleUrls: ['./supervision-order-status.component.scss'], - standalone: true, - imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule] + selector: 'ds-supervision-order-status', + templateUrl: './supervision-order-status.component.html', + styleUrls: ['./supervision-order-status.component.scss'], + standalone: true, + imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule], }) export class SupervisionOrderStatusComponent implements OnChanges { diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts index dc9c922ad5..b89c487ec0 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts @@ -52,19 +52,19 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModalModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - WorkspaceItemAdminWorkflowActionsComponent - ], - providers: [ + WorkspaceItemAdminWorkflowActionsComponent, + ], + providers: [ { provide: DSONameService, useClass: DSONameServiceMock }, { provide: NotificationsService, useValue: notificationService }, { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts index 0c563e5c9a..2b02ce792c 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts @@ -1,3 +1,7 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -5,11 +9,15 @@ import { OnInit, Output, } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { map, Observable, @@ -26,25 +34,26 @@ import { Item } from '../../../../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model'; -import { SupervisionOrderListEntry, SupervisionOrderStatusComponent } from './supervision-order-status/supervision-order-status.component'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { ConfirmationModalComponent } from '../../../../../shared/confirmation-modal/confirmation-modal.component'; import { hasValue } from '../../../../../shared/empty.util'; import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; import { getSearchResultFor } from '../../../../../shared/search/search-result-element-decorator'; -import { RouterLink } from '@angular/router'; -import { NgClass, NgIf } from '@angular/common'; import { getWorkspaceItemDeleteRoute } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector/supervision-order-group-selector.component'; -import { SupervisionOrderListEntry } from './supervision-order-status/supervision-order-status.component'; +import { + SupervisionOrderListEntry, + SupervisionOrderListEntry, + SupervisionOrderStatusComponent, +} from './supervision-order-status/supervision-order-status.component'; @Component({ - selector: 'ds-workspace-item-admin-workflow-actions-element', - styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'], - templateUrl: './workspace-item-admin-workflow-actions.component.html', - standalone: true, - imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, NgIf, TranslateModule] + selector: 'ds-workspace-item-admin-workflow-actions-element', + styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'], + templateUrl: './workspace-item-admin-workflow-actions.component.html', + standalone: true, + imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, NgIf, TranslateModule], }) /** * The component for displaying the actions for a list element for a workspace-item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts index 4ab78fac54..959a9e9985 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -1,39 +1,35 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../../../../core/auth/auth.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; +import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../../../core/shared/item.model'; +import { ListableModule } from '../../../../../core/shared/listable.module'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { - DynamicComponentLoaderDirective -} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; -import { - WorkflowItemSearchResult -} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; -import { - ItemGridElementComponent -} from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; +import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; +import { ItemGridElementComponent } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub'; -import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; -import { ListableModule } from '../../../../../core/shared/listable.module'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; -import { - WorkflowItemSearchResultAdminWorkflowGridElementComponent -} from './workflow-item-search-result-admin-workflow-grid-element.component'; +import { WorkflowItemSearchResultAdminWorkflowGridElementComponent } from './workflow-item-search-result-admin-workflow-grid-element.component'; describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent; @@ -60,30 +56,30 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { init(); TestBed.configureTestingModule( { - imports: [ - WorkflowItemSearchResultAdminWorkflowGridElementComponent, - ItemGridElementComponent, - DynamicComponentLoaderDirective, - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ListableModule, - WorkflowItemSearchResultAdminWorkflowGridElementComponent - ], - providers: [ - { provide: LinkService, useValue: linkService }, - { provide: ThemeService, useValue: themeService }, - { + imports: [ + WorkflowItemSearchResultAdminWorkflowGridElementComponent, + ItemGridElementComponent, + DynamicComponentLoaderDirective, + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ListableModule, + WorkflowItemSearchResultAdminWorkflowGridElementComponent, + ], + providers: [ + { provide: LinkService, useValue: linkService }, + { provide: ThemeService, useValue: themeService }, + { provide: TruncatableService, useValue: { - isCollapsed: () => observableOf(true), + isCollapsed: () => observableOf(true), }, - }, - { provide: BitstreamDataService, useValue: {} }, - { provide: AuthService, useValue: new AuthServiceMock() }, - { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, - ], + }, + { provide: BitstreamDataService, useValue: {} }, + { provide: AuthService, useValue: new AuthServiceMock() }, + { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts index 2a4f56c2e4..8ceb4b12bc 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component.ts @@ -1,4 +1,13 @@ -import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + ComponentRef, + ElementRef, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -9,39 +18,32 @@ import { RemoteData } from '../../../../../core/data/remote-data'; import { Context } from '../../../../../core/shared/context.model'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; import { Item } from '../../../../../core/shared/item.model'; -import { getAllSucceededRemoteData, getRemoteDataPayload, } from '../../../../../core/shared/operators'; +import { + getAllSucceededRemoteData, + getRemoteDataPayload, +} from '../../../../../core/shared/operators'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { - DynamicComponentLoaderDirective -} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { hasValue } from '../../../../../shared/empty.util'; import { getListableObjectComponent, listableObjectComponent, } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - WorkflowItemSearchResult -} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; -import { - SearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; +import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; +import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { - WorkflowItemAdminWorkflowActionsComponent -} from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component'; -import { NgIf } from '@angular/common'; +import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component'; @listableObjectComponent(WorkflowItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch) @Component({ - selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', - styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'], - templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html', - standalone: true, - imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective] + selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', + styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'], + templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html', + standalone: true, + imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective], }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts index 76f72cba69..e9eb682839 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.spec.ts @@ -9,32 +9,36 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../../../../core/auth/auth.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; -import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; +import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { + DSpaceObject, + DSpaceObject, +} from '../../../../../core/shared/dspace-object.model'; import { Item } from '../../../../../core/shared/item.model'; +import { ListableModule } from '../../../../../core/shared/listable.module'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; +import { + SupervisionOrderDataService, + SupervisionOrderDataService, +} from '../../../../../core/supervision-order/supervision-order-data.service'; import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { ItemGridElementComponent } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; +import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub'; import { supervisionOrderPaginatedListRD, supervisionOrderPaginatedListRD$, } from '../../../../../shared/testing/supervision-order.mock'; -import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; -import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; -import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; -import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub'; -import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; -import { ListableModule } from '../../../../../core/shared/listable.module'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; @@ -70,32 +74,32 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => { init(); TestBed.configureTestingModule( { - imports: [ - WorkspaceItemSearchResultAdminWorkflowGridElementComponent, - ItemGridElementComponent, - DynamicComponentLoaderDirective, - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ListableModule, - WorkspaceItemSearchResultAdminWorkflowGridElementComponent - ], - providers: [ - { provide: LinkService, useValue: linkService }, - { provide: ThemeService, useValue: themeService }, - { + imports: [ + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, + ItemGridElementComponent, + DynamicComponentLoaderDirective, + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ListableModule, + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, + ], + providers: [ + { provide: LinkService, useValue: linkService }, + { provide: ThemeService, useValue: themeService }, + { provide: TruncatableService, useValue: { - isCollapsed: () => observableOf(true), + isCollapsed: () => observableOf(true), }, - }, - { provide: BitstreamDataService, useValue: {} }, - { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, - { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - { provide: AuthService, useValue: new AuthServiceMock() }, - { provide: AuthorizationDataService, useValue: {} }, - ], + }, + { provide: BitstreamDataService, useValue: {} }, + { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, + { provide: AuthService, useValue: new AuthServiceMock() }, + { provide: AuthorizationDataService, useValue: {} }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts index 5dbc9fd4b4..79fcc69939 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component.ts @@ -1,18 +1,27 @@ -import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core'; - -import { BehaviorSubject, Observable } from 'rxjs'; -import { map, mergeMap, take, tap } from 'rxjs/operators'; - -import { Item } from '../../../../../core/shared/item.model'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + ComponentRef, + ElementRef, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + Observable, Observable, } from 'rxjs'; import { map, + map, + mergeMap, mergeMap, take, + take, + tap, tap, } from 'rxjs/operators'; @@ -25,23 +34,23 @@ import { Context } from '../../../../../core/shared/context.model'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; import { - Item } from '../../../../../core/shared/item.model'; + Item, + Item, +} from '../../../../../core/shared/item.model'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../../../core/shared/operators'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { + ViewMode, + ViewMode, +} from '../../../../../core/shared/view-mode.model'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { hasValue } from '../../../../../shared/empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe } from '@angular/common'; -import { - WorkspaceItemAdminWorkflowActionsComponent -} from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component'; import { getListableObjectComponent, listableObjectComponent, @@ -51,14 +60,15 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; +import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component'; @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch) @Component({ - selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', - styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'], - templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html', - standalone: true, - imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective] + selector: 'ds-workflow-item-search-result-admin-workflow-grid-element', + styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'], + templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html', + standalone: true, + imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective], }) /** * The component for displaying a grid element for an workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts index 2fe85e8070..fbb936080f 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.spec.ts @@ -1,34 +1,34 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; +import { AuthService } from '../../../../../core/auth/auth.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; +import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; -import { - WorkflowItemSearchResult -} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; +import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; -import { - WorkflowItemSearchResultAdminWorkflowListElementComponent -} from './workflow-item-search-result-admin-workflow-list-element.component'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { WorkflowItemSearchResultAdminWorkflowListElementComponent } from './workflow-item-search-result-admin-workflow-list-element.component'; describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => { let component: WorkflowItemSearchResultAdminWorkflowListElementComponent; @@ -53,23 +53,23 @@ describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => { init(); TestBed.configureTestingModule( { - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - WorkflowItemSearchResultAdminWorkflowListElementComponent - ], - providers: [ - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment }, - { provide: ThemeService, useValue: getMockThemeService() }, - { provide: AuthService, useValue: new AuthServiceMock() }, - { provide: AuthorizationDataService, useValue: {} }, - ], + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + WorkflowItemSearchResultAdminWorkflowListElementComponent, + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: LinkService, useValue: linkService }, + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: APP_CONFIG, useValue: environment }, + { provide: ThemeService, useValue: getMockThemeService() }, + { provide: AuthService, useValue: new AuthServiceMock() }, + { provide: AuthorizationDataService, useValue: {} }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts index 2a298065ff..2bb6dbb32a 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component.ts @@ -1,8 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Inject, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { @@ -21,22 +26,20 @@ import { import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component'; -import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement, Context.AdminWorkflowSearch) @Component({ - selector: 'ds-workflow-item-search-result-admin-workflow-list-element', - styleUrls: ['./workflow-item-search-result-admin-workflow-list-element.component.scss'], - templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html', - standalone: true, - imports: [NgIf, ListableObjectComponentLoaderComponent, WorkflowItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule] + selector: 'ds-workflow-item-search-result-admin-workflow-list-element', + styleUrls: ['./workflow-item-search-result-admin-workflow-list-element.component.scss'], + templateUrl: './workflow-item-search-result-admin-workflow-list-element.component.html', + standalone: true, + imports: [NgIf, ListableObjectComponentLoaderComponent, WorkflowItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a list element for a workflow item on the admin workflow search page diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts index fca8d9c533..819b51aaeb 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.spec.ts @@ -10,31 +10,33 @@ import { TranslateModule } from '@ngx-translate/core'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; +import { AuthService } from '../../../../../core/auth/auth.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; -import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; +import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { + DSpaceObject, + DSpaceObject, +} from '../../../../../core/shared/dspace-object.model'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; +import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub'; import { supervisionOrderPaginatedListRD, supervisionOrderPaginatedListRD$, } from '../../../../../shared/testing/supervision-order.mock'; -import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; -import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; -import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { WorkspaceItemSearchResultAdminWorkflowListElementComponent } from './workspace-item-search-result-admin-workflow-list-element.component'; @@ -67,25 +69,25 @@ describe('WorkspaceItemSearchResultAdminWorkflowListElementComponent', () => { init(); TestBed.configureTestingModule( { - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - WorkspaceItemSearchResultAdminWorkflowListElementComponent - ], - providers: [ - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - { provide: ThemeService, useValue: getMockThemeService() }, - { provide: AuthService, useValue: new AuthServiceMock() }, - { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: AuthorizationDataService, useValue: {} }, - { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + WorkspaceItemSearchResultAdminWorkflowListElementComponent, + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, + { provide: ThemeService, useValue: getMockThemeService() }, + { provide: AuthService, useValue: new AuthServiceMock() }, + { provide: LinkService, useValue: linkService }, + { provide: DSONameService, useClass: DSONameServiceMock }, + { provide: AuthorizationDataService, useValue: {} }, + { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts index a8c5821b96..3fce9ebdab 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component.ts @@ -1,8 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Inject, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -35,22 +40,20 @@ import { WorkspaceItem } from '../../../../../core/submission/models/workspaceit import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { WorkspaceItemSearchResult } from '../../../../../shared/object-collection/shared/workspace-item-search-result.model'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component'; -import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.ListElement, Context.AdminWorkflowSearch) @Component({ - selector: 'ds-workflow-item-search-result-admin-workflow-list-element', - styleUrls: ['./workspace-item-search-result-admin-workflow-list-element.component.scss'], - templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html', - standalone: true, - imports: [NgIf, ListableObjectComponentLoaderComponent, WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule] + selector: 'ds-workflow-item-search-result-admin-workflow-list-element', + styleUrls: ['./workspace-item-search-result-admin-workflow-list-element.component.scss'], + templateUrl: './workspace-item-search-result-admin-workflow-list-element.component.html', + standalone: true, + imports: [NgIf, ListableObjectComponentLoaderComponent, WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a list element for a workflow item on the admin workflow search page diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e9cb345819..20c7e5a4e9 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,11 +1,23 @@ -import { importProvidersFrom, NgModule } from '@angular/core'; -import { AuthBlockingGuard } from './core/auth/auth-blocking.guard'; +import { + importProvidersFrom, + NgModule, +} from '@angular/core'; import { NoPreloading, RouterModule, } from '@angular/router'; +import { EffectsModule } from '@ngrx/effects'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; -import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths'; +import { + NOTIFICATIONS_MODULE_PATH, + NOTIFICATIONS_MODULE_PATH, +} from './admin/admin-routing-paths'; +import { storeModuleConfig } from './app.reducer'; import { ACCESS_CONTROL_MODULE_PATH, ADMIN_MODULE_PATH, @@ -24,42 +36,46 @@ import { } from './app-routing-paths'; import { COLLECTION_MODULE_PATH } from './collection-page/collection-page-routing-paths'; import { COMMUNITY_MODULE_PATH } from './community-page/community-page-routing-paths'; -import { AuthBlockingGuard } from './core/auth/auth-blocking.guard'; +import { + AuthBlockingGuard, + AuthBlockingGuard, +} from './core/auth/auth-blocking.guard'; import { AuthenticatedGuard } from './core/auth/authenticated.guard'; import { GroupAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/group-administrator.guard'; import { SiteRegisterGuard } from './core/data/feature-authorization/feature-authorization-guard/site-register.guard'; import { EndUserAgreementCurrentUserGuard } from './core/end-user-agreement/end-user-agreement-current-user.guard'; import { ReloadGuard } from './core/reload/reload.guard'; -import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard'; +import { + ForgotPasswordCheckGuard, + ForgotPasswordCheckGuard, +} from './core/rest-property/forgot-password-check-guard.guard'; import { ServerCheckGuard } from './core/server-check/server-check.guard'; import { ThemedForbiddenComponent } from './forbidden/themed-forbidden.component'; import { ITEM_MODULE_PATH } from './item-page/item-page-routing-paths'; import { MenuResolver } from './menu.resolver'; import { ThemedPageErrorComponent } from './page-error/themed-page-error.component'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; -import { storeModuleConfig } from './app.reducer'; -import { EffectsModule } from '@ngrx/effects'; -import { submissionReducers, SubmissionState } from './submission/submission.reducers'; -import { submissionEffects } from './submission/submission.effects'; -import { ForgotPasswordCheckGuard } from './core/rest-property/forgot-password-check-guard.guard'; -import { NOTIFICATIONS_MODULE_PATH } from './admin/admin-routing-paths'; import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component'; import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component'; import { PROCESS_MODULE_PATH } from './process-page/process-page-routing.paths'; +import { submissionEffects } from './submission/submission.effects'; +import { + submissionReducers, + SubmissionState, +} from './submission/submission.reducers'; import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-routing-paths'; @NgModule({ imports: [ RouterModule.forRoot([ - {path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent}, - {path: ERROR_PAGE, component: ThemedPageErrorComponent}, + { path: INTERNAL_SERVER_ERROR, component: ThemedPageInternalServerErrorComponent }, + { path: ERROR_PAGE, component: ThemedPageErrorComponent }, { path: '', canActivate: [AuthBlockingGuard], canActivateChild: [ServerCheckGuard], resolve: [MenuResolver], children: [ - {path: '', redirectTo: '/home', pathMatch: 'full'}, + { path: '', redirectTo: '/home', pathMatch: 'full' }, { path: 'reload/:rnd', component: ThemedPageNotFoundComponent, @@ -70,7 +86,7 @@ import { SUGGESTION_MODULE_PATH } from './suggestions-page/suggestions-page-rout path: 'home', loadChildren: () => import('./home-page/home-page-routes') .then((m) => m.ROUTES), - data: {showBreadcrumbs: false}, + data: { showBreadcrumbs: false }, canActivate: [EndUserAgreementCurrentUserGuard], }, { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a1a3f924df..8c5e3a6c2c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -37,27 +37,30 @@ import { } from 'rxjs/operators'; import { environment } from '../environments/environment'; -import { ThemeService } from './shared/theme-support/theme.service'; -import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; import { AuthService } from './core/auth/auth.service'; import { isAuthenticationBlocking } from './core/auth/selectors'; -import { models } from './core/core.module'; import { NativeWindowRef, NativeWindowService, } from './core/services/window.service'; import { distinctNext } from './core/shared/distinct-next'; import { HostWindowResizeAction } from './shared/host-window.actions'; -import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; +import { + IdleModalComponent, + IdleModalComponent, +} from './shared/idle-modal/idle-modal.component'; import { CSSVariableService } from './shared/sass-helper/css-variable.service'; import { HostWindowState } from './shared/search/host-window.reducer'; -import { ThemeService } from './shared/theme-support/theme.service'; +import { + ThemeService, + ThemeService, +} from './shared/theme-support/theme.service'; @Component({ - selector: 'ds-app', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'ds-app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, }) export class AppComponent implements OnInit, AfterViewInit { notificationOptions; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ede2355e40..9704394444 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,61 +23,80 @@ import { } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'; +import { NgxMaskModule } from 'ngx-mask'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../config/app-config.interface'; -import { StoreDevModules } from '../config/store/devtools'; -import { environment } from '../environments/environment'; -import { EagerThemesModule } from '../themes/eager-themes.module'; +import { + StoreDevModules, + StoreDevModules, +} from '../config/store/devtools'; +import { + environment, + environment, +} from '../environments/environment'; +import { + EagerThemesModule, + EagerThemesModule, +} from '../themes/eager-themes.module'; import { AppComponent } from './app.component'; import { appEffects } from './app.effects'; -import { appMetaReducers, debugMetaReducers } from './app.metareducers'; -import { appReducers, AppState, storeModuleConfig } from './app.reducer'; import { appMetaReducers, + appMetaReducers, + debugMetaReducers, debugMetaReducers, } from './app.metareducers'; import { + appReducers, appReducers, AppState, + AppState, + storeModuleConfig, storeModuleConfig, } from './app.reducer'; import { AppRoutingModule } from './app-routing.module'; -import { AuthInterceptor } from './core/auth/auth.interceptor'; -import { CoreModule } from './core/core.module'; -import { LocaleInterceptor } from './core/locale/locale.interceptor'; -import { LogInterceptor } from './core/log/log.interceptor'; -import { ClientCookieService } from './core/services/client-cookie.service'; -import { XsrfInterceptor } from './core/xsrf/xsrf.interceptor'; -import { NavbarModule } from './navbar/navbar.module'; -import { RootModule } from './root.module'; -import { DSpaceRouterStateSerializer } from './shared/ngrx/dspace-router-state-serializer'; -import { environment } from '../environments/environment'; -import { AuthInterceptor } from './core/auth/auth.interceptor'; -import { LocaleInterceptor } from './core/locale/locale.interceptor'; -import { XsrfInterceptor } from './core/xsrf/xsrf.interceptor'; -import { LogInterceptor } from './core/log/log.interceptor'; -import { EagerThemesModule } from '../themes/eager-themes.module'; -import { APP_CONFIG, AppConfig } from '../config/app-config.interface'; -import { StoreDevModules } from '../config/store/devtools'; -import { RootModule } from './root.module'; -import { models, provideCore } from './core/provide-core'; -import { ThemedRootComponent } from './root/themed-root.component'; -import { NgxMaskModule } from 'ngx-mask'; -import { ListableModule } from './core/shared/listable.module'; import { BROWSE_BY_DECORATOR_MAP } from './browse-by/browse-by-switcher/browse-by-decorator'; +import { + AuthInterceptor, + AuthInterceptor, +} from './core/auth/auth.interceptor'; +import { + LocaleInterceptor, + LocaleInterceptor, +} from './core/locale/locale.interceptor'; +import { + LogInterceptor, + LogInterceptor, +} from './core/log/log.interceptor'; +import { + models, + provideCore, +} from './core/provide-core'; +import { ClientCookieService } from './core/services/client-cookie.service'; +import { ListableModule } from './core/shared/listable.module'; +import { + XsrfInterceptor, + XsrfInterceptor, +} from './core/xsrf/xsrf.interceptor'; +import { NavbarModule } from './navbar/navbar.module'; +import { + RootModule, + RootModule, +} from './root.module'; +import { ThemedRootComponent } from './root/themed-root.component'; import { AUTH_METHOD_FOR_DECORATOR_MAP } from './shared/log-in/methods/log-in.methods-decorator'; -import { STARTS_WITH_DECORATOR_MAP } from './shared/starts-with/starts-with-decorator'; +import { METADATA_REPRESENTATION_COMPONENT_DECORATOR_MAP } from './shared/metadata-representation/metadata-representation.decorator'; import { ADVANCED_WORKFLOW_TASK_OPTION_DECORATOR_MAP, - WORKFLOW_TASK_OPTION_DECORATOR_MAP + WORKFLOW_TASK_OPTION_DECORATOR_MAP, } from './shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator'; -import { - METADATA_REPRESENTATION_COMPONENT_DECORATOR_MAP -} from './shared/metadata-representation/metadata-representation.decorator'; -import { SharedModule } from './shared/shared.module'; +import { DSpaceRouterStateSerializer } from './shared/ngrx/dspace-router-state-serializer'; +import { STARTS_WITH_DECORATOR_MAP } from './shared/starts-with/starts-with-decorator'; export function getConfig() { return environment; @@ -107,7 +126,7 @@ const IMPORTS = [ StoreDevModules, EagerThemesModule, RootModule, - ListableModule.withEntryComponents() + ListableModule.withEntryComponents(), ]; const PROVIDERS = [ @@ -160,10 +179,10 @@ const PROVIDERS = [ AppComponent, ], imports: [ - BrowserModule.withServerTransition({appId: 'dspace-angular'}), + BrowserModule.withServerTransition({ appId: 'dspace-angular' }), ...IMPORTS, NgxMaskModule.forRoot(), - ThemedRootComponent + ThemedRootComponent, ], providers: [ ...PROVIDERS, diff --git a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts index ab8b752585..2e528b5c5e 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts @@ -19,8 +19,8 @@ import { of as observableOf } from 'rxjs'; import { Bitstream } from '../../core/shared/bitstream.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; -import { ResourcePoliciesComponent } from '../../shared/resource-policies/resource-policies.component'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; +import { ResourcePoliciesComponent } from '../../shared/resource-policies/resource-policies.component'; import { BitstreamAuthorizationsComponent } from './bitstream-authorizations.component'; describe('BitstreamAuthorizationsComponent', () => { @@ -52,25 +52,25 @@ describe('BitstreamAuthorizationsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - BitstreamAuthorizationsComponent - ], - providers: [ + BitstreamAuthorizationsComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, BitstreamAuthorizationsComponent, - ], - schemas: [NO_ERRORS_SCHEMA] -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(BitstreamAuthorizationsComponent, { - remove: { imports: [ResourcePoliciesComponent]} + remove: { imports: [ResourcePoliciesComponent] }, }) .compileComponents(); })); diff --git a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts index 60ac7e4335..4bb89a85f4 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts @@ -1,8 +1,13 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, RouterLink } from '@angular/router'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { first, @@ -12,8 +17,6 @@ import { import { RemoteData } from '../../core/data/remote-data'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { ResourcePoliciesComponent } from '../../shared/resource-policies/resource-policies.component'; -import { AsyncPipe } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-collection-authorizations', @@ -22,9 +25,9 @@ import { TranslateModule } from '@ngx-translate/core'; ResourcePoliciesComponent, AsyncPipe, TranslateModule, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * Component that handles the Collection Authorizations diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts index 3c24bc07e0..0cc293c6f7 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts @@ -98,8 +98,8 @@ describe('BitstreamDownloadPageComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), BitstreamDownloadPageComponent], - providers: [ + imports: [CommonModule, TranslateModule.forRoot(), BitstreamDownloadPageComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: AuthorizationDataService, useValue: authorizationService }, @@ -110,7 +110,7 @@ describe('BitstreamDownloadPageComponent', () => { { provide: SignpostingDataService, useValue: signpostingDataService }, { provide: PLATFORM_ID, useValue: 'server' }, ], -}) + }) .compileComponents(); } diff --git a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts index 7fc16a93fe..50cdfeffc8 100644 --- a/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts +++ b/src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts @@ -1,5 +1,8 @@ import { + AsyncPipe, isPlatformServer, + isPlatformServer, + Location, Location, } from '@angular/common'; import { @@ -12,6 +15,7 @@ import { ActivatedRoute, Router, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, @@ -26,20 +30,24 @@ import { import { getForbiddenRoute } from '../../app-routing-paths'; import { AuthService } from '../../core/auth/auth.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; import { RemoteData } from '../../core/data/remote-data'; -import { redirectOn4xx } from '../../core/shared/authorized.operators'; -import { AsyncPipe, isPlatformServer, Location } from '@angular/common'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; -import { SignpostingLink } from '../../core/data/signposting-links.model'; +import { + SignpostingLink, + SignpostingLink, +} from '../../core/data/signposting-links.model'; import { HardRedirectService } from '../../core/services/hard-redirect.service'; import { ServerResponseService } from '../../core/services/server-response.service'; -import { SignpostingLink } from '../../core/data/signposting-links.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { redirectOn4xx } from '../../core/shared/authorized.operators'; +import { + redirectOn4xx, + redirectOn4xx, +} from '../../core/shared/authorized.operators'; import { Bitstream } from '../../core/shared/bitstream.model'; import { FileService } from '../../core/shared/file.service'; import { getRemoteDataPayload } from '../../core/shared/operators'; @@ -53,9 +61,9 @@ import { templateUrl: './bitstream-download-page.component.html', imports: [ AsyncPipe, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Page component for downloading a bitstream diff --git a/src/app/bitstream-page/bitstream-page-routes.ts b/src/app/bitstream-page/bitstream-page-routes.ts index 2820243a7d..720bdbf7f2 100644 --- a/src/app/bitstream-page/bitstream-page-routes.ts +++ b/src/app/bitstream-page/bitstream-page-routes.ts @@ -1,17 +1,18 @@ import { Route } from '@angular/router'; + import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { BitstreamPageResolver } from './bitstream-page.resolver'; -import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component'; -import { ResourcePolicyTargetResolver } from '../shared/resource-policies/resolvers/resource-policy-target.resolver'; -import { ResourcePolicyCreateComponent } from '../shared/resource-policies/create/resource-policy-create.component'; -import { ResourcePolicyResolver } from '../shared/resource-policies/resolvers/resource-policy.resolver'; -import { ResourcePolicyEditComponent } from '../shared/resource-policies/edit/resource-policy-edit.component'; -import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; -import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; import { BitstreamBreadcrumbResolver } from '../core/breadcrumbs/bitstream-breadcrumb.resolver'; import { BitstreamBreadcrumbsService } from '../core/breadcrumbs/bitstream-breadcrumbs.service'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { ResourcePolicyCreateComponent } from '../shared/resource-policies/create/resource-policy-create.component'; +import { ResourcePolicyEditComponent } from '../shared/resource-policies/edit/resource-policy-edit.component'; +import { ResourcePolicyResolver } from '../shared/resource-policies/resolvers/resource-policy.resolver'; +import { ResourcePolicyTargetResolver } from '../shared/resource-policies/resolvers/resource-policy-target.resolver'; +import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bitstream-authorizations.component'; +import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component'; +import { BitstreamPageResolver } from './bitstream-page.resolver'; import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component'; +import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver'; const EDIT_BITSTREAM_PATH = ':id/edit'; const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; @@ -23,7 +24,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations'; const providers = [ BitstreamPageResolver, BitstreamBreadcrumbResolver, - BitstreamBreadcrumbsService + BitstreamBreadcrumbsService, ]; export const ROUTES: Route[] = [ @@ -33,7 +34,7 @@ export const ROUTES: Route[] = [ component: BitstreamDownloadPageComponent, providers, resolve: { - bitstream: LegacyBitstreamUrlResolver + bitstream: LegacyBitstreamUrlResolver, }, }, { @@ -42,7 +43,7 @@ export const ROUTES: Route[] = [ component: BitstreamDownloadPageComponent, providers, resolve: { - bitstream: LegacyBitstreamUrlResolver + bitstream: LegacyBitstreamUrlResolver, }, }, { @@ -51,7 +52,7 @@ export const ROUTES: Route[] = [ component: BitstreamDownloadPageComponent, providers, resolve: { - bitstream: BitstreamPageResolver + bitstream: BitstreamPageResolver, }, }, { @@ -62,7 +63,7 @@ export const ROUTES: Route[] = [ bitstream: BitstreamPageResolver, breadcrumb: BitstreamBreadcrumbResolver, }, - canActivate: [AuthenticatedGuard] + canActivate: [AuthenticatedGuard], }, { path: EDIT_BITSTREAM_AUTHORIZATIONS_PATH, @@ -71,19 +72,19 @@ export const ROUTES: Route[] = [ { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: {title: 'resource-policies.create.page.title', showBreadcrumbs: true} + data: { title: 'resource-policies.create.page.title', showBreadcrumbs: true }, }, { path: 'edit', resolve: { breadcrumb: I18nBreadcrumbResolver, - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: {breadcrumbKey: 'item.edit', title: 'resource-policies.edit.page.title', showBreadcrumbs: true} + data: { breadcrumbKey: 'item.edit', title: 'resource-policies.edit.page.title', showBreadcrumbs: true }, }, { path: '', @@ -92,8 +93,8 @@ export const ROUTES: Route[] = [ breadcrumb: BitstreamBreadcrumbResolver, }, component: BitstreamAuthorizationsComponent, - data: {title: 'bitstream.edit.authorizations.title', showBreadcrumbs: true} - } - ] - } + data: { title: 'bitstream.edit.authorizations.title', showBreadcrumbs: true }, + }, + ], + }, ]; diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index d8dcc64a35..9243a36491 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -215,25 +215,25 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], - providers: [ - { provide: NotificationsService, useValue: notificationsService }, - { provide: DynamicFormService, useValue: formService }, - { + imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], + providers: [ + { provide: NotificationsService, useValue: notificationsService }, + { provide: DynamicFormService, useValue: formService }, + { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, - }, - { provide: BitstreamDataService, useValue: bitstreamService }, - { provide: DSONameService, useValue: dsoNameService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, ChangeDetectorRef, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); @@ -503,25 +503,25 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], - providers: [ - { provide: NotificationsService, useValue: notificationsService }, - { provide: DynamicFormService, useValue: formService }, - { + imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], + providers: [ + { provide: NotificationsService, useValue: notificationsService }, + { provide: DynamicFormService, useValue: formService }, + { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, - }, - { provide: BitstreamDataService, useValue: bitstreamService }, - { provide: DSONameService, useValue: dsoNameService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, ChangeDetectorRef, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { @@ -627,25 +627,25 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], - providers: [ - { provide: NotificationsService, useValue: notificationsService }, - { provide: DynamicFormService, useValue: formService }, - { provide: ActivatedRoute, + imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], + providers: [ + { provide: NotificationsService, useValue: notificationsService }, + { provide: DynamicFormService, useValue: formService }, + { provide: ActivatedRoute, useValue: { - data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), snapshot: { queryParams: {} }, }, - }, - { provide: BitstreamDataService, useValue: bitstreamService }, - { provide: DSONameService, useValue: dsoNameService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, ChangeDetectorRef, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); - })); + }).compileComponents(); + })); beforeEach(() => { fixture = TestBed.createComponent(EditBitstreamPageComponent); diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index f002b0af81..1c0e90690c 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -1,18 +1,26 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { Bitstream } from '../../core/shared/bitstream.model'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { filter, map, switchMap, tap } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, + ChangeDetectionStrategy, + ChangeDetectorRef, ChangeDetectorRef, Component, + Component, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterLink, } from '@angular/router'; import { DynamicFormControlModel, @@ -22,7 +30,10 @@ import { DynamicInputModel, DynamicSelectModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import cloneDeep from 'lodash/cloneDeep'; import { combineLatest, @@ -33,23 +44,48 @@ import { } from 'rxjs'; import { filter, + filter, + map, map, switchMap, + switchMap, + tap, tap, } from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; -import { BitstreamFormatDataService } from '../../core/data/bitstream-format-data.service'; -import { PaginatedList } from '../../core/data/paginated-list.model'; +import { + BitstreamFormatDataService, + BitstreamFormatDataService, +} from '../../core/data/bitstream-format-data.service'; +import { + PaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; import { PrimaryBitstreamService } from '../../core/data/primary-bitstream.service'; -import { RemoteData } from '../../core/data/remote-data'; -import { Bitstream } from '../../core/shared/bitstream.model'; -import { BitstreamFormat } from '../../core/shared/bitstream-format.model'; -import { BitstreamFormatSupportLevel } from '../../core/shared/bitstream-format-support-level'; +import { + RemoteData, + RemoteData, +} from '../../core/data/remote-data'; +import { + Bitstream, + Bitstream, +} from '../../core/shared/bitstream.model'; +import { + BitstreamFormat, + BitstreamFormat, +} from '../../core/shared/bitstream-format.model'; +import { + BitstreamFormatSupportLevel, + BitstreamFormatSupportLevel, +} from '../../core/shared/bitstream-format-support-level'; import { Bundle } from '../../core/shared/bundle.model'; import { Item } from '../../core/shared/item.model'; -import { Metadata } from '../../core/shared/metadata.utils'; +import { + Metadata, + Metadata, +} from '../../core/shared/metadata.utils'; import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, @@ -57,32 +93,30 @@ import { getFirstSucceededRemoteDataPayload, getRemoteDataPayload, } from '../../core/shared/operators'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { BitstreamFormatDataService } from '../../core/data/bitstream-format-data.service'; -import { BitstreamFormat } from '../../core/shared/bitstream-format.model'; -import { BitstreamFormatSupportLevel } from '../../core/shared/bitstream-format-support-level'; -import { hasValue, hasValueOperator, isEmpty, isNotEmpty } from '../../shared/empty.util'; -import { Metadata } from '../../core/shared/metadata.utils'; -import { AsyncPipe, Location, NgIf } from '@angular/common'; -import { RemoteData } from '../../core/data/remote-data'; -import { PaginatedList } from '../../core/data/paginated-list.model'; import { getEntityEditRoute } from '../../item-page/item-page-routing-paths'; import { hasValue, + hasValue, + hasValueOperator, hasValueOperator, isEmpty, + isEmpty, + isNotEmpty, isNotEmpty, } from '../../shared/empty.util'; +import { ErrorComponent } from '../../shared/error/error.component'; import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import { DsDynamicInputModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-input.model'; import { DsDynamicTextAreaModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-textarea.model'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; import { FormComponent } from '../../shared/form/form.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; +import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.component'; -import { ErrorComponent } from '../../shared/error/error.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { FileSizePipe } from '../../shared/utils/file-size-pipe'; @Component({ selector: 'ds-edit-bitstream-page', @@ -99,9 +133,9 @@ import { FileSizePipe } from '../../shared/utils/file-size-pipe'; ErrorComponent, ThemedLoadingComponent, TranslateModule, - FileSizePipe + FileSizePipe, ], - standalone: true + standalone: true, }) /** * Page component for editing a bitstream diff --git a/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts index 09fac149d9..4d8a9946f5 100644 --- a/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts +++ b/src/app/bitstream-page/edit-bitstream-page/themed-edit-bitstream-page.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { EditBitstreamPageComponent } from './edit-bitstream-page.component'; @Component({ - selector: 'ds-themed-edit-bitstream-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-edit-bitstream-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedEditBitstreamPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/breadcrumbs/breadcrumbs.component.spec.ts b/src/app/breadcrumbs/breadcrumbs.component.spec.ts index 28eb251b25..168028cd1e 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.spec.ts @@ -47,21 +47,21 @@ describe('BreadcrumbsComponent', () => { } as BreadcrumbsService; TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, }, }), BreadcrumbsComponent, - VarDirective - ], - providers: [ + VarDirective, + ], + providers: [ { provide: BreadcrumbsService, useValue: breadcrumbsServiceMock }, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(BreadcrumbsComponent); component = fixture.componentInstance; diff --git a/src/app/breadcrumbs/breadcrumbs.component.ts b/src/app/breadcrumbs/breadcrumbs.component.ts index eeba1cb8c8..ae661cfe6f 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.ts @@ -1,14 +1,21 @@ +import { + AsyncPipe, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { Component } from '@angular/core'; -import { Observable } from 'rxjs'; +import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + Observable, +} from 'rxjs'; +import { VarDirective } from '../shared/utils/var.directive'; import { Breadcrumb } from './breadcrumb/breadcrumb.model'; import { BreadcrumbsService } from './breadcrumbs.service'; -import { Observable } from 'rxjs'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; -import { VarDirective } from '../shared/utils/var.directive'; /** * Component representing the breadcrumbs of a page @@ -18,7 +25,7 @@ import { VarDirective } from '../shared/utils/var.directive'; templateUrl: './breadcrumbs.component.html', styleUrls: ['./breadcrumbs.component.scss'], standalone: true, - imports: [VarDirective, NgIf, NgTemplateOutlet, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule] + imports: [VarDirective, NgIf, NgTemplateOutlet, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule], }) export class BreadcrumbsComponent { diff --git a/src/app/breadcrumbs/themed-breadcrumbs.component.ts b/src/app/breadcrumbs/themed-breadcrumbs.component.ts index 43763a3b0c..2e471fd92d 100644 --- a/src/app/breadcrumbs/themed-breadcrumbs.component.ts +++ b/src/app/breadcrumbs/themed-breadcrumbs.component.ts @@ -7,10 +7,10 @@ import { BreadcrumbsComponent } from './breadcrumbs.component'; * Themed wrapper for BreadcrumbsComponent */ @Component({ - selector: 'ds-themed-breadcrumbs', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-breadcrumbs', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedBreadcrumbsComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts index 571fa507d6..593e2e989b 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts @@ -105,12 +105,12 @@ describe('BrowseByDateComponent', () => { EnumKeysPipe, VarDirective], providers: [ - {provide: ActivatedRoute, useValue: activatedRouteStub}, - {provide: BrowseService, useValue: mockBrowseService}, - {provide: DSpaceObjectDataService, useValue: mockDsoService}, - {provide: Router, useValue: new RouterMock()}, - {provide: PaginationService, useValue: paginationService}, - {provide: ChangeDetectorRef, useValue: mockCdRef}, + { provide: ActivatedRoute, useValue: activatedRouteStub }, + { provide: BrowseService, useValue: mockBrowseService }, + { provide: DSpaceObjectDataService, useValue: mockDsoService }, + { provide: Router, useValue: new RouterMock() }, + { provide: PaginationService, useValue: paginationService }, + { provide: ChangeDetectorRef, useValue: mockCdRef }, { provide: APP_CONFIG, useValue: environment }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.ts index 22b8663b81..bb2a04f736 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -1,71 +1,81 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, Inject, - OnInit,} from '@angular/core'; + OnInit, +} from '@angular/core'; import { ActivatedRoute, Params, Router, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + map, + map, +} from 'rxjs/operators'; +import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../config/app-config.interface'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { BrowseService } from '../../core/browse/browse.service'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { map } from 'rxjs/operators'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { isValidDate } from '../../shared/date.util'; -import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; import { RemoteData } from '../../core/data/remote-data'; -import { PaginationService } from '../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../core/pagination/pagination.service'; import { Item } from '../../core/shared/item.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; import { - ThemedComcolPageHandleComponent -} from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; + isValidDate, + isValidDate, +} from '../../shared/date.util'; import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; -import { StartsWithType } from '../../shared/starts-with/starts-with-type'; -import { isValidDate } from '../../shared/date.util'; import { hasValue, isNotEmpty, } from '../../shared/empty.util'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../shared/pagination/pagination-component-options.model'; import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; +import { StartsWithType } from '../../shared/starts-with/starts-with-type'; +import { VarDirective } from '../../shared/utils/var.directive'; import { BrowseByMetadataComponent, browseParamsToOptions, getBrowseSearchOptions, } from '../browse-by-metadata/browse-by-metadata.component'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; @Component({ selector: 'ds-browse-by-date', @@ -85,8 +95,8 @@ import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) /** * Component for browsing items by metadata definition of type 'date' diff --git a/src/app/browse-by/browse-by-guard.ts b/src/app/browse-by/browse-by-guard.ts index 5d5cb0322d..af1301027e 100644 --- a/src/app/browse-by/browse-by-guard.ts +++ b/src/app/browse-by/browse-by-guard.ts @@ -26,7 +26,7 @@ import { hasValue, } from '../shared/empty.util'; -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) /** * A guard taking care of the correct route.data being set for the Browse-By components */ diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts index ba2e73eb32..8e43cedd32 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts @@ -5,6 +5,7 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router, @@ -12,13 +13,27 @@ import { import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { cold } from 'jasmine-marbles'; +import { + cold, + cold, +} from 'jasmine-marbles'; import { Observable, of as observableOf, } from 'rxjs'; +import { RouteService } from 'src/app/core/services/route.service'; +import { DsoEditMenuComponent } from 'src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { HostWindowService } from 'src/app/shared/host-window.service'; +import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; +import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; +import { SelectableListService } from 'src/app/shared/object-list/selectable-list/selectable-list.service'; +import { routeServiceStub } from 'src/app/shared/testing/route-service.stub'; +import { ThemeService } from 'src/app/shared/theme-support/theme.service'; -import { APP_CONFIG } from '../../../config/app-config.interface'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../config/app-config.interface'; import { BrowseService } from '../../core/browse/browse.service'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { SortDirection } from '../../core/cache/models/sort-options.model'; @@ -38,17 +53,6 @@ import { PaginationComponentOptions } from '../../shared/pagination/pagination-c import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { APP_CONFIG } from '../../../config/app-config.interface'; -import { RouteService } from 'src/app/core/services/route.service'; -import { routeServiceStub } from 'src/app/shared/testing/route-service.stub'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ThemeService } from 'src/app/shared/theme-support/theme.service'; -import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; -import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; -import { DsoEditMenuComponent } from 'src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { SelectableListService } from 'src/app/shared/object-list/selectable-list/selectable-list.service'; -import { HostWindowService } from 'src/app/shared/host-window.service'; -import { cold } from 'jasmine-marbles'; import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { @@ -136,7 +140,7 @@ describe('BrowseByMetadataComponent', () => { BrowseByMetadataComponent, EnumKeysPipe, VarDirective, - NoopAnimationsModule + NoopAnimationsModule, ], providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, @@ -154,8 +158,8 @@ describe('BrowseByMetadataComponent', () => { }) .overrideComponent(BrowseByMetadataPageComponent, { remove: { - imports: [ThemedLoadingComponent, DsoEditMenuComponent] - } + imports: [ThemedLoadingComponent, DsoEditMenuComponent], + }, }) .compileComponents(); })); diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index 0d26d2bda4..a64234c270 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -1,90 +1,114 @@ import { - BehaviorSubject, - combineLatest as observableCombineLatest, - Observable, - of as observableOf, - Subscription -} from 'rxjs'; -import { Component, Inject, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; -import { RemoteData } from '../../core/data/remote-data'; -import { PaginatedList } from '../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { ActivatedRoute, Params, Router } from '@angular/router'; -import { hasValue, isNotEmpty } from '../../shared/empty.util'; + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + Inject, Inject, Input, + Input, + OnChanges, OnChanges, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + Params, Params, Router, + Router, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + combineLatest as observableCombineLatest, combineLatest as observableCombineLatest, Observable, + Observable, + of as observableOf, of as observableOf, Subscription, + Subscription, } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + map, + map, +} from 'rxjs/operators'; +import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../config/app-config.interface'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { BrowseService } from '../../core/browse/browse.service'; import { BrowseEntrySearchOptions } from '../../core/browse/browse-entry-search-options.model'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; -import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { PaginatedList } from '../../core/data/paginated-list.model'; -import { RemoteData } from '../../core/data/remote-data'; -import { PaginationService } from '../../core/pagination/pagination.service'; +import { + DSpaceObjectDataService, + DSpaceObjectDataService, +} from '../../core/data/dspace-object-data.service'; +import { + PaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; +import { + RemoteData, + RemoteData, +} from '../../core/data/remote-data'; +import { + PaginationService, + PaginationService, +} from '../../core/pagination/pagination.service'; import { BrowseEntry } from '../../core/shared/browse-entry.model'; -import { Context } from '../../core/shared/context.model'; +import { + Context, + Context, +} from '../../core/shared/context.model'; import { Item } from '../../core/shared/item.model'; import { getFirstSucceededRemoteData } from '../../core/shared/operators'; -import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { map } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { - ThemedComcolPageBrowseByComponent -} from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedBrowseByComponent } from 'src/app/shared/browse-by/themed-browse-by.component'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { Context } from '../../core/shared/context.model'; -import { StartsWithType } from '../../shared/starts-with/starts-with-type'; -import { + hasValue, hasValue, isNotEmpty, + isNotEmpty, } from '../../shared/empty.util'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../shared/pagination/pagination-component-options.model'; import { StartsWithType } from '../../shared/starts-with/starts-with-decorator'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; +import { StartsWithType } from '../../shared/starts-with/starts-with-type'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { + BrowseByDataType, + BrowseByDataType, +} from '../browse-by-switcher/browse-by-data-type'; export const BBM_PAGINATION_ID = 'bbm'; @@ -105,9 +129,9 @@ export const BBM_PAGINATION_ID = 'bbm'; BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent + ThemedBrowseByComponent, ], - standalone: true + standalone: true, }) /** * Component for browsing (items) by metadata definition. diff --git a/src/app/browse-by/browse-by-page-routes.ts b/src/app/browse-by/browse-by-page-routes.ts index cf9a61f4ab..5af4d5942c 100644 --- a/src/app/browse-by/browse-by-page-routes.ts +++ b/src/app/browse-by/browse-by-page-routes.ts @@ -1,8 +1,9 @@ import { Route } from '@angular/router'; -import { BrowseByGuard } from './browse-by-guard'; -import { BrowseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver'; -import { BrowseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver'; + import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { BrowseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver'; +import { BrowseByGuard } from './browse-by-guard'; +import { BrowseByI18nBreadcrumbResolver } from './browse-by-i18n-breadcrumb.resolver'; import { BrowseByPageComponent } from './browse-by-page/browse-by-page.component'; export const ROUTES: Route[] = [ @@ -10,11 +11,11 @@ export const ROUTES: Route[] = [ path: '', resolve: { breadcrumb: BrowseByDSOBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, providers: [ BrowseByI18nBreadcrumbResolver, - BrowseByDSOBreadcrumbResolver + BrowseByDSOBreadcrumbResolver, ], children: [ { @@ -22,7 +23,7 @@ export const ROUTES: Route[] = [ component: BrowseByPageComponent, canActivate: [BrowseByGuard], resolve: { breadcrumb: BrowseByI18nBreadcrumbResolver }, - data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' } - } - ] + data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' }, + }, + ], }]; diff --git a/src/app/browse-by/browse-by-page.module.ts b/src/app/browse-by/browse-by-page.module.ts index d9efeb7f81..5a38822439 100644 --- a/src/app/browse-by/browse-by-page.module.ts +++ b/src/app/browse-by/browse-by-page.module.ts @@ -1,8 +1,7 @@ import { NgModule } from '@angular/core'; + import { ItemDataService } from '../core/data/item-data.service'; import { SharedBrowseByModule } from '../shared/browse-by/shared-browse-by.module'; -import { SharedModule } from '../shared/shared.module'; -import { BrowseByModule } from './browse-by.module'; import { BrowseByGuard } from './browse-by-guard'; import { BrowseByPageComponent } from './browse-by-page/browse-by-page.component'; @@ -10,13 +9,13 @@ import { BrowseByPageComponent } from './browse-by-page/browse-by-page.component @NgModule({ imports: [ SharedBrowseByModule, - BrowseByPageComponent + BrowseByPageComponent, ], providers: [ ItemDataService, BrowseService, BrowseByGuard, - ] + ], }) export class BrowseByPageModule { diff --git a/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts b/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts index 475f5cc0b0..4f64ba3ad3 100644 --- a/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts +++ b/src/app/browse-by/browse-by-page/browse-by-page.component.spec.ts @@ -44,14 +44,14 @@ describe('BrowseByPageComponent', () => { themeService = getMockThemeService(); await TestBed.configureTestingModule({ - imports: [BrowseBySwitcherComponent, BrowseByPageComponent], - declarations: [DynamicComponentLoaderDirective], - providers: [ + imports: [BrowseBySwitcherComponent, BrowseByPageComponent], + declarations: [DynamicComponentLoaderDirective], + providers: [ BrowseByTestComponent, { provide: ActivatedRoute, useValue: activatedRoute }, { provide: ThemeService, useValue: themeService }, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(BrowseByPageComponent); component = fixture.componentInstance; diff --git a/src/app/browse-by/browse-by-page/browse-by-page.component.ts b/src/app/browse-by/browse-by-page/browse-by-page.component.ts index 7e9c9302af..1a204264d1 100644 --- a/src/app/browse-by/browse-by-page/browse-by-page.component.ts +++ b/src/app/browse-by/browse-by-page/browse-by-page.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, @@ -9,7 +10,6 @@ import { map } from 'rxjs/operators'; import { BrowseDefinition } from '../../core/shared/browse-definition.model'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; import { BrowseBySwitcherComponent } from '../browse-by-switcher/browse-by-switcher.component'; -import { AsyncPipe } from '@angular/common'; @Component({ selector: 'ds-browse-by-page', @@ -17,9 +17,9 @@ import { AsyncPipe } from '@angular/common'; styleUrls: ['./browse-by-page.component.scss'], imports: [ BrowseBySwitcherComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class BrowseByPageComponent implements OnInit { diff --git a/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts b/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts index 9e49a28256..2d83984a97 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-decorator.ts @@ -1,21 +1,22 @@ import { Component } from '@angular/core'; -import { hasNoValue } from '../../shared/empty.util'; + import { Context } from '../../core/shared/context.model'; import { GenericConstructor } from '../../core/shared/generic-constructor'; -import { hasNoValue } from '../../shared/empty.util'; import { + hasNoValue, + hasNoValue, +} from '../../shared/empty.util'; +import { + DEFAULT_THEME, DEFAULT_THEME, resolveTheme, + resolveTheme, } from '../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { BrowseByDataType } from './browse-by-data-type'; -import { BrowseByTitleComponent } from '../browse-by-title/browse-by-title.component'; -import { BrowseByMetadataComponent } from '../browse-by-metadata/browse-by-metadata.component'; import { BrowseByDateComponent } from '../browse-by-date/browse-by-date.component'; +import { BrowseByMetadataComponent } from '../browse-by-metadata/browse-by-metadata.component'; import { BrowseByTaxonomyComponent } from '../browse-by-taxonomy/browse-by-taxonomy.component'; -import { - DEFAULT_THEME, - resolveTheme -} from '../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { BrowseByTitleComponent } from '../browse-by-title/browse-by-title.component'; +import { BrowseByDataType } from './browse-by-data-type'; export const DEFAULT_BROWSE_BY_TYPE = BrowseByDataType.Metadata; export const DEFAULT_BROWSE_BY_CONTEXT = Context.Any; @@ -33,7 +34,7 @@ export const BROWSE_BY_DECORATOR_MAP = [BrowseByDataType.Date, new Map([[DEFAULT_BROWSE_BY_CONTEXT, new Map([[DEFAULT_THEME, BrowseByDateComponent]])]])], [BrowseByDataType.Metadata, new Map([[DEFAULT_BROWSE_BY_CONTEXT, new Map([[DEFAULT_THEME, BrowseByMetadataComponent]])]])], [BrowseByDataType.Hierarchy, new Map([[DEFAULT_BROWSE_BY_CONTEXT, new Map([[DEFAULT_THEME, BrowseByTaxonomyComponent]])]])], - [BrowseByDataType.Title, new Map([[DEFAULT_BROWSE_BY_CONTEXT, new Map([[DEFAULT_THEME, BrowseByTitleComponent]])]])] + [BrowseByDataType.Title, new Map([[DEFAULT_BROWSE_BY_CONTEXT, new Map([[DEFAULT_THEME, BrowseByTitleComponent]])]])], ]); /** diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts index 2abc478040..559d630b82 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts @@ -1,29 +1,36 @@ -import { BrowseBySwitcherComponent } from './browse-by-switcher.component'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { Component, SimpleChange } from '@angular/core'; -import { rendersBrowseBy } from './browse-by-decorator'; -import { ThemeService } from '../../shared/theme-support/theme.service'; import { Component, + Component, + SimpleChange, SimpleChange, } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { FlatBrowseDefinition } from '../../core/shared/flat-browse-definition.model'; import { NonHierarchicalBrowseDefinition } from '../../core/shared/non-hierarchical-browse-definition'; import { ValueListBrowseDefinition } from '../../core/shared/value-list-browse-definition.model'; -import { - DynamicComponentLoaderDirective -} from '../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { DynamicComponentLoaderDirective } from '../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../shared/theme-support/theme.service'; +import { + ThemeService, + ThemeService, +} from '../../shared/theme-support/theme.service'; import { BrowseByDataType } from './browse-by-data-type'; -import { rendersBrowseBy } from './browse-by-decorator'; -import { BrowseBySwitcherComponent } from './browse-by-switcher.component'; +import { + rendersBrowseBy, + rendersBrowseBy, +} from './browse-by-decorator'; +import { + BrowseBySwitcherComponent, + BrowseBySwitcherComponent, +} from './browse-by-switcher.component'; @rendersBrowseBy('BrowseBySwitcherComponent' as BrowseByDataType) @Component({ @@ -73,15 +80,15 @@ describe('BrowseBySwitcherComponent', () => { themeService = getMockThemeService(themeName); void TestBed.configureTestingModule({ - imports: [ + imports: [ BrowseBySwitcherComponent, DynamicComponentLoaderDirective, ], - providers: [ + providers: [ BrowseByTestComponent, { provide: ThemeService, useValue: themeService }, - ], -}).compileComponents(); + ], + }).compileComponents(); })); beforeEach(waitForAsync(() => { diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts index 0a385d8448..c1e3dae79f 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgComponentOutlet, +} from '@angular/common'; import { Component, Input, @@ -6,18 +10,15 @@ import { import { Context } from '../../core/shared/context.model'; import { GenericConstructor } from '../../core/shared/generic-constructor'; import { AbstractComponentLoaderComponent } from '../../shared/abstract-component-loader/abstract-component-loader.component'; +import { DynamicComponentLoaderDirective } from '../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { BrowseByDataType } from './browse-by-data-type'; import { getComponentByBrowseByType } from './browse-by-decorator'; -import { AsyncPipe, NgComponentOutlet } from '@angular/common'; -import { - DynamicComponentLoaderDirective -} from '../../shared/abstract-component-loader/dynamic-component-loader.directive'; @Component({ selector: 'ds-browse-by-switcher', templateUrl: '../../shared/abstract-component-loader/abstract-component-loader.component.html', imports: [AsyncPipe, NgComponentOutlet, DynamicComponentLoaderDirective], - standalone: true + standalone: true, }) export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent { diff --git a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.spec.ts b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.spec.ts index fe65e5aa5c..4401ba9506 100644 --- a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.spec.ts +++ b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.spec.ts @@ -9,8 +9,8 @@ import { BehaviorSubject } from 'rxjs'; import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; -import { ThemeService } from '../../shared/theme-support/theme.service'; import { VocabularyTreeviewComponent } from '../../shared/form/vocabulary-treeview/vocabulary-treeview.component'; +import { ThemeService } from '../../shared/theme-support/theme.service'; import { createDataWithBrowseDefinition } from '../browse-by-switcher/browse-by-switcher.component.spec'; import { BrowseByTaxonomyComponent } from './browse-by-taxonomy.component'; @@ -32,15 +32,15 @@ describe('BrowseByTaxonomyComponent', () => { }); await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), BrowseByTaxonomyComponent], - providers: [ + imports: [TranslateModule.forRoot(), BrowseByTaxonomyComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: ThemeService, useValue: themeService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(BrowseByTaxonomyPageComponent, { - remove: { imports: [VocabularyTreeviewComponent]} + remove: { imports: [VocabularyTreeviewComponent] }, }) .compileComponents(); }); diff --git a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts index 263ad6f883..b016766430 100644 --- a/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts +++ b/src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts @@ -1,54 +1,70 @@ -import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core'; -import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model'; -import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; -import { ActivatedRoute, Params, RouterLink } from '@angular/router'; -import { BehaviorSubject, Observable, Subscription } from 'rxjs'; -import { BrowseDefinition } from '../../core/shared/browse-definition.model'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + Input, Input, OnChanges, + OnChanges, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { + ActivatedRoute, ActivatedRoute, Params, + Params, + RouterLink, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { + BehaviorSubject, BehaviorSubject, Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { map } from 'rxjs/operators'; -import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; -import { VocabularyTreeviewComponent } from '../../shared/form/vocabulary-treeview/vocabulary-treeview.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { BrowseDefinition } from '../../core/shared/browse-definition.model'; +import { + BrowseDefinition, + BrowseDefinition, +} from '../../core/shared/browse-definition.model'; import { Context } from '../../core/shared/context.model'; -import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; -import { VocabularyEntryDetail } from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; -import { VocabularyOptions } from '../../core/submission/vocabularies/models/vocabulary-options.model'; -import { hasValue } from '../../shared/empty.util'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { + HierarchicalBrowseDefinition, + HierarchicalBrowseDefinition, +} from '../../core/shared/hierarchical-browse-definition.model'; +import { + VocabularyEntryDetail, + VocabularyEntryDetail, +} from '../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; +import { + VocabularyOptions, + VocabularyOptions, +} from '../../core/submission/vocabularies/models/vocabulary-options.model'; +import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { hasValue } from '../../shared/empty.util'; +import { VocabularyTreeviewComponent } from '../../shared/form/vocabulary-treeview/vocabulary-treeview.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { + BrowseByDataType, + BrowseByDataType, +} from '../browse-by-switcher/browse-by-data-type'; @Component({ selector: 'ds-browse-by-taxonomy', @@ -69,9 +85,9 @@ import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; ThemedLoadingComponent, ThemedBrowseByComponent, VocabularyTreeviewComponent, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * Component for browsing items by metadata in a hierarchical controlled vocabulary @@ -154,7 +170,7 @@ export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy { this.subs.push(this.browseDefinition$.subscribe((browseDefinition: HierarchicalBrowseDefinition) => { this.facetType = browseDefinition.facetType; this.vocabularyName = browseDefinition.vocabulary; - this.vocabularyOptions = {name: this.vocabularyName, closed: true}; + this.vocabularyOptions = { name: this.vocabularyName, closed: true }; })); this.subs.push(this.scope$.subscribe(() => { this.updateQueryParams(); diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts index c7704a6095..49eb84971a 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts @@ -1,53 +1,64 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Item } from '../../core/shared/item.model'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { of as observableOf } from 'rxjs'; -import { AsyncPipe, CommonModule } from '@angular/common'; -import { CommonModule } from '@angular/common'; +import { + AsyncPipe, + CommonModule, + CommonModule, +} from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; -import { APP_CONFIG } from '../../../config/app-config.interface'; -import { environment } from '../../../environments/environment'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../config/app-config.interface'; +import { + environment, + environment, +} from '../../../environments/environment'; import { BrowseService } from '../../core/browse/browse.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { PaginationService } from '../../core/pagination/pagination.service'; import { Community } from '../../core/shared/community.model'; -import { Item } from '../../core/shared/item.model'; -import { RouterMock } from '../../shared/mocks/router.mock'; -import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { APP_CONFIG } from '../../../config/app-config.interface'; -import { environment } from '../../../environments/environment'; +import { + Item, + Item, +} from '../../core/shared/item.model'; +import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; - +import { RouterMock } from '../../shared/mocks/router.mock'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; +import { + ActivatedRouteStub, + ActivatedRouteStub, +} from '../../shared/testing/active-router.stub'; +import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { toRemoteData } from '../browse-by-metadata/browse-by-metadata.component.spec'; @@ -99,29 +110,29 @@ describe('BrowseByTitleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BrowseByTitleComponent, EnumKeysPipe, VarDirective, AsyncPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BrowseByTitleComponent, EnumKeysPipe, VarDirective, AsyncPipe], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: BrowseService, useValue: mockBrowseService }, { provide: DSpaceObjectDataService, useValue: mockDsoService }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: new RouterMock() }, { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(BrowseByTitlePageComponent, { - remove: {imports: [ - ComcolPageHeaderComponent, - ComcolPageLogoComponent, - ThemedComcolPageHandleComponent, - ComcolPageContentComponent, - DsoEditMenuComponent, - ThemedComcolPageBrowseByComponent, - BrowseByComponent, - ThemedLoadingComponent, - ThemedBrowseByComponent - ]} + remove: { imports: [ + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + ThemedComcolPageHandleComponent, + ComcolPageContentComponent, + DsoEditMenuComponent, + ThemedComcolPageBrowseByComponent, + BrowseByComponent, + ThemedLoadingComponent, + ThemedBrowseByComponent, + ] }, }) .compileComponents(); })); diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.ts index 3263599991..1fd604f06d 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -1,42 +1,44 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, } from '@angular/core'; import { Params } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + map, + map, +} from 'rxjs/operators'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; +import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; +import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../shared/pagination/pagination-component-options.model'; +import { VarDirective } from '../../shared/utils/var.directive'; import { BrowseByMetadataComponent, browseParamsToOptions, getBrowseSearchOptions, } from '../browse-by-metadata/browse-by-metadata.component'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { map } from 'rxjs/operators'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ComcolPageHeaderComponent } from '../../shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageContentComponent } from '../../shared/comcol/comcol-page-content/comcol-page-content.component'; -import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { BrowseByComponent } from '../../shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedBrowseByComponent } from '../../shared/browse-by/themed-browse-by.component'; -import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; -import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; @Component({ selector: 'ds-browse-by-title', @@ -56,8 +58,8 @@ import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) /** * Component for browsing items by title (dc.title) diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index 3b74332bf9..ecda354ae4 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -1,17 +1,36 @@ -import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChange, SimpleChanges } from '@angular/core'; - -import { Observable } from 'rxjs'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Input, + OnChanges, + OnInit, + SimpleChange, + SimpleChanges, +} from '@angular/core'; import { DynamicFormControlModel, DynamicFormOptionConfig, DynamicFormService, DynamicSelectModel, } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Observable } from 'rxjs'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + Observable, +} from 'rxjs'; import { hasNoValue, + hasNoValue, + isNotNull, isNotNull, } from 'src/app/shared/empty.util'; @@ -22,22 +41,22 @@ import { EntityTypeDataService } from '../../core/data/entity-type-data.service' import { RequestService } from '../../core/data/request.service'; import { Collection } from '../../core/shared/collection.model'; import { ItemType } from '../../core/shared/item-relationships/item-type.model'; -import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; +import { + NONE_ENTITY_TYPE, + NONE_ENTITY_TYPE, +} from '../../core/shared/item-relationships/item-type.resource-type'; import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; -import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models'; -import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; -import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; -import { FormComponent } from '../../shared/form/form.component'; -import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { VarDirective } from '../../shared/utils/var.directive'; - import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; +import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { FormComponent } from '../../shared/form/form.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; +import { VarDirective } from '../../shared/utils/var.directive'; import { collectionFormEntityTypeSelectionConfig, + collectionFormEntityTypeSelectionConfig, + collectionFormModels, collectionFormModels, } from './collection-form.models'; @@ -57,7 +76,7 @@ import { ComcolPageLogoComponent, NgIf, NgClass, - VarDirective + VarDirective, ], }) export class CollectionFormComponent extends ComColFormComponent implements OnInit, OnChanges { diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts index acfceb2e9a..ea2535e705 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts @@ -25,7 +25,10 @@ import { } from '../../core/cache/models/sort-options.model'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { GroupDataService } from '../../core/eperson/group-data.service'; @@ -35,6 +38,7 @@ import { Collection } from '../../core/shared/collection.model'; import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { ErrorComponent } from '../../shared/error/error.component'; import { HostWindowService } from '../../shared/host-window.service'; @@ -49,8 +53,6 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; -import { createPaginatedList } from '../../shared/testing/utils.test'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; import { SearchFormComponent } from '../../shared/search-form/search-form.component'; import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub'; @@ -59,11 +61,13 @@ import { ObjectSelectServiceStub } from '../../shared/testing/object-select-serv import { RouterStub } from '../../shared/testing/router.stub'; import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub'; import { SearchServiceStub } from '../../shared/testing/search-service.stub'; -import { createPaginatedList } from '../../shared/testing/utils.test'; +import { + createPaginatedList, + createPaginatedList, +} from '../../shared/testing/utils.test'; import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { CollectionItemMapperComponent } from './collection-item-mapper.component'; -import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; describe('CollectionItemMapperComponent', () => { let comp: CollectionItemMapperComponent; @@ -185,8 +189,8 @@ describe('CollectionItemMapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, CollectionItemMapperComponent, ItemSelectComponent, SearchFormComponent, PaginationComponent, EnumKeysPipe, VarDirective, ErrorComponent, LoadingComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, CollectionItemMapperComponent, ItemSelectComponent, SearchFormComponent, PaginationComponent, EnumKeysPipe, VarDirective, ErrorComponent, LoadingComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useValue: routerStub }, { provide: SearchConfigurationService, useValue: searchConfigServiceStub }, @@ -203,7 +207,7 @@ describe('CollectionItemMapperComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, ], -}).overrideComponent(CollectionItemMapperComponent, { + }).overrideComponent(CollectionItemMapperComponent, { set: { providers: [ { diff --git a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts index 85f7d07464..d74b050afe 100644 --- a/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts +++ b/src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -9,7 +13,12 @@ import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -25,17 +34,37 @@ import { import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { ItemDataService } from '../../core/data/item-data.service'; +import { + CollectionDataService, + CollectionDataService, +} from '../../core/data/collection-data.service'; +import { + FeatureID, + FeatureID, +} from '../../core/data/feature-authorization/feature-id'; +import { + ItemDataService, + ItemDataService, +} from '../../core/data/item-data.service'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { Collection } from '../../core/shared/collection.model'; -import { DSpaceObject } from '../../core/shared/dspace-object.model'; -import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; -import { NoContent } from '../../core/shared/NoContent.model'; +import { + DSpaceObject, + DSpaceObject, +} from '../../core/shared/dspace-object.model'; +import { + DSpaceObjectType, + DSpaceObjectType, +} from '../../core/shared/dspace-object-type.model'; +import { + NoContent, + NoContent, +} from '../../core/shared/NoContent.model'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, @@ -43,32 +72,26 @@ import { getRemoteDataPayload, toDSpaceObjectListRD, } from '../../core/shared/operators'; -import { DSpaceObject } from '../../core/shared/dspace-object.model'; -import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { ItemDataService } from '../../core/data/item-data.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { isNotEmpty } from '../../shared/empty.util'; import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { fadeIn, fadeInOut, } from '../../shared/animations/fade'; -import { isNotEmpty } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; -import { followLink } from '../../shared/utils/follow-link-config.model'; -import { NoContent } from '../../core/shared/NoContent.model'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { ThemedSearchFormComponent } from '../../shared/search-form/themed-search-form.component'; -import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { + isNotEmpty, + isNotEmpty, +} from '../../shared/empty.util'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; import { ItemSelectComponent } from '../../shared/object-select/item-select/item-select.component'; -import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; +import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; +import { ThemedSearchFormComponent } from '../../shared/search-form/themed-search-form.component'; +import { followLink } from '../../shared/utils/follow-link-config.model'; @Component({ selector: 'ds-collection-item-mapper', @@ -82,8 +105,8 @@ import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configurat providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], imports: [ ThemedSearchFormComponent, @@ -91,9 +114,9 @@ import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configurat TranslateModule, AsyncPipe, ItemSelectComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component used to map items to a collection diff --git a/src/app/collection-page/collection-page-routes.ts b/src/app/collection-page/collection-page-routes.ts index 9ff7a424c1..93b6446bf3 100644 --- a/src/app/collection-page/collection-page-routes.ts +++ b/src/app/collection-page/collection-page-routes.ts @@ -1,30 +1,31 @@ -import { CollectionPageResolver } from './collection-page.resolver'; -import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component'; -import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard'; -import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; -import { - ThemedEditItemTemplatePageComponent -} from './edit-item-template-page/themed-edit-item-template-page.component'; -import { ItemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver'; -import { CollectionBreadcrumbResolver } from '../core/breadcrumbs/collection-breadcrumb.resolver'; -import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; -import { LinkService } from '../core/cache/builders/link.service'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { COLLECTION_CREATE_PATH, COLLECTION_EDIT_PATH, ITEMTEMPLATE_PATH } from './collection-page-routing-paths'; -import { CollectionPageAdministratorGuard } from './collection-page-administrator.guard'; -import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; -import { ThemedCollectionPageComponent } from './themed-collection-page.component'; -import { MenuItemType } from '../shared/menu/menu-item-type.model'; -import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; import { Route } from '@angular/router'; -import { - ComcolSearchSectionComponent -} from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; -import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; + import { BrowseByGuard } from '../browse-by/browse-by-guard'; import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; +import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { CollectionBreadcrumbResolver } from '../core/breadcrumbs/collection-breadcrumb.resolver'; +import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { LinkService } from '../core/cache/builders/link.service'; import { SearchService } from '../core/shared/search/search.service'; +import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; +import { ComcolSearchSectionComponent } from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; +import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; +import { MenuItemType } from '../shared/menu/menu-item-type.model'; +import { CollectionPageResolver } from './collection-page.resolver'; +import { CollectionPageAdministratorGuard } from './collection-page-administrator.guard'; +import { + COLLECTION_CREATE_PATH, + COLLECTION_EDIT_PATH, + ITEMTEMPLATE_PATH, +} from './collection-page-routing-paths'; +import { CreateCollectionPageComponent } from './create-collection-page/create-collection-page.component'; +import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard'; +import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; +import { ItemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver'; +import { ThemedEditItemTemplatePageComponent } from './edit-item-template-page/themed-edit-item-template-page.component'; +import { ThemedCollectionPageComponent } from './themed-collection-page.component'; export const ROUTES: Route[] = [ @@ -40,15 +41,15 @@ export const ROUTES: Route[] = [ LinkService, CreateCollectionPageGuard, CollectionPageAdministratorGuard, - SearchService - ] + SearchService, + ], }, { path: ':id', resolve: { dso: CollectionPageResolver, breadcrumb: CollectionBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, providers: [ CollectionPageResolver, @@ -58,7 +59,7 @@ export const ROUTES: Route[] = [ LinkService, CreateCollectionPageGuard, CollectionPageAdministratorGuard, - SearchService + SearchService, ], runGuardsAndResolvers: 'always', children: [ @@ -66,7 +67,7 @@ export const ROUTES: Route[] = [ path: COLLECTION_EDIT_PATH, loadChildren: () => import('./edit-collection-page/edit-collection-page-routes') .then((m) => m.ROUTES), - canActivate: [CollectionPageAdministratorGuard] + canActivate: [CollectionPageAdministratorGuard], }, { path: 'delete', @@ -80,9 +81,9 @@ export const ROUTES: Route[] = [ canActivate: [AuthenticatedGuard], resolve: { item: ItemTemplatePageResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: { title: 'collection.edit.template.title', breadcrumbKey: 'collection.edit.template' } + data: { title: 'collection.edit.template.title', breadcrumbKey: 'collection.edit.template' }, }, { path: '', @@ -104,7 +105,7 @@ export const ROUTES: Route[] = [ data: { breadcrumbKey: 'browse.metadata' }, }, ], - } + }, ], data: { menu: { diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index b283dd763a..28bd5eb44e 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -1,5 +1,18 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router, RouterOutlet } from '@angular/router'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterOutlet, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { filter, @@ -9,12 +22,18 @@ import { } from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; -import { DSONameService } from '../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../core/breadcrumbs/dso-name.service'; import { SortOptions } from '../core/cache/models/sort-options.model'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { RemoteData } from '../core/data/remote-data'; -import { redirectOn4xx } from '../core/shared/authorized.operators'; +import { + redirectOn4xx, + redirectOn4xx, +} from '../core/shared/authorized.operators'; import { Bitstream } from '../core/shared/bitstream.model'; import { Collection } from '../core/shared/collection.model'; import { getAllSucceededRemoteDataPayload } from '../core/shared/operators'; @@ -22,31 +41,23 @@ import { fadeIn, fadeInOut, } from '../shared/animations/fade'; +import { ThemedComcolPageBrowseByComponent } from '../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { hasValue, isNotEmpty, } from '../shared/empty.util'; -import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; -import { getCollectionPageRoute } from './collection-page-routing-paths'; -import { redirectOn4xx } from '../core/shared/authorized.operators'; -import { DSONameService } from '../core/breadcrumbs/dso-name.service'; -import { ComcolPageContentComponent } from '../shared/comcol/comcol-page-content/comcol-page-content.component'; import { ErrorComponent } from '../shared/error/error.component'; -import { AsyncPipe, NgIf } from '@angular/common'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; -import { VarDirective } from '../shared/utils/var.directive'; -import { ComcolPageHeaderComponent } from '../shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { DsoEditMenuComponent } from '../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { ObjectCollectionComponent } from '../shared/object-collection/object-collection.component'; +import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; +import { VarDirective } from '../shared/utils/var.directive'; +import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; +import { getCollectionPageRoute } from './collection-page-routing-paths'; @Component({ selector: 'ds-collection-page', @@ -55,7 +66,7 @@ import { ObjectCollectionComponent } from '../shared/object-collection/object-co changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut + fadeInOut, ], imports: [ ComcolPageContentComponent, @@ -72,9 +83,9 @@ import { ObjectCollectionComponent } from '../shared/object-collection/object-co DsoEditMenuComponent, ThemedComcolPageBrowseByComponent, ObjectCollectionComponent, - RouterOutlet + RouterOutlet, ], - standalone: true + standalone: true, }) export class CollectionPageComponent implements OnInit { collectionRD$: Observable>; diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts index 064437215f..eb850d5ccb 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts @@ -1,7 +1,5 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { RouteService } from '../../core/services/route.service'; -import { CollectionDataService } from '../../core/data/collection-data.service'; import { ComponentFixture, TestBed, @@ -12,18 +10,23 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { CollectionDataService } from '../../core/data/collection-data.service'; +import { + CollectionDataService, + CollectionDataService, +} from '../../core/data/collection-data.service'; import { CommunityDataService } from '../../core/data/community-data.service'; import { RequestService } from '../../core/data/request.service'; -import { RouteService } from '../../core/services/route.service'; -import { DSONameServiceMock } from '../../shared/mocks/dso-name.service.mock'; -import { AuthService } from '../../core/auth/auth.service'; +import { + RouteService, + RouteService, +} from '../../core/services/route.service'; import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; -import { CollectionFormComponent } from '../collection-form/collection-form.component'; +import { DSONameServiceMock } from '../../shared/mocks/dso-name.service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { SharedModule } from '../../shared/shared.module'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; +import { CollectionFormComponent } from '../collection-form/collection-form.component'; import { CreateCollectionPageComponent } from './create-collection-page.component'; describe('CreateCollectionPageComponent', () => { @@ -50,8 +53,8 @@ describe('CreateCollectionPageComponent', () => { }) .overrideComponent(CreateCollectionPageComponent, { remove: { - imports: [CollectionFormComponent] - } + imports: [CollectionFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/collection-page/create-collection-page/create-collection-page.component.ts b/src/app/collection-page/create-collection-page/create-collection-page.component.ts index 213c2523d5..54a5d108e5 100644 --- a/src/app/collection-page/create-collection-page/create-collection-page.component.ts +++ b/src/app/collection-page/create-collection-page/create-collection-page.component.ts @@ -1,20 +1,27 @@ +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { CommunityDataService } from '../../core/data/community-data.service'; -import { RequestService } from '../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { RouteService } from '../../core/services/route.service'; import { Collection } from '../../core/shared/collection.model'; import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { RequestService } from '../../core/data/request.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { CollectionFormComponent } from '../collection-form/collection-form.component'; -import { AsyncPipe } from '@angular/common'; /** * Component that represents the page where a user can create a new Collection @@ -26,9 +33,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ CollectionFormComponent, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CreateCollectionPageComponent extends CreateComColPageComponent { protected frontendURL = '/collections/'; diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts index 6a26822f06..7b9c4fa7bf 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts @@ -1,16 +1,22 @@ -import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -18,7 +24,6 @@ import { CollectionDataService } from '../../core/data/collection-data.service'; import { RequestService } from '../../core/data/request.service'; import { DSONameServiceMock } from '../../shared/mocks/dso-name.service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { SharedModule } from '../../shared/shared.module'; import { DeleteCollectionPageComponent } from './delete-collection-page.component'; describe('DeleteCollectionPageComponent', () => { @@ -27,16 +32,16 @@ describe('DeleteCollectionPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, DeleteCollectionPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, DeleteCollectionPageComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CollectionDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, { provide: RequestService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts index 4fa155b1f3..b4f55bb4ce 100644 --- a/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts +++ b/src/app/collection-page/delete-collection-page/delete-collection-page.component.ts @@ -1,23 +1,38 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { DeleteComColPageComponent } from '../../shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { Collection } from '../../core/shared/collection.model'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { + CollectionDataService, + CollectionDataService, +} from '../../core/data/collection-data.service'; +import { + Collection, + Collection, +} from '../../core/shared/collection.model'; +import { + DeleteComColPageComponent, + DeleteComColPageComponent, +} from '../../shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; import { VarDirective } from '../../shared/utils/var.directive'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { Collection } from '../../core/shared/collection.model'; -import { DeleteComColPageComponent } from '../../shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; /** * Component that represents the page where a user can delete an existing Collection @@ -30,9 +45,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s TranslateModule, AsyncPipe, NgIf, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class DeleteCollectionPageComponent extends DeleteComColPageComponent { protected frontendURL = '/collections/'; diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts index e69eaab200..274a78c77d 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts @@ -2,20 +2,20 @@ import { ComponentFixture, TestBed, } from '@angular/core/testing'; -import { ActivatedRoute } from '@angular/router'; +import { + ActivatedRoute, + ActivatedRoute, +} from '@angular/router'; import { of as observableOf, of, + of, } from 'rxjs'; import { Community } from '../../../core/shared/community.model'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { CollectionAccessControlComponent } from './collection-access-control.component'; -import { ActivatedRoute } from '@angular/router'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; -import { of } from 'rxjs'; describe('CollectionAccessControlComponent', () => { let component: CollectionAccessControlComponent; @@ -53,25 +53,25 @@ describe('CollectionAccessControlComponent', () => { return { pipe: () => { return of({}); - } + }, }; - } - } - } - } + }, + }, + }, + }, }; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [CollectionAccessControlComponent], providers: [{ - provide: ActivatedRoute, useValue: routeStub - }] + provide: ActivatedRoute, useValue: routeStub, + }], }) .overrideComponent(CollectionAccessControlComponent, { remove: { - imports: [AccessControlFormContainerComponent] - } + imports: [AccessControlFormContainerComponent], + }, }) .compileComponents(); }); diff --git a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts index 2547f95f51..809fdcede8 100644 --- a/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -9,10 +13,7 @@ import { map } from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @Component({ selector: 'ds-collection-access-control', @@ -21,9 +22,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; imports: [ AccessControlFormContainerComponent, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CollectionAccessControlComponent implements OnInit { itemRD$: Observable>; diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts index e021e3f680..3ee3f1c6b0 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts @@ -44,19 +44,19 @@ describe('CollectionAuthorizationsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, - CollectionAuthorizationsComponent - ], - providers: [ + CollectionAuthorizationsComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, CollectionAuthorizationsComponent, - ], - schemas: [NO_ERRORS_SCHEMA] -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(CollectionAuthorizationsComponent, { - remove: { imports: [ResourcePoliciesComponent] } + remove: { imports: [ResourcePoliciesComponent] }, }) .compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts index 88568d3eb4..31824b7be8 100644 --- a/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, @@ -12,16 +13,15 @@ import { import { RemoteData } from '../../../core/data/remote-data'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; -import { AsyncPipe } from '@angular/common'; @Component({ selector: 'ds-collection-authorizations', templateUrl: './collection-authorizations.component.html', imports: [ ResourcePoliciesComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component that handles the Collection Authorizations diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts index e08eeddd24..b10131e4f4 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts @@ -12,8 +12,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { CurationFormComponent } from '../../../curation-form/curation-form.component'; import { Collection } from '../../../core/shared/collection.model'; +import { CurationFormComponent } from '../../../curation-form/curation-form.component'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { CollectionCurateComponent } from './collection-curate.component'; @@ -43,15 +43,15 @@ describe('CollectionCurateComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CollectionCurateComponent], - providers: [ + imports: [TranslateModule.forRoot(), CollectionCurateComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: DSONameService, useValue: dsoNameService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .overrideComponent(CollectionCurateComponent, { - remove: { imports: [CurationFormComponent]} + remove: { imports: [CurationFormComponent] }, }) .compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts index d42655b58e..14ba01421b 100644 --- a/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.ts @@ -1,5 +1,7 @@ +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { filter, @@ -10,10 +12,8 @@ import { import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Collection } from '../../../core/shared/collection.model'; -import { hasValue } from '../../../shared/empty.util'; import { CurationFormComponent } from '../../../curation-form/curation-form.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe } from '@angular/common'; +import { hasValue } from '../../../shared/empty.util'; /** * Component for managing a collection's curation tasks @@ -24,9 +24,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ CurationFormComponent, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CollectionCurateComponent { dsoRD$: Observable>; diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts index 040c1d3e0b..da033b8796 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts @@ -1,10 +1,11 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { @@ -13,28 +14,29 @@ import { Router, } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; +import { AuthService } from '../../../core/auth/auth.service'; +import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; +import { CommunityDataService } from '../../../core/data/community-data.service'; import { ItemTemplateDataService } from '../../../core/data/item-template-data.service'; import { RequestService } from '../../../core/data/request.service'; -import { - Collection } from '../../../core/shared/collection.model'; +import { Collection } from '../../../core/shared/collection.model'; import { Item } from '../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../shared/mocks/auth.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ -, + , } from '../../../shared/remote-data.utils'; -import { SharedModule } from '../../../shared/shared.module'; import { getCollectionItemTemplateRoute } from '../../collection-page-routing-paths'; -import { AuthServiceMock } from '../../../shared/mocks/auth.service.mock'; -import { AuthService } from '../../../core/auth/auth.service'; -import { CommunityDataService } from '../../../core/data/community-data.service'; -import { ObjectCacheService } from '../../../core/cache/object-cache.service'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { CollectionMetadataComponent } from './collection-metadata.component'; describe('CollectionMetadataComponent', () => { @@ -80,8 +82,8 @@ describe('CollectionMetadataComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, CollectionMetadataComponent], - providers: [ + imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, CollectionMetadataComponent], + providers: [ { provide: CollectionDataService, useValue: {} }, { provide: ItemTemplateDataService, useValue: itemTemplateServiceStub }, { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, @@ -92,9 +94,9 @@ describe('CollectionMetadataComponent', () => { { provide: CommunityDataService, useValue: {} }, { provide: ObjectCacheService, useValue: {} }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts index bb8139cc3f..dee9ebe6e5 100644 --- a/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -5,43 +9,55 @@ import { } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + NavigationEnd, NavigationEnd, Router, + Router, + RouterLink, + Scroll, Scroll, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest as combineLatestObservable, Observable, } from 'rxjs'; import { map, + map, + switchMap, switchMap, } from 'rxjs/operators'; import { CollectionDataService } from '../../../core/data/collection-data.service'; -import { ActivatedRoute, NavigationEnd, Router, RouterLink, Scroll } from '@angular/router'; import { ItemTemplateDataService } from '../../../core/data/item-template-data.service'; import { RemoteData } from '../../../core/data/remote-data'; -import { Item } from '../../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; -import { map, switchMap } from 'rxjs/operators'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { RequestService } from '../../../core/data/request.service'; import { Collection } from '../../../core/shared/collection.model'; -import { Item } from '../../../core/shared/item.model'; +import { + Item, + Item, +} from '../../../core/shared/item.model'; import { NoContent } from '../../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData, + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; import { ComcolMetadataComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component'; import { hasValue } from '../../../shared/empty.util'; -import { CollectionFormComponent } from '../../collection-form/collection-form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; import { VarDirective } from '../../../shared/utils/var.directive'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { CollectionFormComponent } from '../../collection-form/collection-form.component'; import { getCollectionItemTemplateRoute } from '../../collection-page-routing-paths'; /** @@ -56,9 +72,9 @@ import { getCollectionItemTemplateRoute } from '../../collection-page-routing-pa AsyncPipe, TranslateModule, NgIf, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class CollectionMetadataComponent extends ComcolMetadataComponent implements OnInit { protected frontendURL = '/collections/'; diff --git a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts index 3616f8c8c1..f6c4ad565e 100644 --- a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts @@ -1,40 +1,52 @@ import { DebugElement, + DebugElement, + NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA, } from '@angular/core'; import { ComponentFixture, TestBed, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { + By, + By, +} from '@angular/platform-browser'; +import { + NoopAnimationsModule, + NoopAnimationsModule, +} from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core'; -import { By } from '@angular/platform-browser'; -import { CollectionRolesComponent } from './collection-roles.component'; -import { Collection } from '../../../core/shared/collection.model'; -import { GroupDataService } from '../../../core/eperson/group-data.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../core/data/request.service'; -import { RouterTestingModule } from '@angular/router/testing'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { Collection } from '../../../core/shared/collection.model'; -import { ComcolModule } from '../../../shared/comcol/comcol.module'; +import { + GroupDataService, + GroupDataService, +} from '../../../core/eperson/group-data.service'; +import { + Collection, + Collection, +} from '../../../core/shared/collection.model'; import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; -import { SharedModule } from '../../../shared/shared.module'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; -import { CollectionRolesComponent } from './collection-roles.component'; +import { + CollectionRolesComponent, + CollectionRolesComponent, +} from './collection-roles.component'; describe('CollectionRolesComponent', () => { @@ -87,21 +99,21 @@ describe('CollectionRolesComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NoopAnimationsModule, - CollectionRolesComponent - ], - providers: [ + CollectionRolesComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: RequestService, useValue: requestService }, { provide: GroupDataService, useValue: groupDataService }, { provide: NotificationsService, useClass: NotificationsServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); fixture = TestBed.createComponent(CollectionRolesComponent); comp = fixture.componentInstance; diff --git a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts index 7a87958266..f402c99caf 100644 --- a/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgForOf, +} from '@angular/common'; import { Component, OnInit, @@ -16,11 +20,8 @@ import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { ComcolRoleComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component'; import { hasValue } from '../../../shared/empty.util'; -import { - ComcolRoleComponent -} from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component'; -import { AsyncPipe, NgForOf } from '@angular/common'; /** * Component for managing a collection's roles @@ -31,9 +32,9 @@ import { AsyncPipe, NgForOf } from '@angular/common'; imports: [ ComcolRoleComponent, NgForOf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CollectionRolesComponent implements OnInit { diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts index b7da4a21f2..0caf9b0418 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts @@ -104,8 +104,8 @@ describe('CollectionSourceControlsComponent', () => { requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceControlsComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceControlsComponent, VarDirective], + providers: [ { provide: ScriptDataService, useValue: scriptDataService }, { provide: ProcessDataService, useValue: processDataService }, { provide: RequestService, useValue: requestService }, @@ -113,9 +113,9 @@ describe('CollectionSourceControlsComponent', () => { { provide: CollectionDataService, useValue: collectionService }, { provide: HttpClient, useValue: httpClient }, { provide: BitstreamDataService, useValue: bitstreamService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(CollectionSourceControlsComponent); diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts index a377daa28d..bca290311d 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts @@ -1,11 +1,22 @@ -import { HttpClient } from '@angular/common/http'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + HttpClient, + HttpClient, +} from '@angular/common/http'; import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -18,31 +29,38 @@ import { tap, } from 'rxjs/operators'; -import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { CollectionDataService } from '../../../../core/data/collection-data.service'; +import { + BitstreamDataService, + BitstreamDataService, +} from '../../../../core/data/bitstream-data.service'; +import { + CollectionDataService, + CollectionDataService, +} from '../../../../core/data/collection-data.service'; import { ProcessDataService } from '../../../../core/data/processes/process-data.service'; import { ScriptDataService } from '../../../../core/data/processes/script-data.service'; import { RequestService } from '../../../../core/data/request.service'; -import { Collection } from '../../../../core/shared/collection.model'; +import { + Collection, + Collection, +} from '../../../../core/shared/collection.model'; import { ContentSource } from '../../../../core/shared/content-source.model'; -import { ContentSourceSetSerializer } from '../../../../core/shared/content-source-set-serializer'; +import { + ContentSourceSetSerializer, + ContentSourceSetSerializer, +} from '../../../../core/shared/content-source-set-serializer'; import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../../core/shared/operators'; -import { Process } from '../../../../process-page/processes/process.model'; +import { + Process, + Process, +} from '../../../../process-page/processes/process.model'; import { ProcessStatus } from '../../../../process-page/processes/process-status.model'; import { hasValue } from '../../../../shared/empty.util'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { Collection } from '../../../../core/shared/collection.model'; -import { CollectionDataService } from '../../../../core/data/collection-data.service'; -import { Process } from '../../../../process-page/processes/process.model'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { HttpClient } from '@angular/common/http'; -import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { ContentSourceSetSerializer } from '../../../../core/shared/content-source-set-serializer'; -import { AsyncPipe, NgIf } from '@angular/common'; import { VarDirective } from '../../../../shared/utils/var.directive'; /** @@ -56,9 +74,9 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; TranslateModule, AsyncPipe, NgIf, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class CollectionSourceControlsComponent implements OnInit, OnDestroy { diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts index e8b81ada2d..3457d75175 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts @@ -31,6 +31,8 @@ import { ContentSourceHarvestType, } from '../../../core/shared/content-source.model'; import { hasValue } from '../../../shared/empty.util'; +import { FormComponent } from '../../../shared/form/form.component'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { INotification, Notification, @@ -43,8 +45,6 @@ import { } from '../../../shared/remote-data.utils'; import { RouterStub } from '../../../shared/testing/router.stub'; import { CollectionSourceComponent } from './collection-source.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { FormComponent } from '../../../shared/form/form.component'; import { CollectionSourceControlsComponent } from './collection-source-controls/collection-source-controls.component'; const infoNotification: INotification = new Notification('id', NotificationType.Info, 'info'); @@ -145,8 +145,8 @@ describe('CollectionSourceComponent', () => { requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Location, useValue: location }, @@ -155,15 +155,15 @@ describe('CollectionSourceComponent', () => { { provide: Router, useValue: router }, { provide: CollectionDataService, useValue: collectionService }, { provide: RequestService, useValue: requestService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(CollectionSourceComponent, { remove: { imports: [ - ThemedLoadingComponent, - FormComponent, - CollectionSourceControlsComponent - ]} + ThemedLoadingComponent, + FormComponent, + CollectionSourceControlsComponent, + ] }, }) .compileComponents(); })); diff --git a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts index 9a8b0bf776..9cd24c057c 100644 --- a/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts @@ -1,4 +1,9 @@ -import { Location } from '@angular/common'; +import { + AsyncPipe, + Location, + Location, + NgIf, +} from '@angular/common'; import { Component, OnDestroy, @@ -19,9 +24,11 @@ import { DynamicRadioGroupModel, DynamicSelectModel, } from '@ng-dynamic-forms/core'; -import { AsyncPipe, Location, NgIf } from '@angular/common'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import cloneDeep from 'lodash/cloneDeep'; import { Observable, @@ -56,11 +63,11 @@ import { hasValue, isNotEmpty, } from '../../../shared/empty.util'; +import { FormComponent } from '../../../shared/form/form.component'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { INotification } from '../../../shared/notifications/models/notification.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { AbstractTrackableComponent } from '../../../shared/trackable/abstract-trackable.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { FormComponent } from '../../../shared/form/form.component'; import { CollectionSourceControlsComponent } from './collection-source-controls/collection-source-controls.component'; /** @@ -75,9 +82,9 @@ import { CollectionSourceControlsComponent } from './collection-source-controls/ NgIf, ThemedLoadingComponent, FormComponent, - CollectionSourceControlsComponent + CollectionSourceControlsComponent, ], - standalone: true + standalone: true, }) export class CollectionSourceComponent extends AbstractTrackableComponent implements OnInit, OnDestroy { /** diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts b/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts index cdb14f727f..228497956b 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts @@ -1,20 +1,19 @@ import { Route } from '@angular/router'; + +import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { CollectionAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard'; +import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; +import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; +import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; +import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; import { CollectionItemMapperComponent } from '../collection-item-mapper/collection-item-mapper.component'; -import { EditCollectionPageComponent } from './edit-collection-page.component'; +import { CollectionAccessControlComponent } from './collection-access-control/collection-access-control.component'; +import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; +import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; import { CollectionMetadataComponent } from './collection-metadata/collection-metadata.component'; import { CollectionRolesComponent } from './collection-roles/collection-roles.component'; import { CollectionSourceComponent } from './collection-source/collection-source.component'; -import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; -import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; -import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; -import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; -import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; -import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; -import { - CollectionAdministratorGuard -} from '../../core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard'; -import { CollectionAccessControlComponent } from './collection-access-control/collection-access-control.component'; +import { EditCollectionPageComponent } from './edit-collection-page.component'; /** * Routing module that handles the routing for the Edit Collection page administrator functionality @@ -24,11 +23,11 @@ export const ROUTES: Route[] = [ { path: '', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, providers: [ ResourcePolicyResolver, - ResourcePolicyTargetResolver + ResourcePolicyTargetResolver, ], data: { breadcrumbKey: 'collection.edit' }, component: EditCollectionPageComponent, @@ -37,7 +36,7 @@ export const ROUTES: Route[] = [ { path: '', redirectTo: 'metadata', - pathMatch: 'full' + pathMatch: 'full', }, { path: 'metadata', @@ -45,28 +44,28 @@ export const ROUTES: Route[] = [ data: { title: 'collection.edit.tabs.metadata.title', hideReturnButton: true, - showBreadcrumbs: true - } + showBreadcrumbs: true, + }, }, { path: 'roles', component: CollectionRolesComponent, - data: { title: 'collection.edit.tabs.roles.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.roles.title', showBreadcrumbs: true }, }, { path: 'source', component: CollectionSourceComponent, - data: { title: 'collection.edit.tabs.source.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.source.title', showBreadcrumbs: true }, }, { path: 'curate', component: CollectionCurateComponent, - data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true }, }, { path: 'access-control', component: CollectionAccessControlComponent, - data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }, }, { path: 'authorizations', @@ -75,31 +74,31 @@ export const ROUTES: Route[] = [ { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' } + data: { title: 'resource-policies.create.page.title' }, }, { path: 'edit', resolve: { - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' } + data: { title: 'resource-policies.edit.page.title' }, }, { path: '', component: CollectionAuthorizationsComponent, - data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true } - } - ] + data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true }, + }, + ], }, { path: 'mapper', component: CollectionItemMapperComponent, - data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true }, }, - ] - } + ], + }, ]; diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts index 6cadfed5c4..ae6fb9368d 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts @@ -8,13 +8,16 @@ import { import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { SharedModule } from '../../shared/shared.module'; +import { + CollectionDataService, + CollectionDataService, +} from '../../core/data/collection-data.service'; import { EditCollectionPageComponent } from './edit-collection-page.component'; -import { CollectionDataService } from '../../core/data/collection-data.service'; -import { of as observableOf } from 'rxjs'; describe('EditCollectionPageComponent', () => { let comp: EditCollectionPageComponent; @@ -45,13 +48,13 @@ describe('EditCollectionPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, EditCollectionPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, EditCollectionPageComponent], + providers: [ { provide: CollectionDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts index 199c1bfdfc..fc3d22bfd9 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.component.ts @@ -1,16 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink, RouterOutlet } from '@angular/router'; -import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterLink, + RouterOutlet, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Collection } from '../../core/shared/collection.model'; -import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component'; +import { + EditComColPageComponent, + EditComColPageComponent, +} from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { getCollectionPageRoute } from '../collection-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; /** * Component that represents the page where a user can edit an existing Collection @@ -25,9 +35,9 @@ import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; NgForOf, RouterOutlet, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class EditCollectionPageComponent extends EditComColPageComponent { type = 'collection'; diff --git a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts index e74f6a0a4b..5fae4890c9 100644 --- a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts +++ b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts @@ -1,32 +1,39 @@ -import { EditItemTemplatePageComponent } from './edit-item-template-page.component'; -import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { ItemTemplateDataService } from '../../core/data/item-template-data.service'; import { Collection } from '../../core/shared/collection.model'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; -import { SharedModule } from '../../shared/shared.module'; -import { getCollectionEditRoute } from '../collection-page-routing-paths'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { EditItemTemplatePageComponent } from './edit-item-template-page.component'; +import { ThemeService } from '../../shared/theme-support/theme.service'; +import { getCollectionEditRoute } from '../collection-page-routing-paths'; +import { + EditItemTemplatePageComponent, + EditItemTemplatePageComponent, +} from './edit-item-template-page.component'; describe('EditItemTemplatePageComponent', () => { let comp: EditItemTemplatePageComponent; diff --git a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts index 5fda24f5d0..0b0f04989e 100644 --- a/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts +++ b/src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts @@ -1,33 +1,45 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { + ActivatedRoute, + ActivatedRoute, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { + first, first, map, + map, + switchMap, switchMap, } from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { ItemTemplateDataService } from '../../core/data/item-template-data.service'; +import { + ItemTemplateDataService, + ItemTemplateDataService, +} from '../../core/data/item-template-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { Collection } from '../../core/shared/collection.model'; -import { ActivatedRoute, RouterLink } from '@angular/router'; -import { first, map, switchMap } from 'rxjs/operators'; -import { ItemTemplateDataService } from '../../core/data/item-template-data.service'; -import { getCollectionEditRoute } from '../collection-page-routing-paths'; import { Item } from '../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { AlertType } from '../../shared/alert/alert-type'; -import { getCollectionEditRoute } from '../collection-page-routing-paths'; import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { AlertComponent } from '../../shared/alert/alert.component'; +import { AlertType } from '../../shared/alert/alert-type'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { + getCollectionEditRoute, + getCollectionEditRoute, +} from '../collection-page-routing-paths'; @Component({ selector: 'ds-edit-item-template-page', @@ -40,9 +52,9 @@ import { AlertComponent } from '../../shared/alert/alert.component'; NgIf, TranslateModule, ThemedLoadingComponent, - AlertComponent + AlertComponent, ], - standalone: true + standalone: true, }) /** * Component for editing the item template of a collection diff --git a/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts b/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts index 2300a0b642..2dff557835 100644 --- a/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts +++ b/src/app/collection-page/edit-item-template-page/themed-edit-item-template-page.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { EditItemTemplatePageComponent } from './edit-item-template-page.component'; @Component({ - selector: 'ds-themed-edit-item-template-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-edit-item-template-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) /** * Component for editing the item template of a collection diff --git a/src/app/collection-page/themed-collection-page.component.ts b/src/app/collection-page/themed-collection-page.component.ts index 12f2756f0b..e095e6eb68 100644 --- a/src/app/collection-page/themed-collection-page.component.ts +++ b/src/app/collection-page/themed-collection-page.component.ts @@ -7,10 +7,10 @@ import { CollectionPageComponent } from './collection-page.component'; * Themed wrapper for CollectionPageComponent */ @Component({ - selector: 'ds-themed-collection-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-collection-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCollectionPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-list-page/community-list-page-routes.ts b/src/app/community-list-page/community-list-page-routes.ts index f7d4b85563..dcf6109b82 100644 --- a/src/app/community-list-page/community-list-page-routes.ts +++ b/src/app/community-list-page/community-list-page-routes.ts @@ -1,8 +1,8 @@ import { Route } from '@angular/router'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { CommunityListService } from './community-list-service'; import { ThemedCommunityListPageComponent } from './themed-community-list-page.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; /** * RouterModule to help navigate to the page with the community list tree @@ -14,8 +14,8 @@ export const ROUTES: Route[] = [ pathMatch: 'full', providers: [CommunityListService], resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'communityList.tabTitle', breadcrumbKey: 'communityList'} - } + data: { title: 'communityList.tabTitle', breadcrumbKey: 'communityList' }, + }, ]; diff --git a/src/app/community-list-page/community-list-page.component.spec.ts b/src/app/community-list-page/community-list-page.component.spec.ts index d15b03680f..8afcf4466f 100644 --- a/src/app/community-list-page/community-list-page.component.spec.ts +++ b/src/app/community-list-page/community-list-page.component.spec.ts @@ -1,7 +1,4 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ThemeService } from '../shared/theme-support/theme.service'; -import { getMockThemeService } from '../shared/mocks/theme-service.mock'; -import { CommunityListService } from './community-list-service'; import { ComponentFixture, inject, @@ -13,8 +10,11 @@ import { TranslateModule, } from '@ngx-translate/core'; +import { getMockThemeService } from '../shared/mocks/theme-service.mock'; import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock'; +import { ThemeService } from '../shared/theme-support/theme.service'; import { CommunityListPageComponent } from './community-list-page.component'; +import { CommunityListService } from './community-list-service'; describe('CommunityListPageComponent', () => { let component: CommunityListPageComponent; @@ -22,22 +22,22 @@ describe('CommunityListPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, - }, + }, }), - CommunityListPageComponent - ], - providers: [ + CommunityListPageComponent, + ], + providers: [ CommunityListPageComponent, { provide: ThemeService, useValue: getMockThemeService() }, { provide: CommunityListService, useValue: {} }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/community-list-page/community-list-page.component.ts b/src/app/community-list-page/community-list-page.component.ts index a2e511f8a9..aaf7bc2000 100644 --- a/src/app/community-list-page/community-list-page.component.ts +++ b/src/app/community-list-page/community-list-page.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + import { ThemedCommunityListComponent } from './community-list/themed-community-list.component'; /** @@ -7,10 +8,10 @@ import { ThemedCommunityListComponent } from './community-list/themed-community- * navigated to with community-list.page.routing.module */ @Component({ - selector: 'ds-community-list-page', - templateUrl: './community-list-page.component.html', - standalone: true, - imports: [ThemedCommunityListComponent, TranslateModule] + selector: 'ds-community-list-page', + templateUrl: './community-list-page.component.html', + standalone: true, + imports: [ThemedCommunityListComponent, TranslateModule], }) export class CommunityListPageComponent { diff --git a/src/app/community-list-page/community-list/community-list.component.spec.ts b/src/app/community-list-page/community-list/community-list.component.spec.ts index cfc9fca14c..3753c7d9e5 100644 --- a/src/app/community-list-page/community-list/community-list.component.spec.ts +++ b/src/app/community-list-page/community-list/community-list.component.spec.ts @@ -12,14 +12,20 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { RouterLinkWithHref } from '@angular/router'; +import { + RouterLinkWithHref, + RouterLinkWithHref, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { v4 as uuidv4 } from 'uuid'; +import { + v4 as uuidv4, + v4 as uuidv4, +} from 'uuid'; import { buildPaginatedList } from '../../core/data/paginated-list.model'; import { Collection } from '../../core/shared/collection.model'; @@ -29,19 +35,17 @@ import { isEmpty, isNotEmpty, } from '../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; +import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; import { CommunityListService, showMoreFlatNode, toFlatNode, } from '../community-list-service'; import { FlatNode } from '../flat-node.model'; -import { RouterLinkWithHref } from '@angular/router'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; -import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { v4 as uuidv4 } from 'uuid'; import { CommunityListComponent } from './community-list.component'; describe('CommunityListComponent', () => { @@ -212,29 +216,29 @@ describe('CommunityListComponent', () => { }, }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, - }, + }, }), CdkTreeModule, RouterTestingModule, RouterLinkWithHref, - CommunityListComponent - ], - providers: [CommunityListComponent, + CommunityListComponent, + ], + providers: [CommunityListComponent, { provide: CommunityListService, useValue: communityListServiceStub }], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}) + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .overrideComponent(CommunityListComponent, { remove: { imports: [ ThemedLoadingComponent, TruncatableComponent, TruncatablePartComponent, - ]} + ] }, }) .compileComponents(); })); diff --git a/src/app/community-list-page/community-list/community-list.component.ts b/src/app/community-list-page/community-list/community-list.component.ts index dd699109c8..f324c5a4c1 100644 --- a/src/app/community-list-page/community-list/community-list.component.ts +++ b/src/app/community-list-page/community-list/community-list.component.ts @@ -1,33 +1,49 @@ -import { FlatTreeControl } from '@angular/cdk/tree'; +import { + CdkTreeModule, + FlatTreeControl, + FlatTreeControl, +} from '@angular/cdk/tree'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, OnDestroy, OnInit, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { take } from 'rxjs/operators'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { CommunityListService } from '../community-list-service'; -import { CommunityListDatasource } from '../community-list-datasource'; -import { CdkTreeModule, FlatTreeControl } from '@angular/cdk/tree'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; -import { FindListOptions } from '../../core/data/find-list-options.model'; +import { + FindListOptions, + FindListOptions, +} from '../../core/data/find-list-options.model'; import { isEmpty } from '../../shared/empty.util'; -import { CommunityListDatasource } from '../community-list-datasource'; -import { CommunityListService } from '../community-list-service'; -import { FlatNode } from '../flat-node.model'; -import { FindListOptions } from '../../core/data/find-list-options.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; -import { RouterLink } from '@angular/router'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; +import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { + CommunityListDatasource, + CommunityListDatasource, +} from '../community-list-datasource'; +import { + CommunityListService, + CommunityListService, +} from '../community-list-service'; +import { FlatNode } from '../flat-node.model'; /** * A tree-structured list of nodes representing the communities, their subCommunities and collections. @@ -41,7 +57,7 @@ import { AsyncPipe, NgClass, NgIf } from '@angular/common'; templateUrl: './community-list.component.html', styleUrls: ['./community-list.component.scss'], standalone: true, - imports: [NgIf, ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) export class CommunityListComponent implements OnInit, OnDestroy { diff --git a/src/app/community-list-page/community-list/themed-community-list.component.ts b/src/app/community-list-page/community-list/themed-community-list.component.ts index 25b490a16b..dc6c0aa345 100644 --- a/src/app/community-list-page/community-list/themed-community-list.component.ts +++ b/src/app/community-list-page/community-list/themed-community-list.component.ts @@ -5,10 +5,10 @@ import { CommunityListComponent } from './community-list.component'; @Component({ - selector: 'ds-themed-community-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-community-list', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCommunityListComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-list-page/themed-community-list-page.component.ts b/src/app/community-list-page/themed-community-list-page.component.ts index 5ca5f506fc..4f0575c7db 100644 --- a/src/app/community-list-page/themed-community-list-page.component.ts +++ b/src/app/community-list-page/themed-community-list-page.component.ts @@ -7,10 +7,10 @@ import { CommunityListPageComponent } from './community-list-page.component'; * Themed wrapper for CommunityListPageComponent */ @Component({ - selector: 'ds-themed-community-list-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-community-list-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCommunityListPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/community-page/community-form/community-form.component.ts b/src/app/community-page/community-form/community-form.component.ts index 524d0c61ce..5d67a1ffe3 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -11,26 +16,38 @@ import { DynamicInputModel, DynamicTextAreaModel, } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; -import { environment } from '../../../environments/environment'; -import { AuthService } from '../../core/auth/auth.service'; -import { ObjectCacheService } from '../../core/cache/object-cache.service'; -import { CommunityDataService } from '../../core/data/community-data.service'; -import { RequestService } from '../../core/data/request.service'; +import { + environment, + environment, +} from '../../../environments/environment'; +import { + AuthService, + AuthService, +} from '../../core/auth/auth.service'; +import { + ObjectCacheService, + ObjectCacheService, +} from '../../core/cache/object-cache.service'; +import { + CommunityDataService, + CommunityDataService, +} from '../../core/data/community-data.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { Community } from '../../core/shared/community.model'; import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { CommunityDataService } from '../../core/data/community-data.service'; -import { AuthService } from '../../core/auth/auth.service'; -import { RequestService } from '../../core/data/request.service'; -import { ObjectCacheService } from '../../core/cache/object-cache.service'; -import { environment } from '../../../environments/environment'; -import { FormComponent } from '../../shared/form/form.component'; -import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { FormComponent } from '../../shared/form/form.component'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; import { VarDirective } from '../../shared/utils/var.directive'; /** @@ -49,7 +66,7 @@ import { VarDirective } from '../../shared/utils/var.directive'; ComcolPageLogoComponent, NgIf, NgClass, - VarDirective + VarDirective, ], }) export class CommunityFormComponent extends ComColFormComponent implements OnChanges { diff --git a/src/app/community-page/community-page-routes.ts b/src/app/community-page/community-page-routes.ts index e910fcbba8..253e28df70 100644 --- a/src/app/community-page/community-page-routes.ts +++ b/src/app/community-page/community-page-routes.ts @@ -1,27 +1,28 @@ import { Route } from '@angular/router'; -import { CommunityPageResolver } from './community-page.resolver'; -import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component'; -import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard'; -import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component'; -import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver'; -import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; -import { LinkService } from '../core/cache/builders/link.service'; -import { COMMUNITY_CREATE_PATH, COMMUNITY_EDIT_PATH } from './community-page-routing-paths'; -import { CommunityPageAdministratorGuard } from './community-page-administrator.guard'; -import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; -import { ThemedCommunityPageComponent } from './themed-community-page.component'; -import { MenuItemType } from '../shared/menu/menu-item-type.model'; -import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; -import { - ComcolSearchSectionComponent -} from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; -import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; import { BrowseByGuard } from '../browse-by/browse-by-guard'; import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; +import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver'; +import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { LinkService } from '../core/cache/builders/link.service'; +import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; +import { ComcolSearchSectionComponent } from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; +import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; +import { MenuItemType } from '../shared/menu/menu-item-type.model'; +import { CommunityPageResolver } from './community-page.resolver'; +import { CommunityPageAdministratorGuard } from './community-page-administrator.guard'; +import { + COMMUNITY_CREATE_PATH, + COMMUNITY_EDIT_PATH, +} from './community-page-routing-paths'; +import { CreateCommunityPageComponent } from './create-community-page/create-community-page.component'; +import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard'; +import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component'; +import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component'; +import { ThemedCommunityPageComponent } from './themed-community-page.component'; export const ROUTES: Route[] = [ { @@ -35,14 +36,14 @@ export const ROUTES: Route[] = [ LinkService, CreateCommunityPageGuard, CommunityPageAdministratorGuard, - ] + ], }, { path: ':id', resolve: { dso: CommunityPageResolver, breadcrumb: CommunityBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, providers: [ CommunityPageResolver, @@ -58,7 +59,7 @@ export const ROUTES: Route[] = [ path: COMMUNITY_EDIT_PATH, loadChildren: () => import('./edit-community-page/edit-community-page-routes') .then((m) => m.ROUTES), - canActivate: [CommunityPageAdministratorGuard] + canActivate: [CommunityPageAdministratorGuard], }, { path: 'delete', @@ -95,7 +96,7 @@ export const ROUTES: Route[] = [ data: { breadcrumbKey: 'browse.metadata' }, }, ], - } + }, ], data: { menu: { diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts index 7cb754a51f..af22a0b286 100644 --- a/src/app/community-page/community-page.component.ts +++ b/src/app/community-page/community-page.component.ts @@ -1,58 +1,64 @@ -import { filter, map, mergeMap } from 'rxjs/operators'; -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router, RouterModule, RouterOutlet } from '@angular/router'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { + ChangeDetectionStrategy, ChangeDetectionStrategy, Component, + Component, + OnInit, OnInit, } from '@angular/core'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterModule, + RouterOutlet, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { + filter, filter, map, + map, + mergeMap, mergeMap, } from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; -import { DSONameService } from '../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { RemoteData } from '../core/data/remote-data'; -import { redirectOn4xx } from '../core/shared/authorized.operators'; +import { + redirectOn4xx, + redirectOn4xx, +} from '../core/shared/authorized.operators'; import { Bitstream } from '../core/shared/bitstream.model'; import { Community } from '../core/shared/community.model'; import { getAllSucceededRemoteDataPayload } from '../core/shared/operators'; import { fadeInOut } from '../shared/animations/fade'; -import { hasValue } from '../shared/empty.util'; -import { getCommunityPageRoute } from './community-page-routing-paths'; -import { redirectOn4xx } from '../core/shared/authorized.operators'; -import { DSONameService } from '../core/breadcrumbs/dso-name.service'; +import { ThemedComcolPageBrowseByComponent } from '../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { ComcolPageContentComponent } from '../shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { hasValue } from '../shared/empty.util'; import { ErrorComponent } from '../shared/error/error.component'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ThemedComcolPageBrowseByComponent -} from '../shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { DsoEditMenuComponent } from '../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageHandleComponent -} from '../shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageLogoComponent } from '../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { ComcolPageHeaderComponent } from '../shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; import { VarDirective } from '../shared/utils/var.directive'; -import { - ThemedCollectionPageSubCollectionListComponent -} from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; -import { - ThemedCommunityPageSubCommunityListComponent -} from './sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; +import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; +import { getCommunityPageRoute } from './community-page-routing-paths'; +import { ThemedCollectionPageSubCollectionListComponent } from './sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; +import { ThemedCommunityPageSubCommunityListComponent } from './sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; @Component({ selector: 'ds-community-page', @@ -77,9 +83,9 @@ import { ViewTrackerComponent, VarDirective, RouterOutlet, - RouterModule + RouterModule, ], - standalone: true + standalone: true, }) /** * This component represents a detail page for a single community diff --git a/src/app/community-page/create-community-page/create-community-page.component.spec.ts b/src/app/community-page/create-community-page/create-community-page.component.spec.ts index 39c26f0d38..1a5f2df0fa 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.spec.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.spec.ts @@ -1,5 +1,8 @@ import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -7,21 +10,21 @@ import { } from '@angular/core/testing'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { RouteService } from '../../core/services/route.service'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../core/auth/auth.service'; import { CommunityDataService } from '../../core/data/community-data.service'; import { RequestService } from '../../core/data/request.service'; -import { RouteService } from '../../core/services/route.service'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { SharedModule } from '../../shared/shared.module'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { CreateCommunityPageComponent } from './create-community-page.component'; -import { AuthService } from '../../core/auth/auth.service'; +import { + RouteService, + RouteService, +} from '../../core/services/route.service'; import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { CommunityFormComponent } from '../community-form/community-form.component'; +import { CreateCommunityPageComponent } from './create-community-page.component'; describe('CreateCommunityPageComponent', () => { let comp: CreateCommunityPageComponent; @@ -42,8 +45,8 @@ describe('CreateCommunityPageComponent', () => { }) .overrideComponent(CreateCommunityPageComponent, { remove: { - imports: [CommunityFormComponent] - } + imports: [CommunityFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/community-page/create-community-page/create-community-page.component.ts b/src/app/community-page/create-community-page/create-community-page.component.ts index 715f264947..0a9e815074 100644 --- a/src/app/community-page/create-community-page/create-community-page.component.ts +++ b/src/app/community-page/create-community-page/create-community-page.component.ts @@ -1,20 +1,30 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { CommunityDataService } from '../../core/data/community-data.service'; -import { RequestService } from '../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { RouteService } from '../../core/services/route.service'; import { Community } from '../../core/shared/community.model'; import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { RequestService } from '../../core/data/request.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { CommunityFormComponent } from '../community-form/community-form.component'; import { VarDirective } from '../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { CommunityFormComponent } from '../community-form/community-form.component'; /** * Component that represents the page where a user can create a new Community @@ -28,9 +38,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; TranslateModule, VarDirective, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CreateCommunityPageComponent extends CreateComColPageComponent { protected frontendURL = '/communities/'; diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts index a651b65b04..524f3e3124 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.spec.ts @@ -23,16 +23,16 @@ describe('DeleteCommunityPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, DeleteCommunityPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, DeleteCommunityPageComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { data: observableOf({ dso: { payload: {} } }) } }, { provide: NotificationsService, useValue: {} }, { provide: RequestService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/delete-community-page/delete-community-page.component.ts b/src/app/community-page/delete-community-page/delete-community-page.component.ts index cf425a51ca..86ccdc5972 100644 --- a/src/app/community-page/delete-community-page/delete-community-page.component.ts +++ b/src/app/community-page/delete-community-page/delete-community-page.component.ts @@ -1,18 +1,26 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { CommunityDataService } from '../../core/data/community-data.service'; import { Community } from '../../core/shared/community.model'; import { DeleteComColPageComponent } from '../../shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AsyncPipe, NgIf } from '@angular/common'; import { VarDirective } from '../../shared/utils/var.directive'; /** @@ -26,9 +34,9 @@ import { VarDirective } from '../../shared/utils/var.directive'; TranslateModule, AsyncPipe, VarDirective, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class DeleteCommunityPageComponent extends DeleteComColPageComponent { protected frontendURL = '/communities/'; diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts index 752b1677c2..daa8544c08 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts @@ -2,20 +2,20 @@ import { ComponentFixture, TestBed, } from '@angular/core/testing'; -import { ActivatedRoute } from '@angular/router'; +import { + ActivatedRoute, + ActivatedRoute, +} from '@angular/router'; import { of as observableOf, of, + of, } from 'rxjs'; import { Community } from '../../../core/shared/community.model'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { CommunityAccessControlComponent } from './community-access-control.component'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; -import { ActivatedRoute } from '@angular/router'; -import { of } from 'rxjs'; describe('CommunityAccessControlComponent', () => { let component: CommunityAccessControlComponent; @@ -28,12 +28,12 @@ describe('CommunityAccessControlComponent', () => { return { pipe: () => { return of({}); - } + }, }; - } - } - } - } + }, + }, + }, + }, }; const testCommunity = Object.assign(new Community(), { @@ -64,16 +64,16 @@ describe('CommunityAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CommunityAccessControlComponent], - providers: [{ - provide: ActivatedRoute, useValue: routeStub - }] -}) - .overrideComponent(CommunityAccessControlComponent, { - remove: { - imports: [AccessControlFormContainerComponent] - } + imports: [CommunityAccessControlComponent], + providers: [{ + provide: ActivatedRoute, useValue: routeStub, + }], }) + .overrideComponent(CommunityAccessControlComponent, { + remove: { + imports: [AccessControlFormContainerComponent], + }, + }) .compileComponents(); }); diff --git a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts index e0def06a5a..669d99666d 100644 --- a/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts +++ b/src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -7,13 +11,12 @@ import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; -import { Community } from '../../../core/shared/community.model'; -import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { Community } from '../../../core/shared/community.model'; import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; -import { AsyncPipe, NgIf } from '@angular/common'; + Community, + Community, +} from '../../../core/shared/community.model'; +import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @Component({ selector: 'ds-community-access-control', @@ -22,9 +25,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; imports: [ AccessControlFormContainerComponent, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CommunityAccessControlComponent implements OnInit { itemRD$: Observable>; diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts index 334bce5057..dda4585486 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts @@ -12,12 +12,14 @@ import { ActivatedRoute } from '@angular/router'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { Collection } from '../../../core/shared/collection.model'; +import { + Collection, + Collection, +} from '../../../core/shared/collection.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; -import { CommunityAuthorizationsComponent } from './community-authorizations.component'; -import { Collection } from '../../../core/shared/collection.model'; import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; +import { CommunityAuthorizationsComponent } from './community-authorizations.component'; describe('CommunityAuthorizationsComponent', () => { let comp: CommunityAuthorizationsComponent; @@ -47,19 +49,19 @@ describe('CommunityAuthorizationsComponent', () => { TestBed.configureTestingModule({ imports: [ CommonModule, - CommunityAuthorizationsComponent + CommunityAuthorizationsComponent, ], providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, CommunityAuthorizationsComponent, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(CommunityAuthorizationsComponent, { remove: { - imports: [ResourcePoliciesComponent] - } + imports: [ResourcePoliciesComponent], + }, }) .compileComponents(); })); diff --git a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts index 7d69f4c05e..3e42a830be 100644 --- a/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts +++ b/src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, @@ -12,16 +13,15 @@ import { import { RemoteData } from '../../../core/data/remote-data'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; -import { AsyncPipe } from '@angular/common'; @Component({ selector: 'ds-community-authorizations', templateUrl: './community-authorizations.component.html', imports: [ ResourcePoliciesComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component that handles the community Authorizations diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts index 7c5e579af1..ad0beb0aa0 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts @@ -12,11 +12,13 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { Community } from '../../../core/shared/community.model'; +import { + Community, + Community, +} from '../../../core/shared/community.model'; +import { CurationFormComponent } from '../../../curation-form/curation-form.component'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { CommunityCurateComponent } from './community-curate.component'; -import { Community } from '../../../core/shared/community.model'; -import { CurationFormComponent } from '../../../curation-form/curation-form.component'; describe('CommunityCurateComponent', () => { let comp: CommunityCurateComponent; @@ -53,8 +55,8 @@ describe('CommunityCurateComponent', () => { }) .overrideComponent(CommunityCurateComponent, { remove: { - imports: [CurationFormComponent] - } + imports: [CurationFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts index a12ad4ac21..fd4d240827 100644 --- a/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts +++ b/src/app/community-page/edit-community-page/community-curate/community-curate.component.ts @@ -1,8 +1,10 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { filter, @@ -13,10 +15,8 @@ import { import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; -import { hasValue } from '../../../shared/empty.util'; import { CurationFormComponent } from '../../../curation-form/curation-form.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe } from '@angular/common'; +import { hasValue } from '../../../shared/empty.util'; /** * Component for managing a community's curation tasks @@ -27,9 +27,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ CurationFormComponent, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CommunityCurateComponent implements OnInit { diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts index d1275417f4..b914363bd8 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts @@ -1,20 +1,23 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { CommunityDataService } from '../../../core/data/community-data.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { SharedModule } from '../../../shared/shared.module'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { CommunityFormComponent } from '../../community-form/community-form.component'; import { CommunityMetadataComponent } from './community-metadata.component'; @@ -36,7 +39,7 @@ describe('CommunityMetadataComponent', () => { .overrideComponent(CommunityMetadataComponent, { remove: { imports: [CommunityFormComponent], - } + }, }) .compileComponents(); })); diff --git a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts index a940d7ae5a..8001bd2969 100644 --- a/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts +++ b/src/app/community-page/edit-community-page/community-metadata/community-metadata.component.ts @@ -1,16 +1,16 @@ +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; import { ActivatedRoute, Router, } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { CommunityFormComponent } from '../../community-form/community-form.component'; -import { AsyncPipe } from '@angular/common'; import { CommunityDataService } from '../../../core/data/community-data.service'; import { Community } from '../../../core/shared/community.model'; import { ComcolMetadataComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { CommunityFormComponent } from '../../community-form/community-form.component'; /** * Component for editing a community's metadata @@ -20,9 +20,9 @@ import { NotificationsService } from '../../../shared/notifications/notification templateUrl: './community-metadata.component.html', imports: [ CommunityFormComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class CommunityMetadataComponent extends ComcolMetadataComponent { protected frontendURL = '/communities/'; diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts index a43efe05fb..4bbf19df3b 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts @@ -7,27 +7,30 @@ import { TestBed, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { + NoopAnimationsModule, + NoopAnimationsModule, +} from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../core/data/request.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { RouterTestingModule } from '@angular/router/testing'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Community } from '../../../core/shared/community.model'; -import { ComcolModule } from '../../../shared/comcol/comcol.module'; import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; -import { SharedModule } from '../../../shared/shared.module'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { CommunityRolesComponent } from './community-roles.component'; @@ -67,21 +70,21 @@ describe('CommunityRolesComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NoopAnimationsModule, - CommunityRolesComponent - ], - providers: [ + CommunityRolesComponent, + ], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: ActivatedRoute, useValue: route }, { provide: RequestService, useValue: requestService }, { provide: GroupDataService, useValue: groupDataService }, { provide: NotificationsService, useClass: NotificationsServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); fixture = TestBed.createComponent(CommunityRolesComponent); comp = fixture.componentInstance; diff --git a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts index 4d309389cf..2e85cbe4c3 100644 --- a/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts +++ b/src/app/community-page/edit-community-page/community-roles/community-roles.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgForOf, +} from '@angular/common'; import { Component, OnInit, @@ -12,14 +16,11 @@ import { import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; import { HALLink } from '../../../core/shared/hal-link.model'; -import { - ComcolRoleComponent -} from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component'; -import { AsyncPipe, NgForOf } from '@angular/common'; import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { ComcolRoleComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component'; /** * Component for managing a community's roles @@ -30,9 +31,9 @@ import { imports: [ ComcolRoleComponent, AsyncPipe, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class CommunityRolesComponent implements OnInit { diff --git a/src/app/community-page/edit-community-page/edit-community-page-routes.ts b/src/app/community-page/edit-community-page/edit-community-page-routes.ts index 25fe8a5914..31afe50992 100644 --- a/src/app/community-page/edit-community-page/edit-community-page-routes.ts +++ b/src/app/community-page/edit-community-page/edit-community-page-routes.ts @@ -1,18 +1,17 @@ -import { EditCommunityPageComponent } from './edit-community-page.component'; import { Route } from '@angular/router'; + +import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { CommunityAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/community-administrator.guard'; +import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; +import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; +import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; +import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; +import { CommunityAccessControlComponent } from './community-access-control/community-access-control.component'; +import { CommunityAuthorizationsComponent } from './community-authorizations/community-authorizations.component'; +import { CommunityCurateComponent } from './community-curate/community-curate.component'; import { CommunityMetadataComponent } from './community-metadata/community-metadata.component'; import { CommunityRolesComponent } from './community-roles/community-roles.component'; -import { CommunityCurateComponent } from './community-curate/community-curate.component'; -import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { CommunityAuthorizationsComponent } from './community-authorizations/community-authorizations.component'; -import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; -import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; -import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; -import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; -import { - CommunityAdministratorGuard -} from '../../core/data/feature-authorization/feature-authorization-guard/community-administrator.guard'; -import { CommunityAccessControlComponent } from './community-access-control/community-access-control.component'; +import { EditCommunityPageComponent } from './edit-community-page.component'; /** * Routing module that handles the routing for the Edit Community page administrator functionality @@ -22,11 +21,11 @@ export const ROUTES: Route[] = [ { path: '', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, providers: [ ResourcePolicyResolver, - ResourcePolicyTargetResolver + ResourcePolicyTargetResolver, ], data: { breadcrumbKey: 'community.edit' }, component: EditCommunityPageComponent, @@ -35,7 +34,7 @@ export const ROUTES: Route[] = [ { path: '', redirectTo: 'metadata', - pathMatch: 'full' + pathMatch: 'full', }, { path: 'metadata', @@ -43,23 +42,23 @@ export const ROUTES: Route[] = [ data: { title: 'community.edit.tabs.metadata.title', hideReturnButton: true, - showBreadcrumbs: true - } + showBreadcrumbs: true, + }, }, { path: 'roles', component: CommunityRolesComponent, - data: { title: 'community.edit.tabs.roles.title', showBreadcrumbs: true } + data: { title: 'community.edit.tabs.roles.title', showBreadcrumbs: true }, }, { path: 'curate', component: CommunityCurateComponent, - data: { title: 'community.edit.tabs.curate.title', showBreadcrumbs: true } + data: { title: 'community.edit.tabs.curate.title', showBreadcrumbs: true }, }, { path: 'access-control', component: CommunityAccessControlComponent, - data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true } + data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }, }, { path: 'authorizations', @@ -68,26 +67,26 @@ export const ROUTES: Route[] = [ { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' } + data: { title: 'resource-policies.create.page.title' }, }, { path: 'edit', resolve: { - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' } + data: { title: 'resource-policies.edit.page.title' }, }, { path: '', component: CommunityAuthorizationsComponent, - data: { title: 'community.edit.tabs.authorizations.title', showBreadcrumbs: true, hideReturnButton: true } - } - ] - } - ] - } + data: { title: 'community.edit.tabs.authorizations.title', showBreadcrumbs: true, hideReturnButton: true }, + }, + ], + }, + ], + }, ]; diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts index e4b5730edc..b9b9a76b61 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.spec.ts @@ -1,21 +1,28 @@ -import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { of as observableOf } from 'rxjs'; -import { of as observableOf } from 'rxjs'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; import { CommunityDataService } from '../../core/data/community-data.service'; -import { SharedModule } from '../../shared/shared.module'; import { EditCommunityPageComponent } from './edit-community-page.component'; describe('EditCommunityPageComponent', () => { @@ -47,13 +54,13 @@ describe('EditCommunityPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, EditCommunityPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), CommonModule, RouterTestingModule, EditCommunityPageComponent], + providers: [ { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/edit-community-page/edit-community-page.component.ts b/src/app/community-page/edit-community-page/edit-community-page.component.ts index b1ee71924c..8ceac14103 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.component.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.component.ts @@ -1,15 +1,23 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterLink, + RouterOutlet, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../core/shared/community.model'; -import { ActivatedRoute, Router, RouterLink, RouterOutlet } from '@angular/router'; import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { getCommunityPageRoute } from '../community-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; /** * Component that represents the page where a user can edit an existing Community @@ -25,8 +33,8 @@ import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; NgForOf, RouterOutlet, NgIf, - AsyncPipe - ] + AsyncPipe, + ], }) export class EditCommunityPageComponent extends EditComColPageComponent { type = 'community'; diff --git a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts index a19a458d48..dc4ab52081 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -28,7 +28,6 @@ import { HostWindowService } from '../../../../shared/host-window.service'; import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { SharedModule } from '../../../../shared/shared.module'; import { HostWindowServiceStub } from '../../../../shared/testing/host-window-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub'; @@ -153,14 +152,14 @@ describe('CommunityPageSubCollectionListComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, NoopAnimationsModule, - CommunityPageSubCollectionListComponent - ], - providers: [ + CommunityPageSubCollectionListComponent, + ], + providers: [ { provide: CollectionDataService, useValue: collectionDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -170,9 +169,9 @@ describe('CommunityPageSubCollectionListComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts index de867da9c2..6a324beb17 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -5,36 +9,44 @@ import { OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription, } from 'rxjs'; -import { switchMap } from 'rxjs/operators'; +import { + switchMap, + switchMap, +} from 'rxjs/operators'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../../../core/cache/models/sort-options.model'; -import { CollectionDataService } from '../../../../core/data/collection-data.service'; +import { + CollectionDataService, + CollectionDataService, +} from '../../../../core/data/collection-data.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../../../core/pagination/pagination.service'; import { Collection } from '../../../../core/shared/collection.model'; import { Community } from '../../../../core/shared/community.model'; import { fadeIn } from '../../../../shared/animations/fade'; -import { hasValue } from '../../../../shared/empty.util'; -import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; -import { CollectionDataService } from '../../../../core/data/collection-data.service'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; -import { switchMap } from 'rxjs/operators'; -import { hasValue } from '../../../../shared/empty.util'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { ObjectCollectionComponent } from '../../../../shared/object-collection/object-collection.component'; +import { + hasValue, + hasValue, +} from '../../../../shared/empty.util'; import { ErrorComponent } from '../../../../shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../shared/object-collection/object-collection.component'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { VarDirective } from '../../../../shared/utils/var.directive'; @Component({ @@ -49,9 +61,9 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; NgIf, TranslateModule, AsyncPipe, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class CommunityPageSubCollectionListComponent implements OnInit, OnDestroy { @Input() community: Community; diff --git a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts index 1d9381f65d..ff5d057b31 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component.ts @@ -8,10 +8,10 @@ import { ThemedComponent } from '../../../../shared/theme-support/themed.compone import { CommunityPageSubCollectionListComponent } from './community-page-sub-collection-list.component'; @Component({ - selector: 'ds-themed-community-page-sub-collection-list', - styleUrls: [], - templateUrl: '../../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-community-page-sub-collection-list', + styleUrls: [], + templateUrl: '../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCollectionPageSubCollectionListComponent extends ThemedComponent { @Input() community: Community; diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts index d5bddfcd87..85d8eb4fb7 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.spec.ts @@ -18,11 +18,11 @@ describe('SubComColSectionComponent', () => { activatedRoute.parent = new ActivatedRouteStub(); await TestBed.configureTestingModule({ - imports: [SubComColSectionComponent], - providers: [ + imports: [SubComColSectionComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(SubComColSectionComponent); component = fixture.componentInstance; diff --git a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts index e8f13fcab0..ea21c66b54 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts @@ -1,17 +1,19 @@ -import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, Data, } from '@angular/router'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Data, +} from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { Community } from '../../../core/shared/community.model'; -import { - ThemedCommunityPageSubCommunityListComponent -} from './sub-community-list/themed-community-page-sub-community-list.component'; -import { - ThemedCollectionPageSubCollectionListComponent -} from './sub-collection-list/themed-community-page-sub-collection-list.component'; -import { AsyncPipe } from '@angular/common'; +import { ThemedCollectionPageSubCollectionListComponent } from './sub-collection-list/themed-community-page-sub-collection-list.component'; +import { ThemedCommunityPageSubCommunityListComponent } from './sub-community-list/themed-community-page-sub-community-list.component'; @Component({ selector: 'ds-sub-com-col-section', @@ -20,9 +22,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ ThemedCommunityPageSubCommunityListComponent, ThemedCollectionPageSubCollectionListComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class SubComColSectionComponent implements OnInit { diff --git a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts index b5eb6afad5..d014686427 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -23,14 +23,17 @@ import { LinkHeadService } from '../../../../core/services/link-head.service'; import { Community } from '../../../../core/shared/community.model'; import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; import { PageInfo } from '../../../../core/shared/page-info.model'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { HostWindowService } from '../../../../shared/host-window.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; -import { HostWindowService } from '../../../../shared/host-window.service'; +import { + HostWindowService, + HostWindowService, +} from '../../../../shared/host-window.service'; import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { SharedModule } from '../../../../shared/shared.module'; +import { + createSuccessfulRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../../../shared/remote-data.utils'; import { HostWindowServiceStub } from '../../../../shared/testing/host-window-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub'; @@ -156,14 +159,14 @@ describe('CommunityPageSubCommunityListComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, NoopAnimationsModule, - CommunityPageSubCommunityListComponent - ], - providers: [ + CommunityPageSubCommunityListComponent, + ], + providers: [ { provide: CommunityDataService, useValue: communityDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -173,9 +176,9 @@ describe('CommunityPageSubCommunityListComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts index 97329e3da1..1d93479376 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -5,35 +9,43 @@ import { OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription, } from 'rxjs'; -import { switchMap } from 'rxjs/operators'; +import { + switchMap, + switchMap, +} from 'rxjs/operators'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../../../core/cache/models/sort-options.model'; -import { CommunityDataService } from '../../../../core/data/community-data.service'; +import { + CommunityDataService, + CommunityDataService, +} from '../../../../core/data/community-data.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../../../core/pagination/pagination.service'; import { Community } from '../../../../core/shared/community.model'; import { fadeIn } from '../../../../shared/animations/fade'; -import { hasValue } from '../../../../shared/empty.util'; -import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; -import { CommunityDataService } from '../../../../core/data/community-data.service'; -import { switchMap } from 'rxjs/operators'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; -import { hasValue } from '../../../../shared/empty.util'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { ObjectCollectionComponent } from '../../../../shared/object-collection/object-collection.component'; +import { + hasValue, + hasValue, +} from '../../../../shared/empty.util'; import { ErrorComponent } from '../../../../shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../shared/object-collection/object-collection.component'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { VarDirective } from '../../../../shared/utils/var.directive'; @Component({ @@ -52,9 +64,9 @@ import { VarDirective } from '../../../../shared/utils/var.directive'; ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) /** * Component to render the sub-communities of a Community diff --git a/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts index 167f70a268..11b62d68e4 100644 --- a/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts +++ b/src/app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts @@ -8,10 +8,10 @@ import { ThemedComponent } from '../../../../shared/theme-support/themed.compone import { CommunityPageSubCommunityListComponent } from './community-page-sub-community-list.component'; @Component({ - selector: 'ds-themed-community-page-sub-community-list', - styleUrls: [], - templateUrl: '../../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-community-page-sub-community-list', + styleUrls: [], + templateUrl: '../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCommunityPageSubCommunityListComponent extends ThemedComponent { diff --git a/src/app/community-page/themed-community-page.component.ts b/src/app/community-page/themed-community-page.component.ts index 51402f7234..41a2960719 100644 --- a/src/app/community-page/themed-community-page.component.ts +++ b/src/app/community-page/themed-community-page.component.ts @@ -7,10 +7,10 @@ import { CommunityPageComponent } from './community-page.component'; * Themed wrapper for CommunityPageComponent */ @Component({ - selector: 'ds-themed-community-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-community-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCommunityPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/core/auth/auth-request.service.spec.ts b/src/app/core/auth/auth-request.service.spec.ts index 55101dd3c5..2220efe5fa 100644 --- a/src/app/core/auth/auth-request.service.spec.ts +++ b/src/app/core/auth/auth-request.service.spec.ts @@ -1,3 +1,7 @@ +import { + Observable, + of as observableOf, +} from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; @@ -5,18 +9,13 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { RemoteData } from '../data/remote-data'; import { PostRequest } from '../data/request.models'; import { RequestService } from '../data/request.service'; +import { RestRequestMethod } from '../data/rest-request-method'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { AuthRequestService } from './auth-request.service'; +import { AuthStatus } from './models/auth-status.model'; import { ShortLivedToken } from './models/short-lived-token.model'; import objectContaining = jasmine.objectContaining; -import { - Observable, - of as observableOf, -} from 'rxjs'; - -import { RestRequestMethod } from '../data/rest-request-method'; -import { AuthStatus } from './models/auth-status.model'; describe(`AuthRequestService`, () => { let halService: HALEndpointService; diff --git a/src/app/core/auth/auth.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index 39ee8cc34a..2c82e3355b 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -141,31 +141,31 @@ describe('AuthService test', () => { beforeEach(() => { init(); TestBed.configureTestingModule({ - imports: [ - CommonModule, - StoreModule.forRoot({ authReducer }, { + imports: [ + CommonModule, + StoreModule.forRoot({ authReducer }, { runtimeChecks: { - strictStateImmutability: false, + strictStateImmutability: false, strictActionImmutability: false, }, - }), - ], - providers: [ - { provide: AuthRequestService, useValue: authRequest }, - { provide: NativeWindowService, useValue: window }, - { provide: REQUEST, useValue: {} }, - { provide: Router, useValue: routerStub }, - { provide: RouteService, useValue: routeServiceStub }, - { provide: ActivatedRoute, useValue: routeStub }, - { provide: Store, useValue: mockStore }, - { provide: EPersonDataService, useValue: mockEpersonDataService }, - { provide: HardRedirectService, useValue: hardRedirectService }, - { provide: NotificationsService, useValue: NotificationsServiceStub }, - { provide: TranslateService, useValue: getMockTranslateService() }, - CookieService, - AuthService, - ] -}); + }), + ], + providers: [ + { provide: AuthRequestService, useValue: authRequest }, + { provide: NativeWindowService, useValue: window }, + { provide: REQUEST, useValue: {} }, + { provide: Router, useValue: routerStub }, + { provide: RouteService, useValue: routeServiceStub }, + { provide: ActivatedRoute, useValue: routeStub }, + { provide: Store, useValue: mockStore }, + { provide: EPersonDataService, useValue: mockEpersonDataService }, + { provide: HardRedirectService, useValue: hardRedirectService }, + { provide: NotificationsService, useValue: NotificationsServiceStub }, + { provide: TranslateService, useValue: getMockTranslateService() }, + CookieService, + AuthService, + ], + }); authService = TestBed.inject(AuthService); }); diff --git a/src/app/core/browse/browse-definition-data.service.ts b/src/app/core/browse/browse-definition-data.service.ts index ce5157b228..9c0d0d16c9 100644 --- a/src/app/core/browse/browse-definition-data.service.ts +++ b/src/app/core/browse/browse-definition-data.service.ts @@ -1,6 +1,5 @@ // eslint-disable-next-line max-classes-per-file import { Injectable } from '@angular/core'; -import { RequestService } from '../data/request.service'; import { Observable, of as observableOf, @@ -16,15 +15,11 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { dataService } from '../data/base/data-service.decorator'; import { FindAllData, FindAllDataImpl, } from '../data/base/find-all-data'; import { IdentifiableDataService } from '../data/base/identifiable-data.service'; -import { FindAllData, FindAllDataImpl } from '../data/base/find-all-data'; -import { isNotEmpty, isNotEmptyOperator, hasValue } from '../../shared/empty.util'; -import { take } from 'rxjs/operators'; import { SearchData, SearchDataImpl, @@ -35,7 +30,6 @@ import { RemoteData } from '../data/remote-data'; import { BrowseDefinitionRestRequest } from '../data/request.models'; import { RequestService } from '../data/request.service'; import { BrowseDefinition } from '../shared/browse-definition.model'; -import { BROWSE_DEFINITION } from '../shared/browse-definition.resource-type'; import { HALEndpointService } from '../shared/hal-endpoint.service'; /** diff --git a/src/app/core/cache/builders/link.service.ts b/src/app/core/cache/builders/link.service.ts index e2650a6a92..b72e722976 100644 --- a/src/app/core/cache/builders/link.service.ts +++ b/src/app/core/cache/builders/link.service.ts @@ -1,22 +1,45 @@ -import { Inject, Injectable, InjectionToken, Injector } from '@angular/core'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; -import { EMPTY, Observable, of, } from 'rxjs'; +import { + Inject, + Injectable, + InjectionToken, + Injector, +} from '@angular/core'; +import { + EMPTY, + Observable, + of, +} from 'rxjs'; +import { + catchError, + switchMap, +} from 'rxjs/operators'; + +import { + APP_DATA_SERVICES_MAP, + LazyDataServicesMap, +} from '../../../../config/app-config.interface'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model'; import { HALDataService } from '../../data/base/hal-data-service.interface'; import { PaginatedList } from '../../data/paginated-list.model'; import { RemoteData } from '../../data/remote-data'; +import { lazyService } from '../../lazy-service'; import { GenericConstructor } from '../../shared/generic-constructor'; import { HALResource } from '../../shared/hal-resource.model'; -import { LINK_DEFINITION_FACTORY, LINK_DEFINITION_MAP_FACTORY, LinkDefinition, } from './build-decorators'; -import { lazyService } from '../../lazy-service'; -import { catchError, switchMap } from 'rxjs/operators'; -import { APP_DATA_SERVICES_MAP, LazyDataServicesMap } from '../../../../config/app-config.interface'; +import { + LINK_DEFINITION_FACTORY, + LINK_DEFINITION_MAP_FACTORY, + LinkDefinition, +} from './build-decorators'; /** * A Service to handle the resolving and removing * of resolved {@link HALLink}s on HALResources */ -@Injectable({providedIn: 'root',}) +@Injectable({ providedIn: 'root' }) export class LinkService { constructor( @@ -54,27 +77,27 @@ export class LinkService { const lazyProvider$: Observable> = lazyService(this.map[matchingLinkDef.resourceType.value], this.injector); return lazyProvider$.pipe( switchMap((provider: HALDataService) => { - const link = model._links[matchingLinkDef.linkName]; - if (hasValue(link)) { - const href = link.href; + const link = model._links[matchingLinkDef.linkName]; + if (hasValue(link)) { + const href = link.href; - try { - if (matchingLinkDef.isList) { - return provider.findListByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); - } else { - return provider.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); - } - } catch (e) { - console.error(`Something went wrong when using ${matchingLinkDef.resourceType.value}) ${hasValue(provider) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`); - throw e; + try { + if (matchingLinkDef.isList) { + return provider.findListByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); + } else { + return provider.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow); } + } catch (e) { + console.error(`Something went wrong when using ${matchingLinkDef.resourceType.value}) ${hasValue(provider) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`); + throw e; } + } - return of(null); + return of(null); }), - catchError((err) => { + catchError((err: unknown) => { throw new Error(`The @link() for ${String(linkToFollow.name)} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`); - }) + }), ); } else if (!linkToFollow.isOptional) { throw new Error(`followLink('${String(linkToFollow.name)}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${String(linkToFollow.name)}`); diff --git a/src/app/core/coar-notify/notify-info/notify-info.component.spec.ts b/src/app/core/coar-notify/notify-info/notify-info.component.spec.ts index 3014042338..9661ebab6e 100644 --- a/src/app/core/coar-notify/notify-info/notify-info.component.spec.ts +++ b/src/app/core/coar-notify/notify-info/notify-info.component.spec.ts @@ -17,12 +17,12 @@ describe('NotifyInfoComponent', () => { notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', ['getCoarLdnLocalInboxUrls']); await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NotifyInfoComponent], - providers: [ + imports: [TranslateModule.forRoot(), NotifyInfoComponent], + providers: [ { provide: NotifyInfoService, useValue: notifyInfoServiceSpy }, ], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/core/coar-notify/notify-info/notify-info.component.ts b/src/app/core/coar-notify/notify-info/notify-info.component.ts index 01c8b37070..9822a07f9b 100644 --- a/src/app/core/coar-notify/notify-info/notify-info.component.ts +++ b/src/app/core/coar-notify/notify-info/notify-info.component.ts @@ -1,10 +1,17 @@ -import { Component, OnInit, } from '@angular/core'; -import { map, Observable, of, } from 'rxjs'; - -import { NotifyInfoService } from './notify-info.service'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe } from '@angular/common'; +import { + map, + Observable, + of, +} from 'rxjs'; + +import { NotifyInfoService } from './notify-info.service'; @Component({ selector: 'ds-notify-info', @@ -13,9 +20,9 @@ import { AsyncPipe } from '@angular/common'; imports: [ RouterLink, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component for displaying COAR notification information. diff --git a/src/app/core/coar-notify/notify-info/notify-info.service.ts b/src/app/core/coar-notify/notify-info/notify-info.service.ts index 8de2aa6e31..455c7902ee 100644 --- a/src/app/core/coar-notify/notify-info/notify-info.service.ts +++ b/src/app/core/coar-notify/notify-info/notify-info.service.ts @@ -1,12 +1,15 @@ import { Injectable } from '@angular/core'; -import { getFirstCompletedRemoteData } from '../../shared/operators'; -import { map, Observable, } from 'rxjs'; +import { + map, + Observable, +} from 'rxjs'; import { ConfigurationDataService } from '../../data/configuration-data.service'; import { AuthorizationDataService } from '../../data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../data/feature-authorization/feature-id'; import { RemoteData } from '../../data/remote-data'; import { ConfigurationProperty } from '../../shared/configuration-property.model'; +import { getFirstCompletedRemoteData } from '../../shared/operators'; /** * Service to check COAR availability and LDN services information for the COAR Notify functionalities diff --git a/src/app/core/config/bulk-access-config-data.service.ts b/src/app/core/config/bulk-access-config-data.service.ts index ff3b38d786..8023e58489 100644 --- a/src/app/core/config/bulk-access-config-data.service.ts +++ b/src/app/core/config/bulk-access-config-data.service.ts @@ -2,11 +2,9 @@ import { Injectable } from '@angular/core'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { dataService } from '../data/base/data-service.decorator'; import { RequestService } from '../data/request.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { ConfigDataService } from './config-data.service'; -import { BULK_ACCESS_CONDITION_OPTIONS } from './models/config-type'; /** * Data Service responsible for retrieving Bulk Access Condition Options from the REST API diff --git a/src/app/core/config/submission-accesses-config-data.service.ts b/src/app/core/config/submission-accesses-config-data.service.ts index dba30d6633..bc7a7e66d3 100644 --- a/src/app/core/config/submission-accesses-config-data.service.ts +++ b/src/app/core/config/submission-accesses-config-data.service.ts @@ -14,7 +14,7 @@ import { SubmissionAccessesModel } from './models/config-submission-accesses.mod /** * Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SubmissionAccessesConfigDataService extends ConfigDataService { constructor( protected requestService: RequestService, diff --git a/src/app/core/config/submission-uploads-config-data.service.ts b/src/app/core/config/submission-uploads-config-data.service.ts index 7fb7f337c6..10d749080e 100644 --- a/src/app/core/config/submission-uploads-config-data.service.ts +++ b/src/app/core/config/submission-uploads-config-data.service.ts @@ -14,7 +14,7 @@ import { SubmissionUploadsModel } from './models/config-submission-uploads.model /** * Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SubmissionUploadsConfigDataService extends ConfigDataService { constructor( protected requestService: RequestService, diff --git a/src/app/core/data-services-map.ts b/src/app/core/data-services-map.ts index 09d94230ae..ed0fbc1cb2 100644 --- a/src/app/core/data-services-map.ts +++ b/src/app/core/data-services-map.ts @@ -1,60 +1,58 @@ -import { AUTHORIZATION } from './shared/authorization.resource-type'; -import { BROWSE_DEFINITION } from './shared/browse-definition.resource-type'; +import { LazyDataServicesMap } from '../../config/app-config.interface'; +import { PROCESS } from '../process-page/processes/process.resource-type'; +import { SCRIPT } from '../process-page/scripts/script.resource-type'; +import { ACCESS_STATUS } from '../shared/object-collection/shared/badges/access-status-badge/access-status.resource-type'; +import { IDENTIFIERS } from '../shared/object-list/identifier-data/identifier-data.resource-type'; +import { SUBSCRIPTION } from '../shared/subscriptions/models/subscription.resource-type'; +import { SYSTEMWIDEALERT } from '../system-wide-alert/system-wide-alert.resource-type'; import { BULK_ACCESS_CONDITION_OPTIONS, SUBMISSION_ACCESSES_TYPE, SUBMISSION_FORMS_TYPE, - SUBMISSION_UPLOADS_TYPE + SUBMISSION_UPLOADS_TYPE, } from './config/models/config-type'; +import { ROOT } from './data/root.resource-type'; +import { EPERSON } from './eperson/models/eperson.resource-type'; +import { GROUP } from './eperson/models/group.resource-type'; +import { WORKFLOWITEM } from './eperson/models/workflowitem.resource-type'; +import { WORKSPACEITEM } from './eperson/models/workspaceitem.resource-type'; +import { FEEDBACK } from './feedback/models/feedback.resource-type'; +import { METADATA_FIELD } from './metadata/metadata-field.resource-type'; import { METADATA_SCHEMA } from './metadata/metadata-schema.resource-type'; +import { ORCID_HISTORY } from './orcid/model/orcid-history.resource-type'; +import { ORCID_QUEUE } from './orcid/model/orcid-queue.resource-type'; +import { RESEARCHER_PROFILE } from './profile/model/researcher-profile.resource-type'; +import { RESOURCE_POLICY } from './resource-policy/models/resource-policy.resource-type'; +import { AUTHORIZATION } from './shared/authorization.resource-type'; import { BITSTREAM } from './shared/bitstream.resource-type'; -import { USAGE_REPORT } from './statistics/models/usage-report.resource-type'; +import { BITSTREAM_FORMAT } from './shared/bitstream-format.resource-type'; +import { BROWSE_DEFINITION } from './shared/browse-definition.resource-type'; +import { BUNDLE } from './shared/bundle.resource-type'; import { COLLECTION } from './shared/collection.resource-type'; -import { CLAIMED_TASK } from './tasks/models/claimed-task-object.resource-type'; +import { COMMUNITY } from './shared/community.resource-type'; +import { CONFIG_PROPERTY } from './shared/config-property.resource-type'; +import { DSPACE_OBJECT } from './shared/dspace-object.resource-type'; +import { FEATURE } from './shared/feature.resource-type'; +import { ITEM } from './shared/item.resource-type'; +import { ITEM_TYPE } from './shared/item-relationships/item-type.resource-type'; +import { RELATIONSHIP } from './shared/item-relationships/relationship.resource-type'; +import { RELATIONSHIP_TYPE } from './shared/item-relationships/relationship-type.resource-type'; +import { LICENSE } from './shared/license.resource-type'; +import { SITE } from './shared/site.resource-type'; +import { VERSION } from './shared/version.resource-type'; +import { VERSION_HISTORY } from './shared/version-history.resource-type'; +import { USAGE_REPORT } from './statistics/models/usage-report.resource-type'; +import { SUBMISSION_CC_LICENSE } from './submission/models/submission-cc-licence.resource-type'; +import { SUBMISSION_CC_LICENSE_URL } from './submission/models/submission-cc-licence-link.resource-type'; import { VOCABULARY, VOCABULARY_ENTRY, - VOCABULARY_ENTRY_DETAIL + VOCABULARY_ENTRY_DETAIL, } from './submission/vocabularies/models/vocabularies.resource-type'; -import { ITEM_TYPE } from './shared/item-relationships/item-type.resource-type'; -import { LICENSE } from './shared/license.resource-type'; -import { COMMUNITY } from './shared/community.resource-type'; -import { BUNDLE } from './shared/bundle.resource-type'; -import { CONFIG_PROPERTY } from './shared/config-property.resource-type'; -import { POOL_TASK } from './tasks/models/pool-task-object.resource-type'; import { SUPERVISION_ORDER } from './supervision-order/models/supervision-order.resource-type'; -import { WORKSPACEITEM } from './eperson/models/workspaceitem.resource-type'; -import { WORKFLOWITEM } from './eperson/models/workflowitem.resource-type'; -import { SUBMISSION_CC_LICENSE_URL } from './submission/models/submission-cc-licence-link.resource-type'; -import { SUBMISSION_CC_LICENSE } from './submission/models/submission-cc-licence.resource-type'; -import { RESOURCE_POLICY } from './resource-policy/models/resource-policy.resource-type'; -import { RESEARCHER_PROFILE } from './profile/model/researcher-profile.resource-type'; -import { ORCID_QUEUE } from './orcid/model/orcid-queue.resource-type'; -import { ORCID_HISTORY } from './orcid/model/orcid-history.resource-type'; -import { FEEDBACK } from './feedback/models/feedback.resource-type'; -import { GROUP } from './eperson/models/group.resource-type'; -import { EPERSON } from './eperson/models/eperson.resource-type'; +import { CLAIMED_TASK } from './tasks/models/claimed-task-object.resource-type'; +import { POOL_TASK } from './tasks/models/pool-task-object.resource-type'; import { WORKFLOW_ACTION } from './tasks/models/workflow-action-object.resource-type'; -import { VERSION_HISTORY } from './shared/version-history.resource-type'; -import { SITE } from './shared/site.resource-type'; -import { ROOT } from './data/root.resource-type'; -import { RELATIONSHIP_TYPE } from './shared/item-relationships/relationship-type.resource-type'; -import { RELATIONSHIP } from './shared/item-relationships/relationship.resource-type'; -import { METADATA_FIELD } from './metadata/metadata-field.resource-type'; -import { ITEM } from './shared/item.resource-type'; -import { VERSION } from './shared/version.resource-type'; -import { FEATURE } from './shared/feature.resource-type'; -import { DSPACE_OBJECT } from './shared/dspace-object.resource-type'; -import { BITSTREAM_FORMAT } from './shared/bitstream-format.resource-type'; -import { SYSTEMWIDEALERT } from '../system-wide-alert/system-wide-alert.resource-type'; -import { - ACCESS_STATUS -} from '../shared/object-collection/shared/badges/access-status-badge/access-status.resource-type'; -import { SUBSCRIPTION } from '../shared/subscriptions/models/subscription.resource-type'; -import { SCRIPT } from '../process-page/scripts/script.resource-type'; -import { PROCESS } from '../process-page/processes/process.resource-type'; -import { IDENTIFIERS } from '../shared/object-list/identifier-data/identifier-data.resource-type'; -import { LazyDataServicesMap } from '../../config/app-config.interface'; export const LAZY_DATA_SERVICES: LazyDataServicesMap = { [AUTHORIZATION.value]: () => import('./data/feature-authorization/authorization-data.service').then(m => m.AuthorizationDataService), diff --git a/src/app/core/data/access-status-data.service.ts b/src/app/core/data/access-status-data.service.ts index 42eca1fd8a..6d8acb1c8b 100644 --- a/src/app/core/data/access-status-data.service.ts +++ b/src/app/core/data/access-status-data.service.ts @@ -1,18 +1,12 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model'; -import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RequestService } from './request.service'; -import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model'; -import { Observable } from 'rxjs'; -import { RemoteData } from './remote-data'; import { Item } from '../shared/item.model'; import { BaseDataService } from './base/base-data.service'; -import { dataService } from './base/data-service.decorator'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index 1bdb2f1843..81d1d74535 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -28,7 +28,6 @@ import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { Bitstream } from '../shared/bitstream.model'; -import { BITSTREAM } from '../shared/bitstream.resource-type'; import { BitstreamFormat } from '../shared/bitstream-format.model'; import { Bundle } from '../shared/bundle.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; @@ -37,7 +36,6 @@ import { NoContent } from '../shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../shared/operators'; import { PageInfo } from '../shared/page-info.model'; import { sendRequest } from '../shared/request.operators'; -import { dataService } from './base/data-service.decorator'; import { DeleteData, DeleteDataImpl, @@ -66,12 +64,6 @@ import { } from './request.models'; import { RequestService } from './request.service'; import { RestRequestMethod } from './rest-request-method'; -import { DeleteData, DeleteDataImpl } from './base/delete-data'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { NoContent } from '../shared/NoContent.model'; -import { IdentifiableDataService } from './base/identifiable-data.service'; -import { Operation, RemoveOperation } from 'fast-json-patch'; -import { getFirstCompletedRemoteData } from '../shared/operators'; /** * A service to retrieve {@link Bitstream}s from the REST API diff --git a/src/app/core/data/bitstream-format-data.service.ts b/src/app/core/data/bitstream-format-data.service.ts index 463b2f0e14..97b0fa961a 100644 --- a/src/app/core/data/bitstream-format-data.service.ts +++ b/src/app/core/data/bitstream-format-data.service.ts @@ -8,14 +8,14 @@ import { Observable } from 'rxjs'; import { distinctUntilChanged, map, - tap,} from 'rxjs/operators'; -import { - FollowLinkConfig } from 'src/app/shared/utils/follow-link-config.model'; + tap, +} from 'rxjs/operators'; +import { FollowLinkConfig } from 'src/app/shared/utils/follow-link-config.model'; -import { BitstreamFormatsRegistryDeselectAction, +import { + BitstreamFormatsRegistryDeselectAction, BitstreamFormatsRegistryDeselectAllAction, - BitstreamFormatsRegistrySelectAction -, + BitstreamFormatsRegistrySelectAction, } from '../../admin/admin-registries/bitstream-formats/bitstream-format.actions'; import { BitstreamFormatRegistryState } from '../../admin/admin-registries/bitstream-formats/bitstream-format.reducers'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -25,12 +25,9 @@ import { coreSelector } from '../core.selectors'; import { CoreState } from '../core-state.model'; import { Bitstream } from '../shared/bitstream.model'; import { BitstreamFormat } from '../shared/bitstream-format.model'; -import { Bitstream } from '../shared/bitstream.model'; -import { BITSTREAM_FORMAT } from '../shared/bitstream-format.resource-type'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { NoContent } from '../shared/NoContent.model'; import { sendRequest } from '../shared/request.operators'; -import { dataService } from './base/data-service.decorator'; import { DeleteData, DeleteDataImpl, @@ -42,7 +39,6 @@ import { import { IdentifiableDataService } from './base/identifiable-data.service'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; -import { NoContent } from '../shared/NoContent.model'; import { RemoteData } from './remote-data'; import { PostRequest, diff --git a/src/app/core/data/bundle-data.service.ts b/src/app/core/data/bundle-data.service.ts index 8c7b61a340..5d552c9bf0 100644 --- a/src/app/core/data/bundle-data.service.ts +++ b/src/app/core/data/bundle-data.service.ts @@ -16,7 +16,6 @@ import { Bitstream } from '../shared/bitstream.model'; import { Bundle } from '../shared/bundle.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { Item } from '../shared/item.model'; -import { dataService } from './base/data-service.decorator'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { PatchData, @@ -30,7 +29,6 @@ import { GetRequest } from './request.models'; import { RequestService } from './request.service'; import { RequestEntryState } from './request-entry-state.model'; import { RestRequestMethod } from './rest-request-method'; -import { Operation } from 'fast-json-patch'; /** * A service to retrieve {@link Bundle}s from the REST API diff --git a/src/app/core/data/collection-data.service.ts b/src/app/core/data/collection-data.service.ts index 253f44c84d..351bfa8155 100644 --- a/src/app/core/data/collection-data.service.ts +++ b/src/app/core/data/collection-data.service.ts @@ -24,13 +24,11 @@ import { ObjectCacheService } from '../cache/object-cache.service'; import { DSpaceSerializer } from '../dspace-rest/dspace.serializer'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; import { Collection } from '../shared/collection.model'; -import { COLLECTION } from '../shared/collection.resource-type'; import { Community } from '../shared/community.model'; import { ContentSource } from '../shared/content-source.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { Item } from '../shared/item.model'; import { getFirstCompletedRemoteData } from '../shared/operators'; -import { dataService } from './base/data-service.decorator'; import { BitstreamDataService } from './bitstream-data.service'; import { ComColDataService } from './comcol-data.service'; import { CommunityDataService } from './community-data.service'; @@ -44,8 +42,6 @@ import { } from './request.models'; import { RequestService } from './request.service'; import { RestRequest } from './rest-request.model'; -import { FindListOptions } from './find-list-options.model'; -import { Community } from '../shared/community.model'; @Injectable({ providedIn: 'root' }) export class CollectionDataService extends ComColDataService { diff --git a/src/app/core/data/community-data.service.ts b/src/app/core/data/community-data.service.ts index 9200f6814e..79dedf0c84 100644 --- a/src/app/core/data/community-data.service.ts +++ b/src/app/core/data/community-data.service.ts @@ -14,7 +14,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { ObjectCacheService } from '../cache/object-cache.service'; import { Community } from '../shared/community.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { dataService } from './base/data-service.decorator'; import { BitstreamDataService } from './bitstream-data.service'; import { ComColDataService } from './comcol-data.service'; import { DSOChangeAnalyzer } from './dso-change-analyzer.service'; @@ -22,10 +21,6 @@ import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; -import { BitstreamDataService } from './bitstream-data.service'; -import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; -import { isNotEmpty } from '../../shared/empty.util'; -import { FindListOptions } from './find-list-options.model'; @Injectable({ providedIn: 'root' }) export class CommunityDataService extends ComColDataService { diff --git a/src/app/core/data/configuration-data.service.ts b/src/app/core/data/configuration-data.service.ts index dd15e0e6a3..bb1bd19ff1 100644 --- a/src/app/core/data/configuration-data.service.ts +++ b/src/app/core/data/configuration-data.service.ts @@ -3,15 +3,11 @@ import { Observable } from 'rxjs'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { CONFIG_PROPERTY } from '../shared/config-property.resource-type'; import { ConfigurationProperty } from '../shared/configuration-property.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { dataService } from './base/data-service.decorator'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; -import { ConfigurationProperty } from '../shared/configuration-property.model'; -import { IdentifiableDataService } from './base/identifiable-data.service'; @Injectable({ providedIn: 'root' }) /** diff --git a/src/app/core/data/dspace-object-data.service.ts b/src/app/core/data/dspace-object-data.service.ts index 928a1fcf32..bdebbd0582 100644 --- a/src/app/core/data/dspace-object-data.service.ts +++ b/src/app/core/data/dspace-object-data.service.ts @@ -4,9 +4,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { ObjectCacheService } from '../cache/object-cache.service'; import { DSpaceObject } from '../shared/dspace-object.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RequestService } from './request.service'; -import { IdentifiableDataService } from './base/identifiable-data.service'; -import { dataService } from './base/data-service.decorator'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { RequestService } from './request.service'; diff --git a/src/app/core/data/feature-authorization/authorization-data.service.ts b/src/app/core/data/feature-authorization/authorization-data.service.ts index c17bb41502..93d8f6b3ec 100644 --- a/src/app/core/data/feature-authorization/authorization-data.service.ts +++ b/src/app/core/data/feature-authorization/authorization-data.service.ts @@ -1,6 +1,4 @@ import { Injectable } from '@angular/core'; -import { Authorization } from '../../shared/authorization.model'; -import { RequestService } from '../request.service'; import { Observable, of as observableOf, @@ -24,11 +22,9 @@ import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.s import { RequestParam } from '../../cache/models/request-param.model'; import { ObjectCacheService } from '../../cache/object-cache.service'; import { Authorization } from '../../shared/authorization.model'; -import { AUTHORIZATION } from '../../shared/authorization.resource-type'; import { HALEndpointService } from '../../shared/hal-endpoint.service'; import { getFirstCompletedRemoteData } from '../../shared/operators'; import { BaseDataService } from '../base/base-data.service'; -import { dataService } from '../base/data-service.decorator'; import { SearchData, SearchDataImpl, @@ -41,10 +37,6 @@ import { SiteDataService } from '../site-data.service'; import { AuthorizationSearchParams } from './authorization-search-params'; import { oneAuthorizationMatchesFeature } from './authorization-utils'; import { FeatureID } from './feature-id'; -import { getFirstCompletedRemoteData } from '../../shared/operators'; -import { FindListOptions } from '../find-list-options.model'; -import { BaseDataService } from '../base/base-data.service'; -import { SearchData, SearchDataImpl } from '../base/search-data'; /** * A service to retrieve {@link Authorization}s from the REST API diff --git a/src/app/core/data/feature-authorization/feature-data.service.ts b/src/app/core/data/feature-authorization/feature-data.service.ts index e2385aed8e..191d8b002c 100644 --- a/src/app/core/data/feature-authorization/feature-data.service.ts +++ b/src/app/core/data/feature-authorization/feature-data.service.ts @@ -1,14 +1,10 @@ import { Injectable } from '@angular/core'; -import { Feature } from '../../shared/feature.model'; -import { RequestService } from '../request.service'; import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../cache/object-cache.service'; import { Feature } from '../../shared/feature.model'; -import { FEATURE } from '../../shared/feature.resource-type'; import { HALEndpointService } from '../../shared/hal-endpoint.service'; import { BaseDataService } from '../base/base-data.service'; -import { dataService } from '../base/data-service.decorator'; import { RequestService } from '../request.service'; /** diff --git a/src/app/core/data/href-only-data.service.ts b/src/app/core/data/href-only-data.service.ts index 5252153192..dd40be8f7d 100644 --- a/src/app/core/data/href-only-data.service.ts +++ b/src/app/core/data/href-only-data.service.ts @@ -6,11 +6,11 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { CacheableObject } from '../cache/cacheable-object.model'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RemoteData } from './remote-data'; -import { PaginatedList } from './paginated-list.model'; -import { FindListOptions } from './find-list-options.model'; import { BaseDataService } from './base/base-data.service'; import { HALDataService } from './base/hal-data-service.interface'; +import { FindListOptions } from './find-list-options.model'; +import { PaginatedList } from './paginated-list.model'; +import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; /** @@ -29,7 +29,7 @@ import { RequestService } from './request.service'; * ``` * This means we cannot extend from {@link BaseDataService} directly because the method signatures would not match. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class HrefOnlyDataService implements HALDataService { /** * Works with a {@link BaseDataService} internally, but only exposes two of its methods diff --git a/src/app/core/data/identifier-data.service.ts b/src/app/core/data/identifier-data.service.ts index 9180c810db..502b1fe710 100644 --- a/src/app/core/data/identifier-data.service.ts +++ b/src/app/core/data/identifier-data.service.ts @@ -1,8 +1,15 @@ -import { HttpClient, HttpHeaders, HttpParams, } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, + HttpParams, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model'; diff --git a/src/app/core/data/item-data.service.spec.ts b/src/app/core/data/item-data.service.spec.ts index f403994132..d84ca6ea8d 100644 --- a/src/app/core/data/item-data.service.spec.ts +++ b/src/app/core/data/item-data.service.spec.ts @@ -1,6 +1,9 @@ import { HttpClient } from '@angular/common/http'; import { Store } from '@ngrx/store'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { HALEndpointServiceStub } from 'src/app/shared/testing/hal-endpoint-service.stub'; @@ -8,6 +11,7 @@ import { HALEndpointServiceStub } from 'src/app/shared/testing/hal-endpoint-serv import { getMockRemoteDataBuildService } from '../../shared/mocks/remote-data-build.service.mock'; import { getMockRequestService } from '../../shared/mocks/request.service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service.stub'; import { BrowseService } from '../browse/browse.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { RestResponse } from '../cache/response.models'; @@ -18,10 +22,12 @@ import { testDeleteDataImplementation } from './base/delete-data.spec'; import { testPatchDataImplementation } from './base/patch-data.spec'; import { FindListOptions } from './find-list-options.model'; import { ItemDataService } from './item-data.service'; -import { DeleteRequest, PostRequest, } from './request.models'; +import { + DeleteRequest, + PostRequest, +} from './request.models'; import { RequestService } from './request.service'; import { RequestEntry } from './request-entry.model'; -import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service.stub'; describe('ItemDataService', () => { let scheduler: TestScheduler; diff --git a/src/app/core/data/item-data.service.ts b/src/app/core/data/item-data.service.ts index d63a3148dc..e1f789b5da 100644 --- a/src/app/core/data/item-data.service.ts +++ b/src/app/core/data/item-data.service.ts @@ -10,9 +10,20 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Operation } from 'fast-json-patch'; import { Observable } from 'rxjs'; -import { distinctUntilChanged, filter, find, map, switchMap, take, } from 'rxjs/operators'; +import { + distinctUntilChanged, + filter, + find, + map, + switchMap, + take, +} from 'rxjs/operators'; -import { hasValue, isNotEmpty, isNotEmptyOperator, } from '../../shared/empty.util'; +import { + hasValue, + isNotEmpty, + isNotEmptyOperator, +} from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; import { BrowseService } from '../browse/browse.service'; @@ -30,17 +41,34 @@ import { MetadataMap } from '../shared/metadata.models'; import { NoContent } from '../shared/NoContent.model'; import { sendRequest } from '../shared/request.operators'; import { URLCombiner } from '../url-combiner/url-combiner'; -import { CreateData, CreateDataImpl, } from './base/create-data'; -import { DeleteData, DeleteDataImpl, } from './base/delete-data'; -import { ConstructIdEndpoint, IdentifiableDataService, } from './base/identifiable-data.service'; -import { PatchData, PatchDataImpl, } from './base/patch-data'; +import { + CreateData, + CreateDataImpl, +} from './base/create-data'; +import { + DeleteData, + DeleteDataImpl, +} from './base/delete-data'; +import { + ConstructIdEndpoint, + IdentifiableDataService, +} from './base/identifiable-data.service'; +import { + PatchData, + PatchDataImpl, +} from './base/patch-data'; import { BundleDataService } from './bundle-data.service'; import { DSOChangeAnalyzer } from './dso-change-analyzer.service'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { ResponseParsingService } from './parsing.service'; import { RemoteData } from './remote-data'; -import { DeleteRequest, GetRequest, PostRequest, PutRequest, } from './request.models'; +import { + DeleteRequest, + GetRequest, + PostRequest, + PutRequest, +} from './request.models'; import { RequestService } from './request.service'; import { RestRequest } from './rest-request.model'; import { RestRequestMethod } from './rest-request-method'; diff --git a/src/app/core/data/metadata-field-data.service.ts b/src/app/core/data/metadata-field-data.service.ts index ba2bd06bbc..aa79ef517e 100644 --- a/src/app/core/data/metadata-field-data.service.ts +++ b/src/app/core/data/metadata-field-data.service.ts @@ -6,17 +6,29 @@ import { hasValue } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; import { MetadataField } from '../metadata/metadata-field.model'; import { MetadataSchema } from '../metadata/metadata-schema.model'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; import { NoContent } from '../shared/NoContent.model'; -import { CreateData, CreateDataImpl, } from './base/create-data'; -import { DeleteData, DeleteDataImpl, } from './base/delete-data'; +import { + CreateData, + CreateDataImpl, +} from './base/create-data'; +import { + DeleteData, + DeleteDataImpl, +} from './base/delete-data'; import { IdentifiableDataService } from './base/identifiable-data.service'; -import { PutData, PutDataImpl, } from './base/put-data'; -import { SearchData, SearchDataImpl, } from './base/search-data'; +import { + PutData, + PutDataImpl, +} from './base/put-data'; +import { + SearchData, + SearchDataImpl, +} from './base/search-data'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; diff --git a/src/app/core/data/metadata-schema-data.service.ts b/src/app/core/data/metadata-schema-data.service.ts index bde9dab2cd..e893cb5404 100644 --- a/src/app/core/data/metadata-schema-data.service.ts +++ b/src/app/core/data/metadata-schema-data.service.ts @@ -10,11 +10,23 @@ import { ObjectCacheService } from '../cache/object-cache.service'; import { MetadataSchema } from '../metadata/metadata-schema.model'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { NoContent } from '../shared/NoContent.model'; -import { CreateData, CreateDataImpl, } from './base/create-data'; -import { DeleteData, DeleteDataImpl, } from './base/delete-data'; -import { FindAllData, FindAllDataImpl, } from './base/find-all-data'; +import { + CreateData, + CreateDataImpl, +} from './base/create-data'; +import { + DeleteData, + DeleteDataImpl, +} from './base/delete-data'; +import { + FindAllData, + FindAllDataImpl, +} from './base/find-all-data'; import { IdentifiableDataService } from './base/identifiable-data.service'; -import { PutData, PutDataImpl, } from './base/put-data'; +import { + PutData, + PutDataImpl, +} from './base/put-data'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; diff --git a/src/app/core/data/notify-services-status-data.service.ts b/src/app/core/data/notify-services-status-data.service.ts index 547a7a305f..1241dd1222 100644 --- a/src/app/core/data/notify-services-status-data.service.ts +++ b/src/app/core/data/notify-services-status-data.service.ts @@ -16,7 +16,7 @@ import { RemoteData } from './remote-data'; import { GetRequest } from './request.models'; import { RequestService } from './request.service'; -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(NOTIFYREQUEST) export class NotifyRequestsStatusDataService extends IdentifiableDataService { diff --git a/src/app/core/data/processes/process-data.service.ts b/src/app/core/data/processes/process-data.service.ts index b879838128..b39a500c80 100644 --- a/src/app/core/data/processes/process-data.service.ts +++ b/src/app/core/data/processes/process-data.service.ts @@ -1,6 +1,19 @@ -import { Inject, Injectable, InjectionToken, NgZone, } from '@angular/core'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, find, switchMap, } from 'rxjs/operators'; +import { + Inject, + Injectable, + InjectionToken, + NgZone, +} from '@angular/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + find, + switchMap, +} from 'rxjs/operators'; import { ProcessStatus } from 'src/app/process-page/processes/process-status.model'; import { Process } from '../../../process-page/processes/process.model'; @@ -13,10 +26,19 @@ import { Bitstream } from '../../shared/bitstream.model'; import { HALEndpointService } from '../../shared/hal-endpoint.service'; import { NoContent } from '../../shared/NoContent.model'; import { getAllCompletedRemoteData } from '../../shared/operators'; -import { DeleteData, DeleteDataImpl, } from '../base/delete-data'; -import { FindAllData, FindAllDataImpl, } from '../base/find-all-data'; +import { + DeleteData, + DeleteDataImpl, +} from '../base/delete-data'; +import { + FindAllData, + FindAllDataImpl, +} from '../base/find-all-data'; import { IdentifiableDataService } from '../base/identifiable-data.service'; -import { SearchData, SearchDataImpl, } from '../base/search-data'; +import { + SearchData, + SearchDataImpl, +} from '../base/search-data'; import { BitstreamDataService } from '../bitstream-data.service'; import { FindListOptions } from '../find-list-options.model'; import { PaginatedList } from '../paginated-list.model'; diff --git a/src/app/core/data/processes/script-data.service.ts b/src/app/core/data/processes/script-data.service.ts index c39353ef81..e61da4db63 100644 --- a/src/app/core/data/processes/script-data.service.ts +++ b/src/app/core/data/processes/script-data.service.ts @@ -1,6 +1,9 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { map, take, } from 'rxjs/operators'; +import { + map, + take, +} from 'rxjs/operators'; import { Process } from '../../../process-page/processes/process.model'; import { ProcessParameter } from '../../../process-page/processes/process-parameter.model'; @@ -12,7 +15,10 @@ import { ObjectCacheService } from '../../cache/object-cache.service'; import { HALEndpointService } from '../../shared/hal-endpoint.service'; import { getFirstCompletedRemoteData } from '../../shared/operators'; import { URLCombiner } from '../../url-combiner/url-combiner'; -import { FindAllData, FindAllDataImpl, } from '../base/find-all-data'; +import { + FindAllData, + FindAllDataImpl, +} from '../base/find-all-data'; import { IdentifiableDataService } from '../base/identifiable-data.service'; import { FindListOptions } from '../find-list-options.model'; import { PaginatedList } from '../paginated-list.model'; diff --git a/src/app/core/data/relationship-data.service.ts b/src/app/core/data/relationship-data.service.ts index 074ef4a575..0e8740e2ae 100644 --- a/src/app/core/data/relationship-data.service.ts +++ b/src/app/core/data/relationship-data.service.ts @@ -1,27 +1,54 @@ import { HttpHeaders } from '@angular/common/http'; -import { Inject, Injectable, } from '@angular/core'; -import { MemoizedSelector, select, Store, } from '@ngrx/store'; -import { combineLatest as observableCombineLatest, Observable, of as observableOf, } from 'rxjs'; -import { distinctUntilChanged, filter, map, mergeMap, startWith, switchMap, take, tap, } from 'rxjs/operators'; +import { + Inject, + Injectable, +} from '@angular/core'; +import { + MemoizedSelector, + select, + Store, +} from '@ngrx/store'; +import { + combineLatest as observableCombineLatest, + Observable, + of as observableOf, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + map, + mergeMap, + startWith, + switchMap, + take, + tap, +} from 'rxjs/operators'; -import { AppState, keySelector, } from '../../app.reducer'; +import { + AppState, + keySelector, +} from '../../app.reducer'; import { compareArraysUsingIds, PAGINATED_RELATIONS_TO_ITEMS_OPERATOR, relationsToItems, } from '../../item-page/simple/item-types/shared/item-relationships-utils'; -import { hasValue, hasValueOperator, isNotEmpty, isNotEmptyOperator, } from '../../shared/empty.util'; import { - ReorderableRelationship -} from '../../shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component'; + hasValue, + hasValueOperator, + isNotEmpty, + isNotEmptyOperator, +} from '../../shared/empty.util'; +import { ReorderableRelationship } from '../../shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component'; import { RemoveNameVariantAction, SetNameVariantAction, } from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.actions'; +import { NameVariantListState } from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer'; import { - NameVariantListState -} from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer'; -import { followLink, FollowLinkConfig, } from '../../shared/utils/follow-link-config.model'; + followLink, + FollowLinkConfig, +} from '../../shared/utils/follow-link-config.model'; import { itemLinksToFollow } from '../../shared/utils/relation-query.utils'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; @@ -45,13 +72,22 @@ import { } from '../shared/operators'; import { sendRequest } from '../shared/request.operators'; import { IdentifiableDataService } from './base/identifiable-data.service'; -import { PutData, PutDataImpl, } from './base/put-data'; -import { SearchData, SearchDataImpl, } from './base/search-data'; +import { + PutData, + PutDataImpl, +} from './base/put-data'; +import { + SearchData, + SearchDataImpl, +} from './base/search-data'; import { FindListOptions } from './find-list-options.model'; import { ItemDataService } from './item-data.service'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; -import { DeleteRequest, PostRequest, } from './request.models'; +import { + DeleteRequest, + PostRequest, +} from './request.models'; import { RequestService } from './request.service'; import { RequestEntryState } from './request-entry-state.model'; import { RestRequest } from './rest-request.model'; diff --git a/src/app/core/data/relationship-type-data.service.ts b/src/app/core/data/relationship-type-data.service.ts index ae28aac92b..21d0fcb5f6 100644 --- a/src/app/core/data/relationship-type-data.service.ts +++ b/src/app/core/data/relationship-type-data.service.ts @@ -1,15 +1,30 @@ import { Injectable } from '@angular/core'; -import { combineLatest as observableCombineLatest, Observable, } from 'rxjs'; -import { map, mergeMap, switchMap, toArray, } from 'rxjs/operators'; +import { + combineLatest as observableCombineLatest, + Observable, +} from 'rxjs'; +import { + map, + mergeMap, + switchMap, + toArray, +} from 'rxjs/operators'; import { hasValue } from '../../shared/empty.util'; -import { followLink, FollowLinkConfig, } from '../../shared/utils/follow-link-config.model'; +import { + followLink, + FollowLinkConfig, +} from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { ItemType } from '../shared/item-relationships/item-type.model'; import { RelationshipType } from '../shared/item-relationships/relationship-type.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, getRemoteDataPayload, } from '../shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../shared/operators'; import { BaseDataService } from './base/base-data.service'; import { FindAllDataImpl } from './base/find-all-data'; import { SearchDataImpl } from './base/search-data'; diff --git a/src/app/core/data/root-data.service.ts b/src/app/core/data/root-data.service.ts index 09eddcdc72..7d02fb0060 100644 --- a/src/app/core/data/root-data.service.ts +++ b/src/app/core/data/root-data.service.ts @@ -1,7 +1,12 @@ import { Injectable } from '@angular/core'; -import { RequestService } from './request.service'; -import { Observable, of as observableOf, } from 'rxjs'; -import { catchError, map, } from 'rxjs/operators'; +import { + Observable, + of as observableOf, +} from 'rxjs'; +import { + catchError, + map, +} from 'rxjs/operators'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; @@ -10,6 +15,7 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { getFirstCompletedRemoteData } from '../shared/operators'; import { BaseDataService } from './base/base-data.service'; import { RemoteData } from './remote-data'; +import { RequestService } from './request.service'; import { Root } from './root.model'; /** diff --git a/src/app/core/data/site-data.service.ts b/src/app/core/data/site-data.service.ts index 3608a0c569..2da80ed276 100644 --- a/src/app/core/data/site-data.service.ts +++ b/src/app/core/data/site-data.service.ts @@ -9,7 +9,10 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { getFirstSucceededRemoteData } from '../shared/operators'; import { Site } from '../shared/site.model'; import { BaseDataService } from './base/base-data.service'; -import { FindAllData, FindAllDataImpl, } from './base/find-all-data'; +import { + FindAllData, + FindAllDataImpl, +} from './base/find-all-data'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; diff --git a/src/app/core/data/system-wide-alert-data.service.ts b/src/app/core/data/system-wide-alert-data.service.ts index 306ad9fc6f..b0c0488ab0 100644 --- a/src/app/core/data/system-wide-alert-data.service.ts +++ b/src/app/core/data/system-wide-alert-data.service.ts @@ -8,11 +8,23 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { CreateData, CreateDataImpl, } from './base/create-data'; -import { FindAllData, FindAllDataImpl, } from './base/find-all-data'; +import { + CreateData, + CreateDataImpl, +} from './base/create-data'; +import { + FindAllData, + FindAllDataImpl, +} from './base/find-all-data'; import { IdentifiableDataService } from './base/identifiable-data.service'; -import { PutData, PutDataImpl, } from './base/put-data'; -import { SearchData, SearchDataImpl, } from './base/search-data'; +import { + PutData, + PutDataImpl, +} from './base/put-data'; +import { + SearchData, + SearchDataImpl, +} from './base/search-data'; import { FindListOptions } from './find-list-options.model'; import { PaginatedList } from './paginated-list.model'; import { RemoteData } from './remote-data'; diff --git a/src/app/core/data/version-data.service.ts b/src/app/core/data/version-data.service.ts index bb58128999..86d9276756 100644 --- a/src/app/core/data/version-data.service.ts +++ b/src/app/core/data/version-data.service.ts @@ -1,7 +1,13 @@ import { Injectable } from '@angular/core'; import { Operation } from 'fast-json-patch'; -import { EMPTY, Observable, } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + EMPTY, + Observable, +} from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { isNotEmpty } from '../../shared/empty.util'; import { followLink } from '../../shared/utils/follow-link-config.model'; @@ -12,7 +18,10 @@ import { getFirstSucceededRemoteDataPayload } from '../shared/operators'; import { Version } from '../shared/version.model'; import { VersionHistory } from '../shared/version-history.model'; import { IdentifiableDataService } from './base/identifiable-data.service'; -import { PatchData, PatchDataImpl, } from './base/patch-data'; +import { + PatchData, + PatchDataImpl, +} from './base/patch-data'; import { DefaultChangeAnalyzer } from './default-change-analyzer.service'; import { RemoteData } from './remote-data'; import { RequestService } from './request.service'; diff --git a/src/app/core/data/version-history-data.service.ts b/src/app/core/data/version-history-data.service.ts index 109f37da9b..6b9e855146 100644 --- a/src/app/core/data/version-history-data.service.ts +++ b/src/app/core/data/version-history-data.service.ts @@ -1,12 +1,23 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { Observable, of, } from 'rxjs'; -import { filter, map, switchMap, take, } from 'rxjs/operators'; +import { + Observable, + of, +} from 'rxjs'; +import { + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; import { hasValueOperator } from '../../shared/empty.util'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; -import { followLink, FollowLinkConfig, } from '../../shared/utils/follow-link-config.model'; +import { + followLink, + FollowLinkConfig, +} from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; @@ -20,7 +31,6 @@ import { } from '../shared/operators'; import { sendRequest } from '../shared/request.operators'; import { Version } from '../shared/version.model'; -import { VersionDataService } from './version-data.service'; import { VersionHistory } from '../shared/version-history.model'; import { IdentifiableDataService } from './base/identifiable-data.service'; import { FindListOptions } from './find-list-options.model'; @@ -29,6 +39,7 @@ import { RemoteData } from './remote-data'; import { PostRequest } from './request.models'; import { RequestService } from './request.service'; import { RestRequest } from './rest-request.model'; +import { VersionDataService } from './version-data.service'; /** * Service responsible for handling requests related to the VersionHistory object diff --git a/src/app/core/eperson/eperson-data.service.spec.ts b/src/app/core/eperson/eperson-data.service.spec.ts index 53baba025e..30bb3df039 100644 --- a/src/app/core/eperson/eperson-data.service.spec.ts +++ b/src/app/core/eperson/eperson-data.service.spec.ts @@ -96,10 +96,10 @@ describe('EPersonDataService', () => { { provide: ObjectCacheService, useValue: {} }, { provide: DSOChangeAnalyzer, useClass: DummyChangeAnalyzer }, { provide: NotificationsService, useClass: NotificationsServiceStub }, - ], - providers: [], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}); + ], + providers: [], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }); service = TestBed.inject(EPersonDataService); store = TestBed.inject(Store) as MockStore; diff --git a/src/app/core/eperson/eperson-data.service.ts b/src/app/core/eperson/eperson-data.service.ts index 1a77c60d18..4b03343684 100644 --- a/src/app/core/eperson/eperson-data.service.ts +++ b/src/app/core/eperson/eperson-data.service.ts @@ -32,7 +32,6 @@ import { CreateData, CreateDataImpl, } from '../data/base/create-data'; -import { dataService } from '../data/base/data-service.decorator'; import { DeleteData, DeleteDataImpl, @@ -60,24 +59,13 @@ import { import { RequestService } from '../data/request.service'; import { RestRequestMethod } from '../data/rest-request-method'; import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators'; -import { EPerson } from './models/eperson.model'; import { NoContent } from '../shared/NoContent.model'; import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../shared/operators'; import { PageInfo } from '../shared/page-info.model'; -import { FindListOptions } from '../data/find-list-options.model'; -import { CreateData, CreateDataImpl } from '../data/base/create-data'; -import { IdentifiableDataService } from '../data/base/identifiable-data.service'; -import { SearchData, SearchDataImpl } from '../data/base/search-data'; -import { PatchData, PatchDataImpl } from '../data/base/patch-data'; -import { DeleteData, DeleteDataImpl } from '../data/base/delete-data'; -import { RestRequestMethod } from '../data/rest-request-method'; -import { getEPersonEditRoute } from '../../access-control/access-control-routing-paths'; import { EPerson } from './models/eperson.model'; -import { EPERSON } from './models/eperson.resource-type'; // todo: optimize imports diff --git a/src/app/core/eperson/group-data.service.spec.ts b/src/app/core/eperson/group-data.service.spec.ts index 5a6c55ebbe..04632763d5 100644 --- a/src/app/core/eperson/group-data.service.spec.ts +++ b/src/app/core/eperson/group-data.service.spec.ts @@ -73,19 +73,19 @@ describe('GroupDataService', () => { halService = new HALEndpointServiceStub(restEndpointURL); objectCache = getMockObjectCacheService(); TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, StoreModule.forRoot({}), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - ], - providers: [], + ], + providers: [], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); } function initTestService() { diff --git a/src/app/core/eperson/group-data.service.ts b/src/app/core/eperson/group-data.service.ts index d1aa8e195d..6c9acdd00b 100644 --- a/src/app/core/eperson/group-data.service.ts +++ b/src/app/core/eperson/group-data.service.ts @@ -1,8 +1,15 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { createSelector, select, Store, } from '@ngrx/store'; +import { + createSelector, + select, + Store, +} from '@ngrx/store'; import { Operation } from 'fast-json-patch'; -import { Observable, zip as observableZip, } from 'rxjs'; +import { + Observable, + zip as observableZip, +} from 'rxjs'; import { take } from 'rxjs/operators'; import { getGroupEditRoute } from '../../access-control/access-control-routing-paths'; @@ -18,16 +25,32 @@ import { DSONameService } from '../breadcrumbs/dso-name.service'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { CreateData, CreateDataImpl, } from '../data/base/create-data'; -import { DeleteData, DeleteDataImpl, } from '../data/base/delete-data'; +import { + CreateData, + CreateDataImpl, +} from '../data/base/create-data'; +import { + DeleteData, + DeleteDataImpl, +} from '../data/base/delete-data'; import { IdentifiableDataService } from '../data/base/identifiable-data.service'; -import { PatchData, PatchDataImpl, } from '../data/base/patch-data'; -import { SearchData, SearchDataImpl, } from '../data/base/search-data'; +import { + PatchData, + PatchDataImpl, +} from '../data/base/patch-data'; +import { + SearchData, + SearchDataImpl, +} from '../data/base/search-data'; import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; import { FindListOptions } from '../data/find-list-options.model'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; -import { CreateRequest, DeleteRequest, PostRequest, } from '../data/request.models'; +import { + CreateRequest, + DeleteRequest, + PostRequest, +} from '../data/request.models'; import { RequestService } from '../data/request.service'; import { RestRequestMethod } from '../data/rest-request-method'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; diff --git a/src/app/core/feedback/feedback-data.service.ts b/src/app/core/feedback/feedback-data.service.ts index 9ca7f46902..147d6dec08 100644 --- a/src/app/core/feedback/feedback-data.service.ts +++ b/src/app/core/feedback/feedback-data.service.ts @@ -1,30 +1,35 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; -import { Feedback } from './models/feedback.model'; -import { RequestService } from '../data/request.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; -import { RequestParam } from '../cache/models/request-param.model'; +import { + RequestParam, + RequestParam, +} from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; import { CreateData, + CreateData, + CreateDataImpl, CreateDataImpl, } from '../data/base/create-data'; -import { dataService } from '../data/base/data-service.decorator'; import { IdentifiableDataService } from '../data/base/identifiable-data.service'; import { RemoteData } from '../data/remote-data'; -import { RequestParam } from '../cache/models/request-param.model'; -import { CreateData, CreateDataImpl } from '../data/base/create-data'; -import { RequestService } from '../data/request.service'; +import { + RequestService, + RequestService, +} from '../data/request.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../shared/operators'; -import { Feedback } from './models/feedback.model'; -import { FEEDBACK } from './models/feedback.resource-type'; +import { + Feedback, + Feedback, +} from './models/feedback.model'; /** * Service for checking and managing the feedback diff --git a/src/app/core/feedback/feedback.guard.ts b/src/app/core/feedback/feedback.guard.ts index 70b7497538..8446debd53 100644 --- a/src/app/core/feedback/feedback.guard.ts +++ b/src/app/core/feedback/feedback.guard.ts @@ -13,7 +13,7 @@ import { FeatureID } from '../data/feature-authorization/feature-id'; /** * An guard for redirecting users to the feedback page if user is authorized */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class FeedbackGuard implements CanActivate { constructor(private authorizationService: AuthorizationDataService) { diff --git a/src/app/core/google-recaptcha/google-recaptcha.module.ts b/src/app/core/google-recaptcha/google-recaptcha.module.ts index 9958a1e325..a459b2d6e9 100644 --- a/src/app/core/google-recaptcha/google-recaptcha.module.ts +++ b/src/app/core/google-recaptcha/google-recaptcha.module.ts @@ -13,9 +13,9 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [CommonModule, ...COMPONENTS], - providers: [...PROVIDERS], - exports: [...COMPONENTS], + imports: [CommonModule, ...COMPONENTS], + providers: [...PROVIDERS], + exports: [...COMPONENTS], }) /** diff --git a/src/app/core/google-recaptcha/google-recaptcha.service.ts b/src/app/core/google-recaptcha/google-recaptcha.service.ts index 6dd9654465..5de8add85c 100644 --- a/src/app/core/google-recaptcha/google-recaptcha.service.ts +++ b/src/app/core/google-recaptcha/google-recaptcha.service.ts @@ -34,7 +34,7 @@ export const CAPTCHA_NAME = 'google-recaptcha'; /** * A GoogleRecaptchaService used to send action and get a token from REST */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class GoogleRecaptchaService { private renderer: Renderer2; diff --git a/src/app/core/lazy-service.ts b/src/app/core/lazy-service.ts index c1da9d7287..701a1d7dac 100644 --- a/src/app/core/lazy-service.ts +++ b/src/app/core/lazy-service.ts @@ -1,5 +1,11 @@ -import { Injector, Type } from '@angular/core'; -import { defer, Observable } from 'rxjs'; +import { + Injector, + Type, +} from '@angular/core'; +import { + defer, + Observable, +} from 'rxjs'; /** * Loads a service lazily. The service is loaded when the observable is subscribed to. @@ -17,7 +23,7 @@ import { defer, Observable } from 'rxjs'; */ export function lazyService( loader: () => Promise> | Promise<{ default: Type }>, - injector: Injector + injector: Injector, ): Observable { return defer(() => { return loader() diff --git a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts index 39e201d122..b33e38752c 100644 --- a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts +++ b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts @@ -53,7 +53,7 @@ import { QUALITY_ASSURANCE_EVENT_OBJECT } from '../models/quality-assurance-even /** * The service handling all Quality Assurance topic REST requests. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(QUALITY_ASSURANCE_EVENT_OBJECT) export class QualityAssuranceEventDataService extends IdentifiableDataService { diff --git a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts index 97fbfc9ec6..e549d02876 100644 --- a/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts +++ b/src/app/core/notifications/qa/source/quality-assurance-source-data.service.ts @@ -26,7 +26,7 @@ import { QUALITY_ASSURANCE_SOURCE_OBJECT } from '../models/quality-assurance-sou /** * The service handling all Quality Assurance source REST requests. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(QUALITY_ASSURANCE_SOURCE_OBJECT) export class QualityAssuranceSourceDataService extends IdentifiableDataService { diff --git a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts index 5f2d934f64..8b15fa4ddd 100644 --- a/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts +++ b/src/app/core/notifications/qa/topics/quality-assurance-topic-data.service.ts @@ -26,7 +26,7 @@ import { QUALITY_ASSURANCE_TOPIC_OBJECT } from '../models/quality-assurance-topi /** * The service handling all Quality Assurance topic REST requests. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(QUALITY_ASSURANCE_TOPIC_OBJECT) export class QualityAssuranceTopicDataService extends IdentifiableDataService { diff --git a/src/app/core/notifications/source/suggestion-source-data.service.ts b/src/app/core/notifications/source/suggestion-source-data.service.ts index 20be764983..0dd3e43dcc 100644 --- a/src/app/core/notifications/source/suggestion-source-data.service.ts +++ b/src/app/core/notifications/source/suggestion-source-data.service.ts @@ -26,7 +26,7 @@ import { SUGGESTION_SOURCE } from '../models/suggestion-source-object.resource-t /** * Service that retrieves Suggestion Source data */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(SUGGESTION_SOURCE) export class SuggestionSourceDataService extends IdentifiableDataService { diff --git a/src/app/core/orcid/orcid-history-data.service.ts b/src/app/core/orcid/orcid-history-data.service.ts index 668e39a325..4b0497886b 100644 --- a/src/app/core/orcid/orcid-history-data.service.ts +++ b/src/app/core/orcid/orcid-history-data.service.ts @@ -1,7 +1,10 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; diff --git a/src/app/core/orcid/orcid-queue-data.service.ts b/src/app/core/orcid/orcid-queue-data.service.ts index 093f061a5e..9b03c4eba1 100644 --- a/src/app/core/orcid/orcid-queue-data.service.ts +++ b/src/app/core/orcid/orcid-queue-data.service.ts @@ -3,17 +3,23 @@ import { Observable } from 'rxjs'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { NoContent } from '../shared/NoContent.model'; -import { DeleteData, DeleteDataImpl } from '../data/base/delete-data'; -import { SearchData, SearchDataImpl } from '../data/base/search-data'; -import { IdentifiableDataService } from '../data/base/identifiable-data.service'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; +import { + DeleteData, + DeleteDataImpl, +} from '../data/base/delete-data'; +import { IdentifiableDataService } from '../data/base/identifiable-data.service'; +import { + SearchData, + SearchDataImpl, +} from '../data/base/search-data'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; import { RequestService } from '../data/request.service'; import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { NoContent } from '../shared/NoContent.model'; import { OrcidQueue } from './model/orcid-queue.model'; /** diff --git a/src/app/core/profile/researcher-profile-data.service.ts b/src/app/core/profile/researcher-profile-data.service.ts index a5fde96b38..1fd219423f 100644 --- a/src/app/core/profile/researcher-profile-data.service.ts +++ b/src/app/core/profile/researcher-profile-data.service.ts @@ -1,22 +1,50 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; -import { Operation, ReplaceOperation, } from 'fast-json-patch'; -import { Observable, of as observableOf, } from 'rxjs'; -import { find, map, mergeMap, } from 'rxjs/operators'; +import { + Operation, + ReplaceOperation, +} from 'fast-json-patch'; +import { + Observable, + of as observableOf, +} from 'rxjs'; +import { + find, + map, + mergeMap, +} from 'rxjs/operators'; -import { hasValue, isEmpty, } from '../../shared/empty.util'; +import { + hasValue, + isEmpty, +} from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { followLink, FollowLinkConfig, } from '../../shared/utils/follow-link-config.model'; +import { + followLink, + FollowLinkConfig, +} from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { CreateData, CreateDataImpl, } from '../data/base/create-data'; -import { DeleteData, DeleteDataImpl, } from '../data/base/delete-data'; +import { + CreateData, + CreateDataImpl, +} from '../data/base/create-data'; +import { + DeleteData, + DeleteDataImpl, +} from '../data/base/delete-data'; import { IdentifiableDataService } from '../data/base/identifiable-data.service'; -import { PatchData, PatchDataImpl, } from '../data/base/patch-data'; -import { SearchData, SearchDataImpl, } from '../data/base/search-data'; +import { + PatchData, + PatchDataImpl, +} from '../data/base/patch-data'; +import { + SearchData, + SearchDataImpl, +} from '../data/base/search-data'; import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; import { FindListOptions } from '../data/find-list-options.model'; import { ItemDataService } from '../data/item-data.service'; diff --git a/src/app/core/provide-core.ts b/src/app/core/provide-core.ts index d5ed0afd40..5d9a4df61e 100644 --- a/src/app/core/provide-core.ts +++ b/src/app/core/provide-core.ts @@ -1,84 +1,88 @@ -import { makeEnvironmentProviders } from '@angular/core'; -import { DspaceRestService } from './dspace-rest/dspace-rest.service'; -import { MOCK_RESPONSE_MAP, ResponseMapMock } from '../shared/mocks/dspace-rest/mocks/response-map.mock'; import { HttpClient } from '@angular/common/http'; +import { makeEnvironmentProviders } from '@angular/core'; + +import { environment } from '../../environments/environment'; +import { Itemfilter } from '../admin/admin-ldn-services/ldn-services-model/ldn-service-itemfilters'; +import { LdnService } from '../admin/admin-ldn-services/ldn-services-model/ldn-services.model'; +import { NotifyRequestsStatus } from '../item-page/simple/notify-requests-status/notify-requests-status.model'; +import { Process } from '../process-page/processes/process.model'; +import { Script } from '../process-page/scripts/script.model'; import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint-mocking-rest.service'; +import { + MOCK_RESPONSE_MAP, + ResponseMapMock, +} from '../shared/mocks/dspace-rest/mocks/response-map.mock'; +import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model'; +import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model'; +import { Subscription } from '../shared/subscriptions/models/subscription.model'; +import { SubmissionCoarNotifyConfig } from '../submission/sections/section-coar-notify/submission-coar-notify.config'; import { AuthStatus } from './auth/models/auth-status.model'; +import { ShortLivedToken } from './auth/models/short-lived-token.model'; +import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model'; +import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model'; import { SubmissionDefinitionsModel } from './config/models/config-submission-definitions.model'; import { SubmissionFormsModel } from './config/models/config-submission-forms.model'; import { SubmissionSectionModel } from './config/models/config-submission-section.model'; import { SubmissionUploadsModel } from './config/models/config-submission-uploads.model'; +import { Root } from './data/root.model'; +import { DspaceRestService } from './dspace-rest/dspace-rest.service'; import { EPerson } from './eperson/models/eperson.model'; import { Group } from './eperson/models/group.model'; import { MetadataField } from './metadata/metadata-field.model'; import { MetadataSchema } from './metadata/metadata-schema.model'; -import { BitstreamFormat } from './shared/bitstream-format.model'; +import { SuggestionSource } from './notifications/models/suggestion-source.model'; +import { SuggestionTarget } from './notifications/models/suggestion-target.model'; +import { QualityAssuranceEventObject } from './notifications/qa/models/quality-assurance-event.model'; +import { QualityAssuranceSourceObject } from './notifications/qa/models/quality-assurance-source.model'; +import { QualityAssuranceTopicObject } from './notifications/qa/models/quality-assurance-topic.model'; +import { OrcidHistory } from './orcid/model/orcid-history.model'; +import { OrcidQueue } from './orcid/model/orcid-queue.model'; +import { ResearcherProfile } from './profile/model/researcher-profile.model'; +import { ResourcePolicy } from './resource-policy/models/resource-policy.model'; +import { Authorization } from './shared/authorization.model'; import { Bitstream } from './shared/bitstream.model'; +import { BitstreamFormat } from './shared/bitstream-format.model'; import { BrowseDefinition } from './shared/browse-definition.model'; import { BrowseEntry } from './shared/browse-entry.model'; import { Bundle } from './shared/bundle.model'; import { Collection } from './shared/collection.model'; import { Community } from './shared/community.model'; +import { ConfigurationProperty } from './shared/configuration-property.model'; import { DSpaceObject } from './shared/dspace-object.model'; -import { ExternalSourceEntry } from './shared/external-source-entry.model'; import { ExternalSource } from './shared/external-source.model'; -import { ItemType } from './shared/item-relationships/item-type.model'; -import { RelationshipType } from './shared/item-relationships/relationship-type.model'; -import { Relationship } from './shared/item-relationships/relationship.model'; +import { ExternalSourceEntry } from './shared/external-source-entry.model'; +import { Feature } from './shared/feature.model'; +import { FlatBrowseDefinition } from './shared/flat-browse-definition.model'; +import { HierarchicalBrowseDefinition } from './shared/hierarchical-browse-definition.model'; import { Item } from './shared/item.model'; +import { ItemType } from './shared/item-relationships/item-type.model'; +import { Relationship } from './shared/item-relationships/relationship.model'; +import { RelationshipType } from './shared/item-relationships/relationship-type.model'; +import { ItemRequest } from './shared/item-request.model'; import { License } from './shared/license.model'; -import { ResourcePolicy } from './resource-policy/models/resource-policy.model'; +import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition'; +import { Registration } from './shared/registration.model'; +import { SearchConfig } from './shared/search/search-filters/search-config.model'; import { Site } from './shared/site.model'; -import { WorkflowItem } from './submission/models/workflowitem.model'; -import { WorkspaceItem } from './submission/models/workspaceitem.model'; -import { ClaimedTask } from './tasks/models/claimed-task-object.model'; -import { PoolTask } from './tasks/models/pool-task-object.model'; -import { TaskObject } from './tasks/models/task-object.model'; -import { environment } from '../../environments/environment'; +import { TemplateItem } from './shared/template-item.model'; +import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model'; import { Version } from './shared/version.model'; import { VersionHistory } from './shared/version-history.model'; -import { Script } from '../process-page/scripts/script.model'; -import { Process } from '../process-page/processes/process.model'; -import { WorkflowAction } from './tasks/models/workflow-action-object.model'; -import { TemplateItem } from './shared/template-item.model'; -import { Feature } from './shared/feature.model'; -import { Authorization } from './shared/authorization.model'; -import { Registration } from './shared/registration.model'; +import { UsageReport } from './statistics/models/usage-report.model'; import { SubmissionCcLicence } from './submission/models/submission-cc-license.model'; import { SubmissionCcLicenceUrl } from './submission/models/submission-cc-license-url.model'; -import { VocabularyEntry } from './submission/vocabularies/models/vocabulary-entry.model'; +import { WorkflowItem } from './submission/models/workflowitem.model'; +import { WorkspaceItem } from './submission/models/workspaceitem.model'; import { Vocabulary } from './submission/vocabularies/models/vocabulary.model'; +import { VocabularyEntry } from './submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyEntryDetail } from './submission/vocabularies/models/vocabulary-entry-detail.model'; -import { ConfigurationProperty } from './shared/configuration-property.model'; -import { ShortLivedToken } from './auth/models/short-lived-token.model'; -import { UsageReport } from './statistics/models/usage-report.model'; -import { Root } from './data/root.model'; -import { SearchConfig } from './shared/search/search-filters/search-config.model'; -import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model'; -import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model'; import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model'; +import { ClaimedTask } from './tasks/models/claimed-task-object.model'; +import { PoolTask } from './tasks/models/pool-task-object.model'; +import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model'; import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model'; -import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model'; -import { ResearcherProfile } from './profile/model/researcher-profile.model'; -import { OrcidQueue } from './orcid/model/orcid-queue.model'; -import { OrcidHistory } from './orcid/model/orcid-history.model'; -import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model'; -import { Subscription } from '../shared/subscriptions/models/subscription.model'; -import { ItemRequest } from './shared/item-request.model'; -import { HierarchicalBrowseDefinition } from './shared/hierarchical-browse-definition.model'; -import { FlatBrowseDefinition } from './shared/flat-browse-definition.model'; -import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model'; -import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition'; -import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model'; -import { QualityAssuranceTopicObject } from './notifications/qa/models/quality-assurance-topic.model'; -import { QualityAssuranceEventObject } from './notifications/qa/models/quality-assurance-event.model'; -import { QualityAssuranceSourceObject } from './notifications/qa/models/quality-assurance-source.model'; -import { SuggestionTarget } from './notifications/models/suggestion-target.model'; -import { SuggestionSource } from './notifications/models/suggestion-source.model'; -import { LdnService } from '../admin/admin-ldn-services/ldn-services-model/ldn-services.model'; -import { Itemfilter } from '../admin/admin-ldn-services/ldn-services-model/ldn-service-itemfilters'; -import { SubmissionCoarNotifyConfig } from '../submission/sections/section-coar-notify/submission-coar-notify.config'; -import { NotifyRequestsStatus } from '../item-page/simple/notify-requests-status/notify-requests-status.model'; +import { TaskObject } from './tasks/models/task-object.model'; +import { WorkflowAction } from './tasks/models/workflow-action-object.model'; export const provideCore = () => { diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index 563d6853b6..9bac2af51d 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -1,9 +1,15 @@ import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { Store, StoreModule, } from '@ngrx/store'; +import { + Store, + StoreModule, +} from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { MetadataRegistryCancelFieldAction, @@ -19,7 +25,10 @@ import { } from '../../admin/admin-registries/metadata-registry/metadata-registry.actions'; import { storeModuleConfig } from '../../app.reducer'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { createNoContentRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; +import { + createNoContentRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { StoreMock } from '../../shared/testing/store.mock'; import { createPaginatedList } from '../../shared/testing/utils.test'; @@ -33,9 +42,9 @@ import { NoContent } from '../shared/NoContent.model'; import { RegistryService } from './registry.service'; @Component({ - template: '', - standalone: true, - imports: [CommonModule] + template: '', + standalone: true, + imports: [CommonModule], }) class DummyComponent { } @@ -149,16 +158,16 @@ describe('RegistryService', () => { beforeEach(() => { init(); TestBed.configureTestingModule({ - imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot(), DummyComponent, + imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot(), DummyComponent, ], - providers: [ + providers: [ { provide: Store, useClass: StoreMock }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: MetadataSchemaDataService, useValue: metadataSchemaService }, { provide: MetadataFieldDataService, useValue: metadataFieldService }, RegistryService, ], -}); + }); registryService = TestBed.inject(RegistryService); mockStore = TestBed.inject(Store); }); diff --git a/src/app/core/resource-policy/resource-policy-data.service.ts b/src/app/core/resource-policy/resource-policy-data.service.ts index 52fffd3c06..e0f32809f0 100644 --- a/src/app/core/resource-policy/resource-policy-data.service.ts +++ b/src/app/core/resource-policy/resource-policy-data.service.ts @@ -1,7 +1,10 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { first, map, } from 'rxjs/operators'; +import { + first, + map, +} from 'rxjs/operators'; import { isNotEmpty } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; diff --git a/src/app/core/services/window.service.ts b/src/app/core/services/window.service.ts index 1a7676fe75..ea7297aafa 100644 --- a/src/app/core/services/window.service.ts +++ b/src/app/core/services/window.service.ts @@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core'; export const NativeWindowService = new InjectionToken('NativeWindowService', { providedIn: 'root', - factory: NativeWindowFactory + factory: NativeWindowFactory, }); export class NativeWindowRef { diff --git a/src/app/core/shared/listable.module.ts b/src/app/core/shared/listable.module.ts index f417e9099a..295e84905b 100644 --- a/src/app/core/shared/listable.module.ts +++ b/src/app/core/shared/listable.module.ts @@ -1,314 +1,127 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { BitstreamListItemComponent } from '../../shared/object-list/bitstream-list-item/bitstream-list-item.component'; -import { - BrowseEntryListElementComponent -} from '../../shared/object-list/browse-entry-list-element/browse-entry-list-element.component'; -import { BundleListElementComponent } from '../../shared/object-list/bundle-list-element/bundle-list-element.component'; -import { - CollectionAdminSearchResultGridElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component'; -import { - CollectionAdminSearchResultListElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component'; -import { - CollectionGridElementComponent -} from '../../shared/object-grid/collection-grid-element/collection-grid-element.component'; -import { - CollectionListElementComponent -} from '../../shared/object-list/collection-list-element/collection-list-element.component'; -import { - CollectionSearchResultGridElementComponent -} from '../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component'; -import { - CollectionSearchResultListElementComponent -} from '../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component'; -import { - CollectionSidebarSearchListElementComponent -} from '../../shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component'; -import { - CommunityAdminSearchResultGridElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component'; -import { - CommunityAdminSearchResultListElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component'; -import { - CommunityGridElementComponent -} from '../../shared/object-grid/community-grid-element/community-grid-element.component'; -import { - CommunityListElementComponent -} from '../../shared/object-list/community-list-element/community-list-element.component'; -import { - CommunitySearchResultGridElementComponent -} from '../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'; -import { - CommunitySearchResultListElementComponent -} from '../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component'; -import { - CommunitySidebarSearchListElementComponent -} from '../../shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component'; -import { - ExternalSourceEntryListSubmissionElementComponent -} from '../../entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component'; -import { - ItemAdminSearchResultGridElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component'; -import { - ItemAdminSearchResultListElementComponent -} from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component'; -import { - ItemGridElementComponent -} from '../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; -import { - ItemListElementComponent -} from '../../shared/object-list/item-list-element/item-types/item/item-list-element.component'; -import { - ItemSearchResultGridElementComponent -} from '../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { - ItemSearchResultListElementComponent -} from '../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { JournalComponent } from '../../entity-groups/journal-entities/item-pages/journal/journal.component'; -import { - JournalGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component'; -import { - JournalIssueComponent -} from '../../entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component'; -import { - JournalIssueGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component'; -import { - JournalIssueListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component'; -import { - JournalIssueSearchResultGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component'; -import { - JournalIssueSearchResultListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component'; -import { - JournalIssueSidebarSearchListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component'; -import { - JournalListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component'; -import { - JournalSearchResultGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component'; -import { - JournalSearchResultListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component'; -import { - JournalSidebarSearchListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component'; -import { - JournalVolumeComponent -} from '../../entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component'; -import { - JournalVolumeGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component'; -import { - JournalVolumeListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component'; -import { - JournalVolumeSearchResultGridElementComponent -} from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component'; -import { - JournalVolumeSearchResultListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; -import { - JournalVolumeSidebarSearchListElementComponent -} from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component'; -import { - ListableNotificationObjectComponent -} from '../../shared/object-list/listable-notification-object/listable-notification-object.component'; -import { OrgUnitComponent } from '../../entity-groups/research-entities/item-pages/org-unit/org-unit.component'; -import { - OrgUnitGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component'; -import { - OrgUnitListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component'; -import { - OrgUnitSearchResultGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component'; -import { - OrgUnitSearchResultListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component'; -import { - OrgUnitSearchResultListSubmissionElementComponent -} from '../../entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component'; -import { - OrgUnitSidebarSearchListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component'; -import { PersonComponent } from '../../entity-groups/research-entities/item-pages/person/person.component'; -import { - PersonGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/person/person-grid-element.component'; -import { - PersonListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/person/person-list-element.component'; -import { - PersonSearchResultGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component'; -import { - PersonSearchResultListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component'; -import { - PersonSearchResultListSubmissionElementComponent -} from '../../entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component'; -import { - PersonSidebarSearchListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component'; -import { ProjectComponent } from '../../entity-groups/research-entities/item-pages/project/project.component'; -import { - ProjectGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/project/project-grid-element.component'; -import { - ProjectListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/project/project-list-element.component'; -import { - ProjectSearchResultGridElementComponent -} from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component'; -import { - ProjectSearchResultListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component'; -import { - ProjectSidebarSearchListElementComponent -} from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component'; -import { - PublicationSidebarSearchListElementComponent -} from '../../shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component'; -import { - WorkflowItemSearchResultAdminWorkflowListElementComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component'; -import { - WorkflowItemSearchResultAdminWorkflowGridElementComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component'; -import { - WorkspaceItemSearchResultAdminWorkflowListElementComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component'; -import { - WorkspaceItemSearchResultAdminWorkflowGridElementComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component'; -import { - WorkspaceItemSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component'; -import { - WorkflowItemSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component'; -import { - ClaimedSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component'; -import { - ClaimedApprovedSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component'; -import { - ClaimedDeclinedSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component'; -import { - ClaimedDeclinedTaskSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component'; -import { - PoolSearchResultListElementComponent -} from '../../shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component'; -import { - ItemSearchResultDetailElementComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component'; -import { - WorkspaceItemSearchResultDetailElementComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component'; -import { - WorkflowItemSearchResultDetailElementComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component'; -import { - ClaimedTaskSearchResultDetailElementComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component'; -import { - PoolSearchResultDetailElementComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component'; -import { - ItemSearchResultListElementSubmissionComponent -} from '../../shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { ThumbnailComponent } from '../../thumbnail/thumbnail.component'; -import { BadgesComponent } from '../../shared/object-collection/shared/badges/badges.component'; -import { ThemedBadgesComponent } from '../../shared/object-collection/shared/badges/themed-badges.component'; -import { - ItemDetailPreviewComponent -} from '../../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component'; -import { - GenericItemPageFieldComponent -} from '../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from '../../item-page/simple/related-items/related-items-component'; -import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { - WorkspaceitemActionsComponent -} from '../../shared/mydspace-actions/workspaceitem/workspaceitem-actions.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { RouterModule } from '@angular/router'; -import { - WorkflowitemActionsComponent -} from '../../shared/mydspace-actions/workflowitem/workflowitem-actions.component'; -import { PoolTaskActionsComponent } from '../../shared/mydspace-actions/pool-task/pool-task-actions.component'; -import { - ThemedItemListPreviewComponent -} from '../../shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component'; -import { - OrgUnitInputSuggestionsComponent -} from '../../entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component'; -import { - ThemedMetadataRepresentationListComponent -} from '../../item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; -import { ClaimedTaskActionsComponent } from '../../shared/mydspace-actions/claimed-task/claimed-task-actions.component'; -import { - ItemAdminSearchResultActionsComponent -} from '../../admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component'; -import { MetadataFieldWrapperComponent } from '../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../shared/results-back-button/themed-results-back-button.component'; -import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { ItemActionsComponent } from '../../shared/mydspace-actions/item/item-actions.component'; -import { - PersonInputSuggestionsComponent -} from '../../entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { - WorkspaceItemAdminWorkflowActionsComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component'; -import { - WorkflowItemAdminWorkflowActionsComponent -} from '../../admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component'; +import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { CollectionAdminSearchResultGridElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component'; +import { CommunityAdminSearchResultGridElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component'; +import { ItemAdminSearchResultGridElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component'; +import { CollectionAdminSearchResultListElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/collection-search-result/collection-admin-search-result-list-element.component'; +import { CommunityAdminSearchResultListElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component'; +import { ItemAdminSearchResultListElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component'; +import { ItemAdminSearchResultActionsComponent } from '../../admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component'; +import { WorkflowItemAdminWorkflowActionsComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component'; +import { WorkspaceItemAdminWorkflowActionsComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component'; +import { WorkflowItemSearchResultAdminWorkflowGridElementComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workflow-item/workflow-item-search-result-admin-workflow-grid-element.component'; +import { WorkspaceItemSearchResultAdminWorkflowGridElementComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-grid-element/workspace-item/workspace-item-search-result-admin-workflow-grid-element.component'; +import { WorkflowItemSearchResultAdminWorkflowListElementComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workflow-item/workflow-item-search-result-admin-workflow-list-element.component'; +import { WorkspaceItemSearchResultAdminWorkflowListElementComponent } from '../../admin/admin-workflow-page/admin-workflow-search-results/admin-workflow-search-result-list-element/workspace-item/workspace-item-search-result-admin-workflow-list-element.component'; +import { JournalGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component'; +import { JournalIssueGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component'; +import { JournalVolumeGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component'; +import { JournalSearchResultGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component'; +import { JournalIssueSearchResultGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component'; +import { JournalVolumeSearchResultGridElementComponent } from '../../entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component'; +import { JournalListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component'; +import { JournalIssueListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component'; +import { JournalVolumeListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component'; +import { JournalSearchResultListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component'; +import { JournalIssueSearchResultListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component'; +import { JournalVolumeSearchResultListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; +import { JournalSidebarSearchListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component'; +import { JournalIssueSidebarSearchListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component'; +import { JournalVolumeSidebarSearchListElementComponent } from '../../entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component'; +import { JournalComponent } from '../../entity-groups/journal-entities/item-pages/journal/journal.component'; +import { JournalIssueComponent } from '../../entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component'; +import { JournalVolumeComponent } from '../../entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component'; +import { OrgUnitGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component'; +import { PersonGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/person/person-grid-element.component'; +import { ProjectGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/project/project-grid-element.component'; +import { OrgUnitSearchResultGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component'; +import { PersonSearchResultGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component'; +import { ProjectSearchResultGridElementComponent } from '../../entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component'; +import { OrgUnitListElementComponent } from '../../entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component'; +import { PersonListElementComponent } from '../../entity-groups/research-entities/item-list-elements/person/person-list-element.component'; +import { ProjectListElementComponent } from '../../entity-groups/research-entities/item-list-elements/project/project-list-element.component'; +import { OrgUnitSearchResultListElementComponent } from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component'; +import { PersonSearchResultListElementComponent } from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component'; +import { ProjectSearchResultListElementComponent } from '../../entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component'; +import { OrgUnitSidebarSearchListElementComponent } from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component'; +import { PersonSidebarSearchListElementComponent } from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component'; +import { ProjectSidebarSearchListElementComponent } from '../../entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component'; +import { OrgUnitComponent } from '../../entity-groups/research-entities/item-pages/org-unit/org-unit.component'; +import { PersonComponent } from '../../entity-groups/research-entities/item-pages/person/person.component'; +import { ProjectComponent } from '../../entity-groups/research-entities/item-pages/project/project.component'; +import { ExternalSourceEntryListSubmissionElementComponent } from '../../entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component'; +import { OrgUnitSearchResultListSubmissionElementComponent } from '../../entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component'; +import { OrgUnitInputSuggestionsComponent } from '../../entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component'; +import { PersonSearchResultListSubmissionElementComponent } from '../../entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component'; +import { PersonInputSuggestionsComponent } from '../../entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component'; +import { CollectionsComponent } from '../../item-page/field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../item-page/media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../item-page/mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../item-page/simple/field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageDateFieldComponent } from '../../item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; import { PublicationComponent } from '../../item-page/simple/item-types/publication/publication.component'; import { UntypedItemComponent } from '../../item-page/simple/item-types/untyped-item/untyped-item.component'; -import { MiradorViewerComponent } from '../../item-page/mirador-viewer/mirador-viewer.component'; -import { ThemedMediaViewerComponent } from '../../item-page/media-viewer/themed-media-viewer.component'; -import { - ThemedFileSectionComponent -} from '../../item-page/simple/field-components/file-section/themed-file-section.component'; -import { - ItemPageDateFieldComponent -} from '../../item-page/simple/field-components/specific-field/date/item-page-date-field.component'; -import { - ItemPageAbstractFieldComponent -} from '../../item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; -import { - ItemPageUriFieldComponent -} from '../../item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; -import { CollectionsComponent } from '../../item-page/field-components/collections/collections.component'; +import { ThemedMetadataRepresentationListComponent } from '../../item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { TabbedRelatedEntitiesSearchComponent } from '../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { RelatedItemsComponent } from '../../item-page/simple/related-items/related-items-component'; +import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { ClaimedTaskActionsComponent } from '../../shared/mydspace-actions/claimed-task/claimed-task-actions.component'; +import { ItemActionsComponent } from '../../shared/mydspace-actions/item/item-actions.component'; +import { PoolTaskActionsComponent } from '../../shared/mydspace-actions/pool-task/pool-task-actions.component'; +import { WorkflowitemActionsComponent } from '../../shared/mydspace-actions/workflowitem/workflowitem-actions.component'; +import { WorkspaceitemActionsComponent } from '../../shared/mydspace-actions/workspaceitem/workspaceitem-actions.component'; +import { BadgesComponent } from '../../shared/object-collection/shared/badges/badges.component'; +import { ThemedBadgesComponent } from '../../shared/object-collection/shared/badges/themed-badges.component'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ClaimedTaskSearchResultDetailElementComponent } from '../../shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component'; +import { ItemDetailPreviewComponent } from '../../shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component'; +import { ItemSearchResultDetailElementComponent } from '../../shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component'; +import { PoolSearchResultDetailElementComponent } from '../../shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component'; +import { WorkflowItemSearchResultDetailElementComponent } from '../../shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component'; +import { WorkspaceItemSearchResultDetailElementComponent } from '../../shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component'; +import { CollectionGridElementComponent } from '../../shared/object-grid/collection-grid-element/collection-grid-element.component'; +import { CommunityGridElementComponent } from '../../shared/object-grid/community-grid-element/community-grid-element.component'; +import { ItemGridElementComponent } from '../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component'; +import { CollectionSearchResultGridElementComponent } from '../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component'; +import { CommunitySearchResultGridElementComponent } from '../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component'; +import { ItemSearchResultGridElementComponent } from '../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; +import { BitstreamListItemComponent } from '../../shared/object-list/bitstream-list-item/bitstream-list-item.component'; +import { BrowseEntryListElementComponent } from '../../shared/object-list/browse-entry-list-element/browse-entry-list-element.component'; +import { BundleListElementComponent } from '../../shared/object-list/bundle-list-element/bundle-list-element.component'; +import { CollectionListElementComponent } from '../../shared/object-list/collection-list-element/collection-list-element.component'; +import { CommunityListElementComponent } from '../../shared/object-list/community-list-element/community-list-element.component'; +import { ItemListElementComponent } from '../../shared/object-list/item-list-element/item-types/item/item-list-element.component'; +import { ListableNotificationObjectComponent } from '../../shared/object-list/listable-notification-object/listable-notification-object.component'; +import { ClaimedApprovedSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component'; +import { ClaimedDeclinedSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component'; +import { ClaimedDeclinedTaskSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component'; +import { ClaimedSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component'; +import { ThemedItemListPreviewComponent } from '../../shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component'; +import { ItemSearchResultListElementSubmissionComponent } from '../../shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component'; +import { PoolSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component'; +import { WorkflowItemSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component'; +import { WorkspaceItemSearchResultListElementComponent } from '../../shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component'; +import { CollectionSearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component'; +import { CommunitySearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component'; +import { ItemSearchResultListElementComponent } from '../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { CollectionSidebarSearchListElementComponent } from '../../shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component'; +import { CommunitySidebarSearchListElementComponent } from '../../shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component'; +import { PublicationSidebarSearchListElementComponent } from '../../shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component'; +import { ThemedResultsBackButtonComponent } from '../../shared/results-back-button/themed-results-back-button.component'; +import { TruncatableComponent } from '../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../thumbnail/themed-thumbnail.component'; +import { ThumbnailComponent } from '../../thumbnail/thumbnail.component'; const ENTRY_COMPONENTS = [ BitstreamListItemComponent, @@ -393,53 +206,53 @@ const ENTRY_COMPONENTS = [ PoolSearchResultDetailElementComponent, ItemSearchResultListElementSubmissionComponent, PublicationComponent, - UntypedItemComponent + UntypedItemComponent, ]; @NgModule({ - exports: [...ENTRY_COMPONENTS], - imports: [ - CommonModule, - RouterModule, - TranslateModule, - ThemedLoadingComponent, - TruncatableComponent, - TruncatablePartComponent, - ThumbnailComponent, - BadgesComponent, - ThemedBadgesComponent, - ItemDetailPreviewComponent, - GenericItemPageFieldComponent, - RelatedItemsComponent, - WorkspaceitemActionsComponent, - ListableObjectComponentLoaderComponent, - PoolTaskActionsComponent, - ThemedItemListPreviewComponent, - OrgUnitInputSuggestionsComponent, - ThemedMetadataRepresentationListComponent, - ClaimedTaskActionsComponent, - WorkflowitemActionsComponent, - ItemAdminSearchResultActionsComponent, - MetadataFieldWrapperComponent, - ThemedThumbnailComponent, - ThemedItemPageTitleFieldComponent, - ThemedResultsBackButtonComponent, - DsoEditMenuComponent, - ItemActionsComponent, - PersonInputSuggestionsComponent, - TabbedRelatedEntitiesSearchComponent, - WorkspaceItemAdminWorkflowActionsComponent, - WorkflowItemAdminWorkflowActionsComponent, - FormsModule, - MiradorViewerComponent, - ThemedMediaViewerComponent, - ThemedFileSectionComponent, - ItemPageDateFieldComponent, - ItemPageAbstractFieldComponent, - ItemPageUriFieldComponent, - CollectionsComponent, - ...ENTRY_COMPONENTS - ] + exports: [...ENTRY_COMPONENTS], + imports: [ + CommonModule, + RouterModule, + TranslateModule, + ThemedLoadingComponent, + TruncatableComponent, + TruncatablePartComponent, + ThumbnailComponent, + BadgesComponent, + ThemedBadgesComponent, + ItemDetailPreviewComponent, + GenericItemPageFieldComponent, + RelatedItemsComponent, + WorkspaceitemActionsComponent, + ListableObjectComponentLoaderComponent, + PoolTaskActionsComponent, + ThemedItemListPreviewComponent, + OrgUnitInputSuggestionsComponent, + ThemedMetadataRepresentationListComponent, + ClaimedTaskActionsComponent, + WorkflowitemActionsComponent, + ItemAdminSearchResultActionsComponent, + MetadataFieldWrapperComponent, + ThemedThumbnailComponent, + ThemedItemPageTitleFieldComponent, + ThemedResultsBackButtonComponent, + DsoEditMenuComponent, + ItemActionsComponent, + PersonInputSuggestionsComponent, + TabbedRelatedEntitiesSearchComponent, + WorkspaceItemAdminWorkflowActionsComponent, + WorkflowItemAdminWorkflowActionsComponent, + FormsModule, + MiradorViewerComponent, + ThemedMediaViewerComponent, + ThemedFileSectionComponent, + ItemPageDateFieldComponent, + ItemPageAbstractFieldComponent, + ItemPageUriFieldComponent, + CollectionsComponent, + ...ENTRY_COMPONENTS, + ], }) export class ListableModule { /** @@ -449,7 +262,7 @@ export class ListableModule { static withEntryComponents() { return { ngModule: ListableModule, - providers: ENTRY_COMPONENTS.map((component) => ({provide: component})) + providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })), }; } } diff --git a/src/app/core/shared/non-hierarchical-browse-definition.ts b/src/app/core/shared/non-hierarchical-browse-definition.ts index 1f398128dc..769d70629d 100644 --- a/src/app/core/shared/non-hierarchical-browse-definition.ts +++ b/src/app/core/shared/non-hierarchical-browse-definition.ts @@ -1,8 +1,12 @@ -import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; -import { SortOption } from './sort-option.model'; +import { + autoserialize, + autoserializeAs, + inheritSerialization, +} from 'cerialize'; import { BrowseByDataType } from '../../browse-by/browse-by-switcher/browse-by-data-type'; import { BrowseDefinition } from './browse-definition.model'; +import { SortOption } from './sort-option.model'; /** * Super class for NonHierarchicalBrowseDefinition models, diff --git a/src/app/core/shared/search/search.service.spec.ts b/src/app/core/shared/search/search.service.spec.ts index 7762736191..64b305ff64 100644 --- a/src/app/core/shared/search/search.service.spec.ts +++ b/src/app/core/shared/search/search.service.spec.ts @@ -1,10 +1,17 @@ import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { Router, UrlTree, } from '@angular/router'; +import { + Router, + UrlTree, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { Angulartics2 } from 'angulartics2'; -import { combineLatest as observableCombineLatest, Observable, of as observableOf, } from 'rxjs'; +import { + combineLatest as observableCombineLatest, + Observable, + of as observableOf, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { getMockRequestService } from '../../../shared/mocks/request.service.mock'; @@ -31,9 +38,9 @@ import { SearchConfigurationService } from './search-configuration.service'; import anything = jasmine.anything; @Component({ - template: '', - standalone: true, - imports: [CommonModule] + template: '', + standalone: true, + imports: [CommonModule], }) class DummyComponent { } @@ -46,27 +53,27 @@ describe('SearchService', () => { const searchConfigService = { paginationID: 'page-id' }; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - RouterTestingModule.withRoutes([ + imports: [ + CommonModule, + RouterTestingModule.withRoutes([ { path: 'search', component: DummyComponent, pathMatch: 'full' }, - ]), - DummyComponent - ], - providers: [ - { provide: Router, useValue: router }, - { provide: RouteService, useValue: routeServiceStub }, - { provide: RequestService, useValue: getMockRequestService() }, - { provide: RemoteDataBuildService, useValue: {} }, - { provide: HALEndpointService, useValue: {} }, - { provide: CommunityDataService, useValue: {} }, - { provide: DSpaceObjectDataService, useValue: {} }, - { provide: PaginationService, useValue: {} }, - { provide: SearchConfigurationService, useValue: searchConfigService }, - { provide: Angulartics2, useValue: {} }, - SearchService, - ] -}); + ]), + DummyComponent, + ], + providers: [ + { provide: Router, useValue: router }, + { provide: RouteService, useValue: routeServiceStub }, + { provide: RequestService, useValue: getMockRequestService() }, + { provide: RemoteDataBuildService, useValue: {} }, + { provide: HALEndpointService, useValue: {} }, + { provide: CommunityDataService, useValue: {} }, + { provide: DSpaceObjectDataService, useValue: {} }, + { provide: PaginationService, useValue: {} }, + { provide: SearchConfigurationService, useValue: searchConfigService }, + { provide: Angulartics2, useValue: {} }, + SearchService, + ], + }); searchService = TestBed.inject(SearchService); }); @@ -113,27 +120,27 @@ describe('SearchService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - RouterTestingModule.withRoutes([ + imports: [ + CommonModule, + RouterTestingModule.withRoutes([ { path: 'search', component: DummyComponent, pathMatch: 'full' }, - ]), - DummyComponent - ], - providers: [ - { provide: Router, useValue: router }, - { provide: RouteService, useValue: routeServiceStub }, - { provide: RequestService, useValue: requestService }, - { provide: RemoteDataBuildService, useValue: remoteDataBuildService }, - { provide: HALEndpointService, useValue: halService }, - { provide: CommunityDataService, useValue: {} }, - { provide: DSpaceObjectDataService, useValue: {} }, - { provide: PaginationService, useValue: paginationService }, - { provide: SearchConfigurationService, useValue: searchConfigService }, - { provide: Angulartics2, useValue: {} }, - SearchService, - ] -}); + ]), + DummyComponent, + ], + providers: [ + { provide: Router, useValue: router }, + { provide: RouteService, useValue: routeServiceStub }, + { provide: RequestService, useValue: requestService }, + { provide: RemoteDataBuildService, useValue: remoteDataBuildService }, + { provide: HALEndpointService, useValue: halService }, + { provide: CommunityDataService, useValue: {} }, + { provide: DSpaceObjectDataService, useValue: {} }, + { provide: PaginationService, useValue: paginationService }, + { provide: SearchConfigurationService, useValue: searchConfigService }, + { provide: Angulartics2, useValue: {} }, + SearchService, + ], + }); searchService = TestBed.inject(SearchService); routeService = TestBed.inject(RouteService); const urlTree = Object.assign(new UrlTree(), { root: { children: { primary: 'search' } } }); diff --git a/src/app/core/statistics/usage-report-data.service.ts b/src/app/core/statistics/usage-report-data.service.ts index ffc7793a9e..457b33f4ec 100644 --- a/src/app/core/statistics/usage-report-data.service.ts +++ b/src/app/core/statistics/usage-report-data.service.ts @@ -5,15 +5,21 @@ import { map } from 'rxjs/operators'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RequestService } from '../data/request.service'; -import { UsageReport } from './models/usage-report.model'; -import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators'; import { IdentifiableDataService } from '../data/base/identifiable-data.service'; -import { SearchData, SearchDataImpl, } from '../data/base/search-data'; +import { + SearchData, + SearchDataImpl, +} from '../data/base/search-data'; import { FindListOptions } from '../data/find-list-options.model'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; +import { RequestService } from '../data/request.service'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../shared/operators'; +import { UsageReport } from './models/usage-report.model'; /** * A service to retrieve {@link UsageReport}s from the REST API diff --git a/src/app/core/submission/correctiontype-data.service.ts b/src/app/core/submission/correctiontype-data.service.ts index c167a5a898..335ef46f4f 100644 --- a/src/app/core/submission/correctiontype-data.service.ts +++ b/src/app/core/submission/correctiontype-data.service.ts @@ -25,7 +25,7 @@ import { CorrectionType } from './models/correctiontype.model'; /** * A service that provides methods to make REST requests with correctiontypes endpoint. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(CorrectionType.type) export class CorrectionTypeDataService extends IdentifiableDataService { protected linkPath = 'correctiontypes'; diff --git a/src/app/core/submission/submission-cc-license-data.service.ts b/src/app/core/submission/submission-cc-license-data.service.ts index 04aaaeec05..2ecddf1b09 100644 --- a/src/app/core/submission/submission-cc-license-data.service.ts +++ b/src/app/core/submission/submission-cc-license-data.service.ts @@ -4,14 +4,17 @@ import { Observable } from 'rxjs'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RequestService } from '../data/request.service'; -import { SubmissionCcLicence } from './models/submission-cc-license.model'; import { BaseDataService } from '../data/base/base-data.service'; -import { FindAllData, FindAllDataImpl, } from '../data/base/find-all-data'; +import { + FindAllData, + FindAllDataImpl, +} from '../data/base/find-all-data'; import { FindListOptions } from '../data/find-list-options.model'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; +import { RequestService } from '../data/request.service'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { SubmissionCcLicence } from './models/submission-cc-license.model'; @Injectable({ providedIn: 'root' }) export class SubmissionCcLicenseDataService extends BaseDataService implements FindAllData { diff --git a/src/app/core/submission/submission-cc-license-url-data.service.ts b/src/app/core/submission/submission-cc-license-url-data.service.ts index 575633b1ab..94c3b39365 100644 --- a/src/app/core/submission/submission-cc-license-url-data.service.ts +++ b/src/app/core/submission/submission-cc-license-url-data.service.ts @@ -1,20 +1,33 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { RequestService } from '../data/request.service'; -import { SubmissionCcLicenceUrl } from './models/submission-cc-license-url.model'; -import { Field, Option, SubmissionCcLicence } from './models/submission-cc-license.model'; -import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators'; import { BaseDataService } from '../data/base/base-data.service'; -import { SearchData, SearchDataImpl, } from '../data/base/search-data'; +import { + SearchData, + SearchDataImpl, +} from '../data/base/search-data'; import { FindListOptions } from '../data/find-list-options.model'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; +import { RequestService } from '../data/request.service'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../shared/operators'; +import { + Field, + Option, + SubmissionCcLicence, +} from './models/submission-cc-license.model'; +import { SubmissionCcLicenceUrl } from './models/submission-cc-license-url.model'; @Injectable({ providedIn: 'root' }) export class SubmissionCcLicenseUrlDataService extends BaseDataService implements SearchData { diff --git a/src/app/core/submission/vocabularies/vocabulary-entry-details.data.service.ts b/src/app/core/submission/vocabularies/vocabulary-entry-details.data.service.ts index 74313e96e8..2b1b796b72 100644 --- a/src/app/core/submission/vocabularies/vocabulary-entry-details.data.service.ts +++ b/src/app/core/submission/vocabularies/vocabulary-entry-details.data.service.ts @@ -11,9 +11,15 @@ import { Observable } from 'rxjs'; import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../cache/object-cache.service'; -import { FindAllData, FindAllDataImpl, } from '../../data/base/find-all-data'; +import { + FindAllData, + FindAllDataImpl, +} from '../../data/base/find-all-data'; import { IdentifiableDataService } from '../../data/base/identifiable-data.service'; -import { SearchData, SearchDataImpl, } from '../../data/base/search-data'; +import { + SearchData, + SearchDataImpl, +} from '../../data/base/search-data'; import { FindListOptions } from '../../data/find-list-options.model'; import { PaginatedList } from '../../data/paginated-list.model'; import { RemoteData } from '../../data/remote-data'; diff --git a/src/app/core/submission/vocabularies/vocabulary.data.service.ts b/src/app/core/submission/vocabularies/vocabulary.data.service.ts index 6d08a9c3f0..57669d9349 100644 --- a/src/app/core/submission/vocabularies/vocabulary.data.service.ts +++ b/src/app/core/submission/vocabularies/vocabulary.data.service.ts @@ -12,7 +12,6 @@ import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service'; import { RequestParam } from '../../cache/models/request-param.model'; import { ObjectCacheService } from '../../cache/object-cache.service'; -import { dataService } from '../../data/base/data-service.decorator'; import { FindAllData, FindAllDataImpl, @@ -24,7 +23,6 @@ import { PaginatedList } from '../../data/paginated-list.model'; import { RemoteData } from '../../data/remote-data'; import { RequestService } from '../../data/request.service'; import { HALEndpointService } from '../../shared/hal-endpoint.service'; -import { VOCABULARY } from './models/vocabularies.resource-type'; import { Vocabulary } from './models/vocabulary.model'; /** diff --git a/src/app/core/submission/workflowitem-data.service.ts b/src/app/core/submission/workflowitem-data.service.ts index ff33e64812..88846ee290 100644 --- a/src/app/core/submission/workflowitem-data.service.ts +++ b/src/app/core/submission/workflowitem-data.service.ts @@ -11,7 +11,6 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { dataService } from '../data/base/data-service.decorator'; import { DeleteData, DeleteDataImpl, diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index b372f7550d..c952147567 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -4,13 +4,6 @@ import { } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; -import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; -import { RequestService } from '../data/request.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { ObjectCacheService } from '../cache/object-cache.service'; -import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; -import { WorkspaceItem } from './models/workspaceitem.model'; import { Observable } from 'rxjs'; import { find, @@ -18,13 +11,21 @@ import { } from 'rxjs/operators'; import { hasValue } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; -import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; +import { + RemoteDataBuildService, + RemoteDataBuildService, +} from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; -import { ObjectCacheService } from '../cache/object-cache.service'; +import { + ObjectCacheService, + ObjectCacheService, +} from '../cache/object-cache.service'; import { CoreState } from '../core-state.model'; -import { dataService } from '../data/base/data-service.decorator'; import { DeleteData, DeleteDataImpl, @@ -34,16 +35,28 @@ import { SearchData, SearchDataImpl, } from '../data/base/search-data'; -import { DSOChangeAnalyzer } from '../data/dso-change-analyzer.service'; +import { + DSOChangeAnalyzer, + DSOChangeAnalyzer, +} from '../data/dso-change-analyzer.service'; import { FindListOptions } from '../data/find-list-options.model'; import { PaginatedList } from '../data/paginated-list.model'; import { RemoteData } from '../data/remote-data'; import { PostRequest } from '../data/request.models'; -import { RequestService } from '../data/request.service'; +import { + RequestService, + RequestService, +} from '../data/request.service'; import { HttpOptions } from '../dspace-rest/dspace-rest.service'; -import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { + HALEndpointService, + HALEndpointService, +} from '../shared/hal-endpoint.service'; import { NoContent } from '../shared/NoContent.model'; -import { WorkspaceItem } from './models/workspaceitem.model'; +import { + WorkspaceItem, + WorkspaceItem, +} from './models/workspaceitem.model'; /** * A service that provides methods to make REST requests with workspaceitems endpoint. diff --git a/src/app/core/supervision-order/supervision-order-data.service.ts b/src/app/core/supervision-order/supervision-order-data.service.ts index 3cfacceebc..72a634604c 100644 --- a/src/app/core/supervision-order/supervision-order-data.service.ts +++ b/src/app/core/supervision-order/supervision-order-data.service.ts @@ -1,7 +1,10 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { first, map, } from 'rxjs/operators'; +import { + first, + map, +} from 'rxjs/operators'; import { isNotEmpty } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; diff --git a/src/app/core/tasks/claimed-task-data.service.ts b/src/app/core/tasks/claimed-task-data.service.ts index 728f705dfa..f932f8ca82 100644 --- a/src/app/core/tasks/claimed-task-data.service.ts +++ b/src/app/core/tasks/claimed-task-data.service.ts @@ -5,7 +5,6 @@ import { Observable } from 'rxjs'; import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; import { RequestParam } from '../cache/models/request-param.model'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { dataService } from '../data/base/data-service.decorator'; import { FindListOptions } from '../data/find-list-options.model'; import { RemoteData } from '../data/remote-data'; import { RequestService } from '../data/request.service'; @@ -15,11 +14,6 @@ import { getFirstSucceededRemoteData } from '../shared/operators'; import { ClaimedTask } from './models/claimed-task-object.model'; import { ProcessTaskResponse } from './models/process-task-response'; import { TasksService } from './tasks.service'; -import { RemoteData } from '../data/remote-data'; -import { RequestParam } from '../cache/models/request-param.model'; -import { HttpOptions } from '../dspace-rest/dspace-rest.service'; -import { getFirstSucceededRemoteData } from '../shared/operators'; -import { FindListOptions } from '../data/find-list-options.model'; /** * The service handling all REST requests for ClaimedTask diff --git a/src/app/curation-form/curation-form.component.spec.ts b/src/app/curation-form/curation-form.component.spec.ts index eb9d754281..20611d7a32 100644 --- a/src/app/curation-form/curation-form.component.spec.ts +++ b/src/app/curation-form/curation-form.component.spec.ts @@ -75,17 +75,17 @@ describe('CurationFormComponent', () => { router = new RouterStub(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), FormsModule, ReactiveFormsModule, CurationFormComponent], - providers: [ + imports: [TranslateModule.forRoot(), FormsModule, ReactiveFormsModule, CurationFormComponent], + providers: [ { provide: ScriptDataService, useValue: scriptDataService }, { provide: ProcessDataService, useValue: processDataService }, { provide: NotificationsService, useValue: notificationsService }, { provide: HandleService, useValue: handleService }, { provide: Router, useValue: router }, { provide: ConfigurationDataService, useValue: configurationDataService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/curation-form/curation-form.component.ts b/src/app/curation-form/curation-form.component.ts index 78b4f9f7e4..a113ebc1c1 100644 --- a/src/app/curation-form/curation-form.component.ts +++ b/src/app/curation-form/curation-form.component.ts @@ -1,49 +1,73 @@ -import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { ScriptDataService } from '../core/data/processes/script-data.service'; -import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../core/shared/operators'; -import { map } from 'rxjs/operators'; -import { NotificationsService } from '../shared/notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; -import { hasValue, isEmpty, isNotEmpty } from '../shared/empty.util'; -import { RemoteData } from '../core/data/remote-data'; +import { + NgFor, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, + ChangeDetectorRef, + Component, Component, Input, + Input, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormControl, + UntypedFormControl, + UntypedFormGroup, UntypedFormGroup, } from '@angular/forms'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { Observable, Subscription, } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + map, + map, +} from 'rxjs/operators'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; -import { ScriptDataService } from '../core/data/processes/script-data.service'; -import { RemoteData } from '../core/data/remote-data'; +import { + ScriptDataService, + ScriptDataService, +} from '../core/data/processes/script-data.service'; +import { + RemoteData, + RemoteData, +} from '../core/data/remote-data'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; import { getFirstCompletedRemoteData, + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../core/shared/operators'; import { getProcessDetailRoute } from '../process-page/process-page-routing.paths'; import { Process } from '../process-page/processes/process.model'; import { + hasValue, hasValue, isEmpty, + isEmpty, + isNotEmpty, isNotEmpty, } from '../shared/empty.util'; import { HandleService } from '../shared/handle.service'; -import { NgFor, NgIf } from '@angular/common'; -import { NotificationsService } from '../shared/notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../shared/notifications/notifications.service'; export const CURATION_CFG = 'plugin.named.org.dspace.curate.CurationTask'; @@ -51,10 +75,10 @@ export const CURATION_CFG = 'plugin.named.org.dspace.curate.CurationTask'; * Component responsible for rendering the Curation Task form */ @Component({ - selector: 'ds-curation-form', - templateUrl: './curation-form.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgFor, NgIf, TranslateModule] + selector: 'ds-curation-form', + templateUrl: './curation-form.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgFor, NgIf, TranslateModule], }) export class CurationFormComponent implements OnDestroy, OnInit { diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.spec.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.spec.ts index 8e44812c96..f462e501d5 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.spec.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.spec.ts @@ -4,25 +4,25 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, of, + of, } from 'rxjs'; +import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; -import { of } from 'rxjs/internal/observable/of'; -import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; -import { By } from '@angular/platform-browser'; -import { - DsoEditMetadataValueHeadersComponent -} from '../dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; -import { DsoEditMetadataValueComponent } from '../dso-edit-metadata-value/dso-edit-metadata-value.component'; import { VarDirective } from '../../../shared/utils/var.directive'; import { DsoEditMetadataForm } from '../dso-edit-metadata-form'; +import { DsoEditMetadataValueComponent } from '../dso-edit-metadata-value/dso-edit-metadata-value.component'; +import { DsoEditMetadataValueHeadersComponent } from '../dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; import { DsoEditMetadataFieldValuesComponent } from './dso-edit-metadata-field-values.component'; describe('DsoEditMetadataFieldValuesComponent', () => { @@ -68,12 +68,12 @@ describe('DsoEditMetadataFieldValuesComponent', () => { draggingMdField$ = new BehaviorSubject(null); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataFieldValuesComponent, VarDirective], - providers: [], - schemas: [NO_ERRORS_SCHEMA] -}) + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataFieldValuesComponent, VarDirective], + providers: [], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(DsoEditMetadataFieldValuesComponent, { - remove: { imports: [DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent]} + remove: { imports: [DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent] }, }) .compileComponents(); })); diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts index 9b2c4695e2..e2f10d1603 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts @@ -1,7 +1,14 @@ import { CdkDragDrop, + CdkDragDrop, + CdkDropList, + moveItemInArray, moveItemInArray, } from '@angular/cdk/drag-drop'; +import { + AsyncPipe, + NgFor, +} from '@angular/common'; import { Component, EventEmitter, @@ -12,25 +19,23 @@ import { BehaviorSubject, Observable, } from 'rxjs'; +import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; -import { CdkDragDrop, moveItemInArray, CdkDropList } from '@angular/cdk/drag-drop'; -import { DsoEditMetadataValueComponent } from '../dso-edit-metadata-value/dso-edit-metadata-value.component'; -import { NgFor, AsyncPipe } from '@angular/common'; -import { DsoEditMetadataValueHeadersComponent } from '../dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; import { DsoEditMetadataChangeType, DsoEditMetadataForm, DsoEditMetadataValue, } from '../dso-edit-metadata-form'; +import { DsoEditMetadataValueComponent } from '../dso-edit-metadata-value/dso-edit-metadata-value.component'; +import { DsoEditMetadataValueHeadersComponent } from '../dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; @Component({ - selector: 'ds-dso-edit-metadata-field-values', - styleUrls: ['./dso-edit-metadata-field-values.component.scss'], - templateUrl: './dso-edit-metadata-field-values.component.html', - standalone: true, - imports: [CdkDropList, DsoEditMetadataValueHeadersComponent, NgFor, DsoEditMetadataValueComponent, AsyncPipe] + selector: 'ds-dso-edit-metadata-field-values', + styleUrls: ['./dso-edit-metadata-field-values.component.scss'], + templateUrl: './dso-edit-metadata-field-values.component.html', + standalone: true, + imports: [CdkDropList, DsoEditMetadataValueHeadersComponent, NgFor, DsoEditMetadataValueComponent, AsyncPipe], }) /** * Component displaying table rows for each value for a certain metadata field within a form diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.spec.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.spec.ts index e96bbec382..becb7b5278 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.spec.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.spec.ts @@ -17,10 +17,10 @@ describe('DsoEditMetadataHeadersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataHeadersComponent, VarDirective], - providers: [], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataHeadersComponent, VarDirective], + providers: [], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts index a83418f105..b0da8b4d78 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts @@ -5,11 +5,11 @@ import { import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-dso-edit-metadata-headers', - styleUrls: ['./dso-edit-metadata-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], - templateUrl: './dso-edit-metadata-headers.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-dso-edit-metadata-headers', + styleUrls: ['./dso-edit-metadata-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], + templateUrl: './dso-edit-metadata-headers.component.html', + standalone: true, + imports: [TranslateModule], }) /** * Component displaying the header table row for DSO edit metadata page diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts index 03bf135c36..9783be6f35 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts @@ -5,11 +5,11 @@ import { import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-dso-edit-metadata-value-headers', - styleUrls: ['./dso-edit-metadata-value-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], - templateUrl: './dso-edit-metadata-value-headers.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-dso-edit-metadata-value-headers', + styleUrls: ['./dso-edit-metadata-value-headers.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], + templateUrl: './dso-edit-metadata-value-headers.component.html', + standalone: true, + imports: [TranslateModule], }) /** * Component displaying invisible headers for a list of metadata values using table roles for accessibility diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts index bedabeb46d..7c85787396 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts @@ -1,5 +1,7 @@ import { DebugElement, + DebugElement, + NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA, } from '@angular/core'; import { @@ -7,32 +9,19 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + By, + By, +} from '@angular/platform-browser'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core'; -import { RelationshipDataService } from '../../../core/data/relationship-data.service'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { of } from 'rxjs/internal/observable/of'; -import { ItemMetadataRepresentation } from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; -import { - MetadataValue, - VIRTUAL_METADATA_PREFIX, -} from '../../../core/shared/metadata.models'; -import { - DsoEditMetadataChangeType, - DsoEditMetadataValue, -} from '../dso-edit-metadata-form'; -import { By } from '@angular/platform-browser'; -import { ItemDataService } from '../../../core/data/item-data.service'; -import { Item } from '../../../core/shared/item.model'; -import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { Collection } from '../../../core/shared/collection.model'; -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Observable, of, + of, } from 'rxjs'; import { MetadataField } from 'src/app/core/metadata/metadata-field.model'; import { MetadataSchema } from 'src/app/core/metadata/metadata-schema.model'; @@ -46,25 +35,53 @@ import { NotificationsService } from 'src/app/shared/notifications/notifications import { createPaginatedList } from 'src/app/shared/testing/utils.test'; import { VocabularyServiceStub } from 'src/app/shared/testing/vocabulary-service.stub'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { ItemDataService } from '../../../core/data/item-data.service'; -import { RelationshipDataService } from '../../../core/data/relationship-data.service'; -import { Collection } from '../../../core/shared/collection.model'; -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { Item } from '../../../core/shared/item.model'; +import { + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; +import { + ItemDataService, + ItemDataService, +} from '../../../core/data/item-data.service'; +import { + RelationshipDataService, + RelationshipDataService, +} from '../../../core/data/relationship-data.service'; +import { + Collection, + Collection, +} from '../../../core/shared/collection.model'; +import { + DSpaceObject, + DSpaceObject, +} from '../../../core/shared/dspace-object.model'; +import { + Item, + Item, +} from '../../../core/shared/item.model'; import { MetadataValue, + MetadataValue, + VIRTUAL_METADATA_PREFIX, VIRTUAL_METADATA_PREFIX, } from '../../../core/shared/metadata.models'; -import { ItemMetadataRepresentation } from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; -import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; +import { + ItemMetadataRepresentation, + ItemMetadataRepresentation, +} from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; +import { ThemedTypeBadgeComponent } from '../../../shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; +import { + createSuccessfulRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../../shared/remote-data.utils'; import { VarDirective } from '../../../shared/utils/var.directive'; import { DsoEditMetadataChangeType, + DsoEditMetadataChangeType, + DsoEditMetadataValue, DsoEditMetadataValue, } from '../dso-edit-metadata-form'; import { DsoEditMetadataValueComponent } from './dso-edit-metadata-value.component'; -import { ThemedTypeBadgeComponent } from '../../../shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; const EDIT_BTN = 'edit'; const CONFIRM_BTN = 'confirm'; @@ -171,7 +188,7 @@ describe('DsoEditMetadataValueComponent', () => { relationshipService = jasmine.createSpyObj('relationshipService', { resolveMetadataRepresentation: of( - new ItemMetadataRepresentation(metadataValue) + new ItemMetadataRepresentation(metadataValue), ), }); dsoNameService = jasmine.createSpyObj('dsoNameService', { @@ -239,7 +256,7 @@ describe('DsoEditMetadataValueComponent', () => { it('should not show a badge', () => { expect( - fixture.debugElement.query(By.css('ds-themed-type-badge')) + fixture.debugElement.query(By.css('ds-themed-type-badge')), ).toBeNull(); }); @@ -307,7 +324,7 @@ describe('DsoEditMetadataValueComponent', () => { it('should show a badge', () => { expect( - fixture.debugElement.query(By.css('ds-themed-type-badge')) + fixture.debugElement.query(By.css('ds-themed-type-badge')), ).toBeTruthy(); }); diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts index 5b30446cb7..1aefe5af23 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts @@ -1,3 +1,12 @@ +import { + CdkDrag, + CdkDragHandle, +} from '@angular/cdk/drag-drop'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -9,10 +18,16 @@ import { SimpleChanges, } from '@angular/core'; import { + FormsModule, UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { EMPTY, Observable, @@ -50,45 +65,33 @@ import { Vocabulary } from '../../../core/submission/vocabularies/models/vocabul import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; import { isNotEmpty } from '../../../shared/empty.util'; +import { DsDynamicOneboxComponent } from '../../../shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component'; import { DsDynamicOneboxModelConfig, DynamicOneboxModel, } from '../../../shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.model'; +import { DsDynamicScrollableDropdownComponent } from '../../../shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; import { DynamicScrollableDropdownModel, DynamicScrollableDropdownModelConfig, } from '../../../shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model'; +import { AuthorityConfidenceStateDirective } from '../../../shared/form/directives/authority-confidence-state.directive'; +import { ThemedTypeBadgeComponent } from '../../../shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; +import { DebounceDirective } from '../../../shared/utils/debounce.directive'; import { followLink } from '../../../shared/utils/follow-link-config.model'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { DsoEditMetadataChangeType, DsoEditMetadataValue, } from '../dso-edit-metadata-form'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedTypeBadgeComponent } from '../../../shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; -import { RouterLink } from '@angular/router'; -import { DebounceDirective } from '../../../shared/utils/debounce.directive'; -import { FormsModule } from '@angular/forms'; -import { NgClass, NgIf, AsyncPipe } from '@angular/common'; -import { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop'; -import { VarDirective } from '../../../shared/utils/var.directive'; -import { - DsDynamicScrollableDropdownComponent -} from '../../../shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; -import { - DsDynamicOneboxComponent -} from '../../../shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component'; -import { - AuthorityConfidenceStateDirective -} from '../../../shared/form/directives/authority-confidence-state.directive'; @Component({ - selector: 'ds-dso-edit-metadata-value', - styleUrls: ['./dso-edit-metadata-value.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], - templateUrl: './dso-edit-metadata-value.component.html', - standalone: true, - imports: [VarDirective, CdkDrag, NgClass, NgIf, FormsModule, DebounceDirective, RouterLink, ThemedTypeBadgeComponent, NgbTooltipModule, CdkDragHandle, AsyncPipe, TranslateModule, DsDynamicScrollableDropdownComponent, DsDynamicOneboxComponent, AuthorityConfidenceStateDirective] + selector: 'ds-dso-edit-metadata-value', + styleUrls: ['./dso-edit-metadata-value.component.scss', '../dso-edit-metadata-shared/dso-edit-metadata-cells.scss'], + templateUrl: './dso-edit-metadata-value.component.html', + standalone: true, + imports: [VarDirective, CdkDrag, NgClass, NgIf, FormsModule, DebounceDirective, RouterLink, ThemedTypeBadgeComponent, NgbTooltipModule, CdkDragHandle, AsyncPipe, TranslateModule, DsDynamicScrollableDropdownComponent, DsDynamicOneboxComponent, AuthorityConfidenceStateDirective], }) /** * Component displaying a single editable row for a metadata value diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.spec.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.spec.ts index 0b2e3fbd8c..8457c59a6e 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.spec.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.spec.ts @@ -1,6 +1,10 @@ import { + ChangeDetectionStrategy, + DebugElement, DebugElement, Injectable, + Injectable, + NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA, } from '@angular/core'; import { @@ -9,10 +13,11 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ChangeDetectionStrategy, DebugElement, Injectable, NO_ERRORS_SCHEMA } from '@angular/core'; import { Operation } from 'fast-json-patch'; import { Observable } from 'rxjs'; @@ -23,17 +28,17 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; import { ITEM } from '../../core/shared/item.resource-type'; import { MetadataValue } from '../../core/shared/metadata.models'; +import { AlertComponent } from '../../shared/alert/alert.component'; +import { LoadingComponent } from '../../shared/loading/loading.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { VarDirective } from '../../shared/utils/var.directive'; import { DsoEditMetadataComponent } from './dso-edit-metadata.component'; -import { DsoEditMetadataValueComponent } from './dso-edit-metadata-value/dso-edit-metadata-value.component'; -import { DsoEditMetadataHeadersComponent } from './dso-edit-metadata-headers/dso-edit-metadata-headers.component'; -import { MetadataFieldSelectorComponent } from './metadata-field-selector/metadata-field-selector.component'; -import { DsoEditMetadataValueHeadersComponent } from './dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; import { DsoEditMetadataFieldValuesComponent } from './dso-edit-metadata-field-values/dso-edit-metadata-field-values.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { LoadingComponent } from '../../shared/loading/loading.component'; +import { DsoEditMetadataHeadersComponent } from './dso-edit-metadata-headers/dso-edit-metadata-headers.component'; +import { DsoEditMetadataValueComponent } from './dso-edit-metadata-value/dso-edit-metadata-value.component'; +import { DsoEditMetadataValueHeadersComponent } from './dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; +import { MetadataFieldSelectorComponent } from './metadata-field-selector/metadata-field-selector.component'; const ADD_BTN = 'add'; const REINSTATE_BTN = 'reinstate'; diff --git a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index 699acacd0e..517843f3da 100644 --- a/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component, Inject, @@ -11,7 +16,10 @@ import { ActivatedRoute, Data, } from '@angular/router'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -19,37 +27,37 @@ import { Subscription, } from 'rxjs'; import { map } from 'rxjs/operators'; + import { ArrayMoveChangeAnalyzer } from '../../core/data/array-move-change-analyzer.service'; import { DATA_SERVICE_FACTORY } from '../../core/data/base/data-service.decorator'; import { HALDataService } from '../../core/data/base/hal-data-service.interface'; -import { LoadingComponent } from '../../shared/loading/loading.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { DsoEditMetadataFieldValuesComponent } from './dso-edit-metadata-field-values/dso-edit-metadata-field-values.component'; -import { DsoEditMetadataValueComponent } from './dso-edit-metadata-value/dso-edit-metadata-value.component'; -import { DsoEditMetadataValueHeadersComponent } from './dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; -import { DsoEditMetadataHeadersComponent } from './dso-edit-metadata-headers/dso-edit-metadata-headers.component'; -import { NgIf, NgFor, AsyncPipe } from '@angular/common'; import { RemoteData } from '../../core/data/remote-data'; import { UpdateDataService } from '../../core/data/update-data.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { GenericConstructor } from '../../core/shared/generic-constructor'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { ResourceType } from '../../core/shared/resource-type'; +import { AlertComponent } from '../../shared/alert/alert.component'; import { AlertType } from '../../shared/alert/alert-type'; import { hasNoValue, hasValue, } from '../../shared/empty.util'; +import { LoadingComponent } from '../../shared/loading/loading.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { DsoEditMetadataFieldValuesComponent } from './dso-edit-metadata-field-values/dso-edit-metadata-field-values.component'; import { DsoEditMetadataForm } from './dso-edit-metadata-form'; +import { DsoEditMetadataHeadersComponent } from './dso-edit-metadata-headers/dso-edit-metadata-headers.component'; +import { DsoEditMetadataValueComponent } from './dso-edit-metadata-value/dso-edit-metadata-value.component'; +import { DsoEditMetadataValueHeadersComponent } from './dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; import { MetadataFieldSelectorComponent } from './metadata-field-selector/metadata-field-selector.component'; @Component({ - selector: 'ds-dso-edit-metadata', - styleUrls: ['./dso-edit-metadata.component.scss'], - templateUrl: './dso-edit-metadata.component.html', - standalone: true, - imports: [NgIf, DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, NgFor, DsoEditMetadataFieldValuesComponent, AlertComponent, LoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-dso-edit-metadata', + styleUrls: ['./dso-edit-metadata.component.scss'], + templateUrl: './dso-edit-metadata.component.html', + standalone: true, + imports: [NgIf, DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, NgFor, DsoEditMetadataFieldValuesComponent, AlertComponent, LoadingComponent, AsyncPipe, TranslateModule], }) /** * Component showing a table of all metadata on a DSpaceObject and options to modify them diff --git a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.spec.ts b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.spec.ts index 2060c42426..3342cec154 100644 --- a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.spec.ts +++ b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.spec.ts @@ -62,13 +62,13 @@ describe('MetadataFieldSelectorComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['error', 'success']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), MetadataFieldSelectorComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), MetadataFieldSelectorComponent, VarDirective], + providers: [ { provide: RegistryService, useValue: registryService }, { provide: NotificationsService, useValue: notificationsService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts index bc2ef4122b..25fbd3abdb 100644 --- a/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { AfterViewInit, Component, @@ -9,32 +15,53 @@ import { Output, ViewChild, } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, Observable, of, Subscription, } from 'rxjs'; -import { debounceTime, distinctUntilChanged, map, switchMap, take, tap, } from 'rxjs/operators'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, +} from '@angular/forms'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + of, + Subscription, +} from 'rxjs'; +import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; +import { Observable } from 'rxjs/internal/Observable'; +import { + debounceTime, + distinctUntilChanged, + map, + switchMap, + take, + tap, +} from 'rxjs/operators'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { RegistryService } from '../../../core/registry/registry.service'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, metadataFieldsToString, } from '../../../core/shared/operators'; -import { Observable } from 'rxjs/internal/Observable'; -import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ClickOutsideDirective } from '../../../shared/utils/click-outside.directive'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; import { followLink } from '../../../shared/utils/follow-link-config.model'; @Component({ - selector: 'ds-metadata-field-selector', - styleUrls: ['./metadata-field-selector.component.scss'], - templateUrl: './metadata-field-selector.component.html', - standalone: true, - imports: [FormsModule, NgClass, ReactiveFormsModule, ClickOutsideDirective, NgIf, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-metadata-field-selector', + styleUrls: ['./metadata-field-selector.component.scss'], + templateUrl: './metadata-field-selector.component.html', + standalone: true, + imports: [FormsModule, NgClass, ReactiveFormsModule, ClickOutsideDirective, NgIf, NgFor, AsyncPipe, TranslateModule], }) /** * Component displaying a searchable input for metadata-fields diff --git a/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts b/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts index f486b862cd..9de9c539a2 100644 --- a/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts +++ b/src/app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component.ts @@ -9,10 +9,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { DsoEditMetadataComponent } from './dso-edit-metadata.component'; @Component({ - selector: 'ds-themed-dso-edit-metadata', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-dso-edit-metadata', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedDsoEditMetadataComponent extends ThemedComponent { diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts index 16df234ced..4854f21d80 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts @@ -56,13 +56,13 @@ describe('JournalIssueGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, JournalIssueGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, JournalIssueGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalIssueGridElementComponent, { + }).overrideComponent(JournalIssueGridElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts index c4186a912c..3968e6013c 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - JournalIssueSearchResultGridElementComponent -} from '../search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalIssueSearchResultGridElementComponent } from '../search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component'; @listableObjectComponent('JournalIssue', ViewMode.GridElement) @Component({ - selector: 'ds-journal-issue-grid-element', - styleUrls: ['./journal-issue-grid-element.component.scss'], - templateUrl: './journal-issue-grid-element.component.html', - standalone: true, - imports: [JournalIssueSearchResultGridElementComponent] + selector: 'ds-journal-issue-grid-element', + styleUrls: ['./journal-issue-grid-element.component.scss'], + templateUrl: './journal-issue-grid-element.component.html', + standalone: true, + imports: [JournalIssueSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts index f477841a64..1184e79aa8 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts @@ -1,24 +1,30 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../../../core/auth/auth.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; import { Item } from '../../../../core/shared/item.model'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; -import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalVolumeGridElementComponent } from './journal-volume-grid-element.component'; @@ -54,23 +60,23 @@ describe('JournalVolumeGridElementComponent', () => { const truncatableServiceStub: any = { isCollapsed: (id: number) => observableOf(true), expand: (id: number) => null, - collapse: (id: number) => null + collapse: (id: number) => null, }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, TranslateModule.forRoot(), JournalVolumeGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, TranslateModule.forRoot(), JournalVolumeGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: BitstreamDataService, useValue: {} }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, - { provide: AuthorizationDataService, useValue: {} } - ], + { provide: AuthorizationDataService, useValue: {} }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalVolumeGridElementComponent, { + }).overrideComponent(JournalVolumeGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts index 9d0858ef91..4770d62a18 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - JournalVolumeSearchResultGridElementComponent -} from '../search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalVolumeSearchResultGridElementComponent } from '../search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component'; @listableObjectComponent('JournalVolume', ViewMode.GridElement) @Component({ - selector: 'ds-journal-volume-grid-element', - styleUrls: ['./journal-volume-grid-element.component.scss'], - templateUrl: './journal-volume-grid-element.component.html', - standalone: true, - imports: [JournalVolumeSearchResultGridElementComponent] + selector: 'ds-journal-volume-grid-element', + styleUrls: ['./journal-volume-grid-element.component.scss'], + templateUrl: './journal-volume-grid-element.component.html', + standalone: true, + imports: [JournalVolumeSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts index 74b1e1ce6c..2dd425940c 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts @@ -18,8 +18,8 @@ import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mo import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; -import { JournalGridElementComponent } from './journal-grid-element.component'; import { JournalSearchResultGridElementComponent } from '../search-result-grid-elements/journal/journal-search-result-grid-element.component'; +import { JournalGridElementComponent } from './journal-grid-element.component'; const mockItem = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), @@ -61,15 +61,15 @@ describe('JournalGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, JournalGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, JournalGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalGridElementComponent, { + }).overrideComponent(JournalGridElementComponent, { remove: { - imports: [JournalSearchResultGridElementComponent] + imports: [JournalSearchResultGridElementComponent], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts index e2885525f5..edd12938a3 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - JournalSearchResultGridElementComponent -} from '../search-result-grid-elements/journal/journal-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalSearchResultGridElementComponent } from '../search-result-grid-elements/journal/journal-search-result-grid-element.component'; @listableObjectComponent('Journal', ViewMode.GridElement) @Component({ - selector: 'ds-journal-grid-element', - styleUrls: ['./journal-grid-element.component.scss'], - templateUrl: './journal-grid-element.component.html', - standalone: true, - imports: [JournalSearchResultGridElementComponent] + selector: 'ds-journal-grid-element', + styleUrls: ['./journal-grid-element.component.scss'], + templateUrl: './journal-grid-element.component.html', + standalone: true, + imports: [JournalSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts index 7f1d7c550f..ce56496198 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts @@ -1,31 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalIssueSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-journal-issue-search-result-grid-element', - styleUrls: ['./journal-issue-search-result-grid-element.component.scss'], - templateUrl: './journal-issue-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-journal-issue-search-result-grid-element', + styleUrls: ['./journal-issue-search-result-grid-element.component.scss'], + templateUrl: './journal-issue-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts index 2180fe2e62..4fcc8ade5d 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts @@ -1,31 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalVolumeSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-journal-volume-search-result-grid-element', - styleUrls: ['./journal-volume-search-result-grid-element.component.scss'], - templateUrl: './journal-volume-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-journal-volume-search-result-grid-element', + styleUrls: ['./journal-volume-search-result-grid-element.component.scss'], + templateUrl: './journal-volume-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts index 8c3c1d0607..38a7cf3210 100644 --- a/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts @@ -1,31 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-journal-search-result-grid-element', - styleUrls: ['./journal-search-result-grid-element.component.scss'], - templateUrl: './journal-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-journal-search-result-grid-element', + styleUrls: ['./journal-search-result-grid-element.component.scss'], + templateUrl: './journal-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts index ef74c9bfec..f18a570dcf 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts @@ -1,22 +1,28 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment.test'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalIssueListElementComponent } from './journal-issue-list-element.component'; @@ -51,8 +57,8 @@ describe('JournalIssueListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), JournalIssueListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), JournalIssueListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: APP_CONFIG, useValue: environment }, @@ -60,9 +66,9 @@ describe('JournalIssueListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalIssueListElementComponent, { + }).overrideComponent(JournalIssueListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts index 45779fe404..0a69f99610 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - JournalIssueSearchResultListElementComponent -} from '../search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalIssueSearchResultListElementComponent } from '../search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component'; @listableObjectComponent('JournalIssue', ViewMode.ListElement) @Component({ - selector: 'ds-journal-issue-list-element', - styleUrls: ['./journal-issue-list-element.component.scss'], - templateUrl: './journal-issue-list-element.component.html', - standalone: true, - imports: [JournalIssueSearchResultListElementComponent] + selector: 'ds-journal-issue-list-element', + styleUrls: ['./journal-issue-list-element.component.scss'], + templateUrl: './journal-issue-list-element.component.html', + standalone: true, + imports: [JournalIssueSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts index 53a5e5bcf9..35a8f08078 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts @@ -1,16 +1,20 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; -import { - JournalVolumeSearchResultListElementComponent -} from '../search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { JournalVolumeSearchResultListElementComponent } from '../search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; import { JournalVolumeListElementComponent } from './journal-volume-list-element.component'; const mockItem: Item = Object.assign(new Item(), { @@ -47,15 +51,15 @@ describe('JournalVolumeListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, JournalVolumeListElementComponent], - providers: [ + imports: [TruncatePipe, JournalVolumeListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalVolumeListElementComponent, { + }).overrideComponent(JournalVolumeListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, - remove: { imports: [JournalVolumeSearchResultListElementComponent]} + remove: { imports: [JournalVolumeSearchResultListElementComponent] }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts index e63539fb52..c9ae9bf8bf 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts @@ -1,23 +1,18 @@ import { Component } from '@angular/core'; + import { Item } from '../../../../core/shared/item.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - JournalVolumeSearchResultListElementComponent -} from '../search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalVolumeSearchResultListElementComponent } from '../search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component'; @listableObjectComponent('JournalVolume', ViewMode.ListElement) @Component({ - selector: 'ds-journal-volume-list-element', - styleUrls: ['./journal-volume-list-element.component.scss'], - templateUrl: './journal-volume-list-element.component.html', - standalone: true, - imports: [JournalVolumeSearchResultListElementComponent] + selector: 'ds-journal-volume-list-element', + styleUrls: ['./journal-volume-list-element.component.scss'], + templateUrl: './journal-volume-list-element.component.html', + standalone: true, + imports: [JournalVolumeSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts index d2a5932399..713af915bf 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts @@ -1,21 +1,27 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; - -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; + import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalListElementComponent } from './journal-list-element.component'; @@ -45,13 +51,13 @@ describe('JournalListElementComponent', () => { const truncatableServiceStub: any = { isCollapsed: (id: number) => observableOf(true), collapse: (id: number) => null, - expand: (id: number) => null + expand: (id: number) => null, }; beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), JournalListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), JournalListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: APP_CONFIG, useValue: environment }, @@ -59,9 +65,9 @@ describe('JournalListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalListElementComponent, { + }).overrideComponent(JournalListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts index 4f3ec39cb9..797b62f49b 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - JournalSearchResultListElementComponent -} from '../search-result-list-elements/journal/journal-search-result-list-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { JournalSearchResultListElementComponent } from '../search-result-list-elements/journal/journal-search-result-list-element.component'; @listableObjectComponent('Journal', ViewMode.ListElement) @Component({ - selector: 'ds-journal-list-element', - styleUrls: ['./journal-list-element.component.scss'], - templateUrl: './journal-list-element.component.html', - standalone: true, - imports: [JournalSearchResultListElementComponent] + selector: 'ds-journal-list-element', + styleUrls: ['./journal-list-element.component.scss'], + templateUrl: './journal-list-element.component.html', + standalone: true, + imports: [JournalSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts index 205908a8fd..511725f651 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts @@ -1,22 +1,29 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { JournalIssueSearchResultListElementComponent } from './journal-issue-search-result-list-element.component'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; let journalIssueListElementComponent: JournalIssueSearchResultListElementComponent; let fixture: ComponentFixture; @@ -80,22 +87,22 @@ const enviromentNoThumbs = { describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), TruncatePipe, - JournalIssueSearchResultListElementComponent - ], - providers: [ + JournalIssueSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalIssueSearchResultListElementComponent, { - add: { changeDetection: ChangeDetectionStrategy.Default }} + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalIssueSearchResultListElementComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default } }, ).compileComponents(); })); @@ -174,16 +181,16 @@ describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), JournalIssueSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), JournalIssueSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalIssueSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalIssueSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts index 5ad4c0fbd5..ca12acaa10 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts @@ -1,23 +1,27 @@ -import { Component } from '@angular/core'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; -import { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; + +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; @listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-journal-issue-search-result-list-element', - styleUrls: ['./journal-issue-search-result-list-element.component.scss'], - templateUrl: './journal-issue-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe] + selector: 'ds-journal-issue-search-result-list-element', + styleUrls: ['./journal-issue-search-result-list-element.component.scss'], + templateUrl: './journal-issue-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe], }) /** * The component for displaying a list element for an item search result of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts index b5510aa38c..71ddc947a2 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts @@ -1,27 +1,32 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; +import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; +import { ThemeService } from 'src/app/shared/theme-support/theme.service'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; -import { JournalVolumeSearchResultListElementComponent } from './journal-volume-search-result-list-element.component'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { ThemeService } from 'src/app/shared/theme-support/theme.service'; -import { ActivatedRoute } from '@angular/router'; -import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; -import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; -import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; +import { JournalVolumeSearchResultListElementComponent } from './journal-volume-search-result-list-element.component'; let journalVolumeListElementComponent: JournalVolumeSearchResultListElementComponent; let fixture: ComponentFixture; @@ -84,16 +89,16 @@ const enviromentNoThumbs = { describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, JournalVolumeSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, JournalVolumeSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalVolumeSearchResultListElementComponent, { + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalVolumeSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -172,25 +177,25 @@ describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, JournalVolumeSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, JournalVolumeSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalVolumeSearchResultListElementComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalVolumeSearchResultListElementComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ ThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, - ] - } + ], + }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts index 8c68817a30..b44a4896b7 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts @@ -1,23 +1,27 @@ -import { Component } from '@angular/core'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; -import { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; + +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; @listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-journal-volume-search-result-list-element', - styleUrls: ['./journal-volume-search-result-list-element.component.scss'], - templateUrl: './journal-volume-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe] + selector: 'ds-journal-volume-search-result-list-element', + styleUrls: ['./journal-volume-search-result-list-element.component.scss'], + templateUrl: './journal-volume-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe], }) /** * The component for displaying a list element for an item search result of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts index 5bd18b6cb4..f746394f7b 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts @@ -1,6 +1,14 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; @@ -8,7 +16,6 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service import { Item } from '../../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { TranslateModule } from '@ngx-translate/core'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; @@ -71,17 +78,17 @@ const enviromentNoThumbs = { describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), JournalSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), JournalSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).overrideComponent(JournalSearchResultListElementComponent, { - add: { changeDetection: ChangeDetectionStrategy.Default } + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalSearchResultListElementComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -135,16 +142,16 @@ describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), JournalSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), JournalSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts index a650d4f0df..d931feece7 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts @@ -1,27 +1,27 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; + +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; @listableObjectComponent('JournalSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-journal-search-result-list-element', - styleUrls: ['./journal-search-result-list-element.component.scss'], - templateUrl: './journal-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe] + selector: 'ds-journal-search-result-list-element', + styleUrls: ['./journal-search-result-list-element.component.scss'], + templateUrl: './journal-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe], }) /** * The component for displaying a list element for an item search result of the type Journal diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts index 45b42037c8..de698eed1a 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts @@ -1,28 +1,27 @@ import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { Context } from '../../../../../core/shared/context.model'; -import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { Item } from '../../../../../core/shared/item.model'; -import { isNotEmpty } from '../../../../../shared/empty.util'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; + +import { Context } from '../../../../../core/shared/context.model'; +import { Item } from '../../../../../core/shared/item.model'; +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { isNotEmpty } from '../../../../../shared/empty.util'; +import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('JournalIssueSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-journal-issue-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-journal-issue-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "JournalIssue" within the context of diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts index f8b06c60e8..8e6b2f0a9b 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts @@ -1,28 +1,27 @@ import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { Context } from '../../../../../core/shared/context.model'; -import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { Item } from '../../../../../core/shared/item.model'; -import { isNotEmpty } from '../../../../../shared/empty.util'; import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; + +import { Context } from '../../../../../core/shared/context.model'; +import { Item } from '../../../../../core/shared/item.model'; +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { isNotEmpty } from '../../../../../shared/empty.util'; +import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('JournalVolumeSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-journal-volume-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-journal-volume-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "JournalVolume" within the context of diff --git a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts index cdb05806ba..c1cfd1755d 100644 --- a/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts @@ -1,28 +1,27 @@ import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { Context } from '../../../../../core/shared/context.model'; -import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { Item } from '../../../../../core/shared/item.model'; -import { isNotEmpty } from '../../../../../shared/empty.util'; import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; + +import { Context } from '../../../../../core/shared/context.model'; +import { Item } from '../../../../../core/shared/item.model'; +import { ViewMode } from '../../../../../core/shared/view-mode.model'; +import { isNotEmpty } from '../../../../../shared/empty.util'; +import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('JournalSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('JournalSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-journal-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-journal-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Journal" within the context of diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index 4060bb0433..ca6bb56e79 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -1,36 +1,29 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalIssue', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal-issue', - styleUrls: ['./journal-issue.component.scss'], - templateUrl: './journal-issue.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-journal-issue', + styleUrls: ['./journal-issue.component.scss'], + templateUrl: './journal-issue.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal Issue diff --git a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index 882dc9037b..fab0e105be 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -1,36 +1,29 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalVolume', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal-volume', - styleUrls: ['./journal-volume.component.scss'], - templateUrl: './journal-volume.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-journal-volume', + styleUrls: ['./journal-volume.component.scss'], + templateUrl: './journal-volume.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal Volume diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts index 6e12ba0d58..f26de22b65 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts @@ -1,11 +1,24 @@ import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; + +import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -27,11 +40,11 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; import { WorkspaceitemDataService } from '../../../../core/submission/workspaceitem-data.service'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { MetadataValuesComponent } from '../../../../item-page/field-components/metadata-values/metadata-values.component'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; import { mockRouteService } from '../../../../item-page/simple/item-types/shared/item.component.spec'; import { isNotEmpty } from '../../../../shared/empty.util'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; @@ -39,11 +52,6 @@ import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/brow import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { JournalComponent } from './journal.component'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { - MetadataValuesComponent -} from '../../../../item-page/field-components/metadata-values/metadata-values.component'; let comp: JournalComponent; let fixture: ComponentFixture; @@ -80,18 +88,18 @@ describe('JournalComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule, GenericItemPageFieldComponent, TruncatePipe, - JournalComponent - ], - providers: [ + JournalComponent, + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: RelationshipDataService, useValue: {} }, @@ -113,13 +121,13 @@ describe('JournalComponent', () => { { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, { provide: APP_CONFIG, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(JournalComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(JournalComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, }) .overrideComponent(GenericItemPageFieldComponent, { - remove: {imports: [MetadataValuesComponent]} + remove: { imports: [MetadataValuesComponent] }, }) .compileComponents(); })); diff --git a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 8fa28b97dd..179355d869 100644 --- a/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts +++ b/src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -1,39 +1,30 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { RouterLink } from '@angular/router'; +import { TabbedRelatedEntitiesSearchComponent } from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('Journal', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal', - styleUrls: ['./journal.component.scss'], - templateUrl: './journal.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule] + selector: 'ds-journal', + styleUrls: ['./journal.component.scss'], + templateUrl: './journal.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal diff --git a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.spec.ts b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.spec.ts index 539a5e6e80..082ad20f2d 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.spec.ts @@ -1,27 +1,33 @@ -import { Item } from '../../../../core/shared/item.model'; -import { OrgUnitGridElementComponent } from './org-unit-grid-element.component'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; -import { PageInfo } from '../../../../core/shared/page-info.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; -import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { AuthService } from '../../../../core/auth/auth.service'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; +import { Item } from '../../../../core/shared/item.model'; +import { PageInfo } from '../../../../core/shared/page-info.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { OrgUnitGridElementComponent } from './org-unit-grid-element.component'; const mockItem = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), @@ -59,13 +65,13 @@ describe('OrgUnitGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TruncatePipe, TranslateModule.forRoot(), - OrgUnitGridElementComponent - ], - providers: [ + OrgUnitGridElementComponent, + ], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, @@ -73,9 +79,9 @@ describe('OrgUnitGridElementComponent', () => { { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitGridElementComponent, { + }).overrideComponent(OrgUnitGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts index f3df7e9af7..5be610a35f 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - OrgUnitSearchResultGridElementComponent -} from '../search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { OrgUnitSearchResultGridElementComponent } from '../search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component'; @listableObjectComponent('OrgUnit', ViewMode.GridElement) @Component({ - selector: 'ds-org-unit-grid-element', - styleUrls: ['./org-unit-grid-element.component.scss'], - templateUrl: './org-unit-grid-element.component.html', - standalone: true, - imports: [OrgUnitSearchResultGridElementComponent] + selector: 'ds-org-unit-grid-element', + styleUrls: ['./org-unit-grid-element.component.scss'], + templateUrl: './org-unit-grid-element.component.html', + standalone: true, + imports: [OrgUnitSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts index 84ff3140cd..0f43cfdcd4 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts @@ -1,5 +1,11 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -48,13 +54,13 @@ describe('PersonGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, PersonGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, PersonGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PersonGridElementComponent, { + }).overrideComponent(PersonGridElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts index 23dda2f10b..bb1ee53ae8 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - PersonSearchResultGridElementComponent -} from '../search-result-grid-elements/person/person-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { PersonSearchResultGridElementComponent } from '../search-result-grid-elements/person/person-search-result-grid-element.component'; @listableObjectComponent('Person', ViewMode.GridElement) @Component({ - selector: 'ds-person-grid-element', - styleUrls: ['./person-grid-element.component.scss'], - templateUrl: './person-grid-element.component.html', - standalone: true, - imports: [PersonSearchResultGridElementComponent] + selector: 'ds-person-grid-element', + styleUrls: ['./person-grid-element.component.scss'], + templateUrl: './person-grid-element.component.html', + standalone: true, + imports: [PersonSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.spec.ts b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.spec.ts index 553ec030ca..7dbc3251f3 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.spec.ts @@ -1,27 +1,33 @@ -import { Item } from '../../../../core/shared/item.model'; -import { ProjectGridElementComponent } from './project-grid-element.component'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; -import { PageInfo } from '../../../../core/shared/page-info.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; -import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; -import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; -import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { AuthService } from '../../../../core/auth/auth.service'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; +import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; +import { Item } from '../../../../core/shared/item.model'; +import { PageInfo } from '../../../../core/shared/page-info.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; +import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; +import { ProjectGridElementComponent } from './project-grid-element.component'; const mockItem = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [])), @@ -47,8 +53,8 @@ describe('ProjectGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, TranslateModule.forRoot(), ProjectGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, TranslateModule.forRoot(), ProjectGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, @@ -56,9 +62,9 @@ describe('ProjectGridElementComponent', () => { { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ProjectGridElementComponent, { + }).overrideComponent(ProjectGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts index 72d3fc3c2e..561ebb288b 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - ProjectSearchResultGridElementComponent -} from '../search-result-grid-elements/project/project-search-result-grid-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { ProjectSearchResultGridElementComponent } from '../search-result-grid-elements/project/project-search-result-grid-element.component'; @listableObjectComponent('Project', ViewMode.GridElement) @Component({ - selector: 'ds-project-grid-element', - styleUrls: ['./project-grid-element.component.scss'], - templateUrl: './project-grid-element.component.html', - standalone: true, - imports: [ProjectSearchResultGridElementComponent] + selector: 'ds-project-grid-element', + styleUrls: ['./project-grid-element.component.scss'], + templateUrl: './project-grid-element.component.html', + standalone: true, + imports: [ProjectSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Project diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts index 9e0d4740d0..6b4dd0e21d 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts @@ -1,30 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-org-unit-search-result-grid-element', - styleUrls: ['./org-unit-search-result-grid-element.component.scss'], - templateUrl: './org-unit-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-org-unit-search-result-grid-element', + styleUrls: ['./org-unit-search-result-grid-element.component.scss'], + templateUrl: './org-unit-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts index 00ea31795b..dc9b1f8f47 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts @@ -1,30 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('PersonSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-person-search-result-grid-element', - styleUrls: ['./person-search-result-grid-element.component.scss'], - templateUrl: './person-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-person-search-result-grid-element', + styleUrls: ['./person-search-result-grid-element.component.scss'], + templateUrl: './person-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Person diff --git a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts index 9ec27ebf93..0ba8ce6f75 100644 --- a/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts +++ b/src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts @@ -1,30 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { focusShadow } from '../../../../../shared/animations/focus'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultGridElementComponent -} from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('ProjectSearchResult', ViewMode.GridElement) @Component({ - selector: 'ds-project-search-result-grid-element', - styleUrls: ['./project-search-result-grid-element.component.scss'], - templateUrl: './project-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-project-search-result-grid-element', + styleUrls: ['./project-search-result-grid-element.component.scss'], + templateUrl: './project-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [TruncatableComponent, NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts index 334b387448..a2ca0c77da 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts @@ -1,22 +1,28 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment.test'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; -import { TranslateModule } from '@ngx-translate/core'; import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { OrgUnitListElementComponent } from './org-unit-list-element.component'; @@ -46,8 +52,8 @@ describe('OrgUnitListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), OrgUnitListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), OrgUnitListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: APP_CONFIG, useValue: environment }, @@ -55,9 +61,9 @@ describe('OrgUnitListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitListElementComponent, { + }).overrideComponent(OrgUnitListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts index 52566fd093..32aac7e48f 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - OrgUnitSearchResultListElementComponent -} from '../search-result-list-elements/org-unit/org-unit-search-result-list-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { OrgUnitSearchResultListElementComponent } from '../search-result-list-elements/org-unit/org-unit-search-result-list-element.component'; @listableObjectComponent('OrgUnit', ViewMode.ListElement) @Component({ - selector: 'ds-org-unit-list-element', - styleUrls: ['./org-unit-list-element.component.scss'], - templateUrl: './org-unit-list-element.component.html', - standalone: true, - imports: [OrgUnitSearchResultListElementComponent] + selector: 'ds-org-unit-list-element', + styleUrls: ['./org-unit-list-element.component.scss'], + templateUrl: './org-unit-list-element.component.html', + standalone: true, + imports: [OrgUnitSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts index 4a13e7f67f..631d3e90b2 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts @@ -1,22 +1,28 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; - -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; + import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { PersonListElementComponent } from './person-list-element.component'; @@ -45,8 +51,8 @@ describe('PersonListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), PersonListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), PersonListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: APP_CONFIG, useValue: environment }, @@ -54,9 +60,9 @@ describe('PersonListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PersonListElementComponent, { + }).overrideComponent(PersonListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts index 4d693fcd6c..1f18ac8a9e 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts @@ -2,23 +2,17 @@ import { Component } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - PersonSearchResultListElementComponent -} from '../search-result-list-elements/person/person-search-result-list-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { PersonSearchResultListElementComponent } from '../search-result-list-elements/person/person-search-result-list-element.component'; @listableObjectComponent('Person', ViewMode.ListElement) @Component({ - selector: 'ds-person-list-element', - styleUrls: ['./person-list-element.component.scss'], - templateUrl: './person-list-element.component.html', - standalone: true, - imports: [PersonSearchResultListElementComponent] + selector: 'ds-person-list-element', + styleUrls: ['./person-list-element.component.scss'], + templateUrl: './person-list-element.component.html', + standalone: true, + imports: [PersonSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts index 577781c638..0828b373ab 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts @@ -1,25 +1,31 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment.test'; +import { AuthService } from '../../../../core/auth/auth.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { ProjectListElementComponent } from './project-list-element.component'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment.test'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; -import { TranslateModule } from '@ngx-translate/core'; const mockItem: Item = Object.assign(new Item(), { bundles: observableOf({}), @@ -39,8 +45,8 @@ describe('ProjectListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), ProjectListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), ProjectListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: APP_CONFIG, useValue: environment }, @@ -48,9 +54,9 @@ describe('ProjectListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ProjectListElementComponent, { + }).overrideComponent(ProjectListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts index 98086e1741..098637200b 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts @@ -1,23 +1,18 @@ import { Component } from '@angular/core'; + import { Item } from '../../../../core/shared/item.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - ProjectSearchResultListElementComponent -} from '../search-result-list-elements/project/project-search-result-list-element.component'; -import { - AbstractListableElementComponent -} from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { ProjectSearchResultListElementComponent } from '../search-result-list-elements/project/project-search-result-list-element.component'; @listableObjectComponent('Project', ViewMode.ListElement) @Component({ - selector: 'ds-project-list-element', - styleUrls: ['./project-list-element.component.scss'], - templateUrl: './project-list-element.component.html', - standalone: true, - imports: [ProjectSearchResultListElementComponent] + selector: 'ds-project-list-element', + styleUrls: ['./project-list-element.component.scss'], + templateUrl: './project-list-element.component.html', + standalone: true, + imports: [ProjectSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts index 85cfae01ca..28ed1c0feb 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts @@ -1,23 +1,33 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { ActivatedRoute } from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; -import { ActivatedRoute } from '@angular/router'; import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { OrgUnitSearchResultListElementComponent } from './org-unit-search-result-list-element.component'; @@ -77,23 +87,23 @@ const enviromentNoThumbs = { describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), TruncatePipe, OrgUnitSearchResultListElementComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), TruncatePipe, OrgUnitSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, - { provide: ThemeService, useValue: getMockThemeService() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitSearchResultListElementComponent, { + { provide: ThemeService, useValue: getMockThemeService() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(OrgUnitSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -148,21 +158,21 @@ describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), TruncatePipe, OrgUnitSearchResultListElementComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), TruncatePipe, OrgUnitSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitSearchResultListElementComponent, { + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(OrgUnitSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts index 397d697e6f..f2243fb3b1 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts @@ -1,29 +1,27 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-org-unit-search-result-list-element', - styleUrls: ['./org-unit-search-result-list-element.component.scss'], - templateUrl: './org-unit-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + selector: 'ds-org-unit-search-result-list-element', + styleUrls: ['./org-unit-search-result-list-element.component.scss'], + templateUrl: './org-unit-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying a list element for an item search result of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts index 898316c710..9632f663d2 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts @@ -1,23 +1,33 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { ActivatedRoute } from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; -import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; +import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { TranslateLoaderMock } from '../../../../../shared/mocks/translate-loader.mock'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { PersonSearchResultListElementComponent } from './person-search-result-list-element.component'; @@ -77,13 +87,13 @@ const enviromentNoThumbs = { describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), TruncatePipe, PersonSearchResultListElementComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), TruncatePipe, PersonSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, @@ -91,9 +101,9 @@ describe('PersonSearchResultListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PersonSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(PersonSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -151,8 +161,8 @@ describe('PersonSearchResultListElementComponent', () => { imports: [TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), TruncatePipe], providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts index 69a538a43b..a7b5e59e96 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts @@ -1,32 +1,37 @@ -import { Component, Inject, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { APP_CONFIG, AppConfig, } from '../../../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; -import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-person-search-result-list-element', - styleUrls: ['./person-search-result-list-element.component.scss'], - templateUrl: './person-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-person-search-result-list-element', + styleUrls: ['./person-search-result-list-element.component.scss'], + templateUrl: './person-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe, TranslateModule], }) /** * The component for displaying a list element for an item search result of the type Person diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts index e189797cb4..b85d0823ec 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts @@ -1,21 +1,28 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; import { ProjectSearchResultListElementComponent } from './project-search-result-list-element.component'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; let projectListElementComponent: ProjectSearchResultListElementComponent; let fixture: ComponentFixture; @@ -73,16 +80,16 @@ const enviromentNoThumbs = { describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, ProjectSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, ProjectSearchResultListElementComponent], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ProjectSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ProjectSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -137,16 +144,16 @@ describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, ProjectSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, ProjectSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ProjectSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ProjectSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts index 2f0a54b613..fc6e031f40 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts @@ -1,24 +1,25 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { ThemedBadgesComponent } from '../../../../../shared/object-collection/shared/badges/themed-badges.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; @listableObjectComponent('ProjectSearchResult', ViewMode.ListElement) @Component({ - selector: 'ds-project-search-result-list-element', - styleUrls: ['./project-search-result-list-element.component.scss'], - templateUrl: './project-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, TruncatableComponent, ThemedBadgesComponent, AsyncPipe] + selector: 'ds-project-search-result-list-element', + styleUrls: ['./project-search-result-list-element.component.scss'], + templateUrl: './project-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, TruncatableComponent, ThemedBadgesComponent, AsyncPipe], }) /** * The component for displaying a list element for an item search result of the type Project diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts index b59dadaba3..2789c1eb26 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts @@ -1,27 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { Context } from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-org-unit-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-org-unit-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "OrgUnit" within the context of diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts index 69505f9328..618211b94a 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts @@ -1,32 +1,33 @@ import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { Context } from '../../../../../core/shared/context.model'; -import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; +import { Context } from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; +import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { isNotEmpty } from '../../../../../shared/empty.util'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-person-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-person-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Person" within the context of diff --git a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts index 0f16bc8032..25dc73a731 100644 --- a/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts +++ b/src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts @@ -1,27 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { Context } from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { - SidebarSearchListElementComponent -} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { - TruncatablePartComponent -} from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('ProjectSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('ProjectSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-project-sidebar-search-list-element', - templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-project-sidebar-search-list-element', + templateUrl: '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Project" within the context of diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts index cc8a34369a..a5d101c5d0 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts @@ -1,42 +1,31 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ItemPageImgFieldComponent } from '../../../../item-page/simple/field-components/specific-field/img/item-page-img-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { RouterLink } from '@angular/router'; +import { TabbedRelatedEntitiesSearchComponent } from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ItemPageImgFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/img/item-page-img-field.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('OrgUnit', ViewMode.StandalonePage) @Component({ - selector: 'ds-org-unit', - styleUrls: ['./org-unit.component.scss'], - templateUrl: './org-unit.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule, ItemPageImgFieldComponent] + selector: 'ds-org-unit', + styleUrls: ['./org-unit.component.scss'], + templateUrl: './org-unit.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule, ItemPageImgFieldComponent], }) /** * The component for displaying metadata and relations of an item of the type Organisation Unit diff --git a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts index 5ebad33704..56cb2b3fa9 100644 --- a/src/app/entity-groups/research-entities/item-pages/person/person.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -1,39 +1,30 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { RouterLink } from '@angular/router'; +import { TabbedRelatedEntitiesSearchComponent } from '../../../../item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('Person', ViewMode.StandalonePage) @Component({ - selector: 'ds-person', - styleUrls: ['./person.component.scss'], - templateUrl: './person.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule] + selector: 'ds-person', + styleUrls: ['./person.component.scss'], + templateUrl: './person.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Person diff --git a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts index ad5c44cb3c..b654f5e17c 100644 --- a/src/app/entity-groups/research-entities/item-pages/project/project.component.ts +++ b/src/app/entity-groups/research-entities/item-pages/project/project.component.ts @@ -1,39 +1,30 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { GenericItemPageFieldComponent } from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemComponent } from '../../../../item-page/simple/item-types/shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; +import { ThemedMetadataRepresentationListComponent } from '../../../../item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; import { RelatedItemsComponent } from '../../../../item-page/simple/related-items/related-items-component'; -import { - GenericItemPageFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { - ThemedMetadataRepresentationListComponent -} from '../../../../item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; @listableObjectComponent('Project', ViewMode.StandalonePage) @Component({ - selector: 'ds-project', - styleUrls: ['./project.component.scss'], - templateUrl: './project.component.html', - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-project', + styleUrls: ['./project.component.scss'], + templateUrl: './project.component.html', + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Project diff --git a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts index 956a026bc0..8ecfcaefbc 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts @@ -1,15 +1,20 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { RouterLink } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Item } from '../../../../core/shared/item.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; -import { RouterLink } from '@angular/router'; -import { - ItemMetadataRepresentation -} from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { OrgUnitItemMetadataListElementComponent } from './org-unit-item-metadata-list-element.component'; const description = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'; @@ -26,12 +31,12 @@ describe('OrgUnitItemMetadataListElementComponent', () => { TestBed.configureTestingModule({ imports: [ NgbModule, - OrgUnitItemMetadataListElementComponent + OrgUnitItemMetadataListElementComponent, ], schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(OrgUnitItemMetadataListElementComponent, { remove: { - imports: [TruncatableComponent, RouterLink] + imports: [TruncatableComponent, RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts index 3391aca0be..01477d4e09 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts @@ -1,16 +1,15 @@ import { Component } from '@angular/core'; -import { - ItemMetadataRepresentationListElementComponent -} from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; + +import { ItemMetadataRepresentationListElementComponent } from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; @Component({ - selector: 'ds-org-unit-item-metadata-list-element', - templateUrl: './org-unit-item-metadata-list-element.component.html', - standalone: true, - imports: [TruncatableComponent, RouterLink, NgbTooltipModule] + selector: 'ds-org-unit-item-metadata-list-element', + templateUrl: './org-unit-item-metadata-list-element.component.html', + standalone: true, + imports: [TruncatableComponent, RouterLink, NgbTooltipModule], }) /** * The component for displaying an item of the type OrgUnit as a metadata field diff --git a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts index 7dbe89aabc..05b322c0e2 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts @@ -1,15 +1,20 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { RouterLink } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Item } from '../../../../core/shared/item.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; +import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; -import { RouterLink } from '@angular/router'; -import { - ItemMetadataRepresentation -} from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { PersonItemMetadataListElementComponent } from './person-item-metadata-list-element.component'; const jobTitle = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.'; @@ -28,12 +33,12 @@ describe('PersonItemMetadataListElementComponent', () => { TestBed.configureTestingModule({ imports: [ NgbModule, - PersonItemMetadataListElementComponent + PersonItemMetadataListElementComponent, ], schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(PersonItemMetadataListElementComponent, { remove: { - imports: [TruncatableComponent, RouterLink] + imports: [TruncatableComponent, RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts index 9e40d5a0d0..48957a6cbd 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts @@ -1,17 +1,19 @@ -import { Component } from '@angular/core'; import { - ItemMetadataRepresentationListElementComponent -} from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; + NgFor, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; + +import { ItemMetadataRepresentationListElementComponent } from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; -import { NgFor, NgIf } from '@angular/common'; @Component({ - selector: 'ds-person-item-metadata-list-element', - templateUrl: './person-item-metadata-list-element.component.html', - standalone: true, - imports: [NgIf, NgFor, TruncatableComponent, RouterLink, NgbTooltipModule] + selector: 'ds-person-item-metadata-list-element', + templateUrl: './person-item-metadata-list-element.component.html', + standalone: true, + imports: [NgIf, NgFor, TruncatableComponent, RouterLink, NgbTooltipModule], }) /** * The component for displaying an item of the type Person as a metadata field diff --git a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.spec.ts b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.spec.ts index e6024717ff..05c73f31b5 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.spec.ts @@ -1,17 +1,22 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { RouterLink } from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../core/shared/item.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; -import { - ItemMetadataRepresentation -} from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; +import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; -import { RouterLink } from '@angular/router'; import { ProjectItemMetadataListElementComponent } from './project-item-metadata-list-element.component'; const projectTitle = 'Lorem ipsum dolor sit amet'; @@ -28,7 +33,7 @@ describe('ProjectItemMetadataListElementComponent', () => { TestBed.configureTestingModule({ imports: [ NgbModule, - ProjectItemMetadataListElementComponent + ProjectItemMetadataListElementComponent, ], providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, @@ -36,7 +41,7 @@ describe('ProjectItemMetadataListElementComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(ProjectItemMetadataListElementComponent, { remove: { - imports: [TruncatableComponent, RouterLink,] + imports: [TruncatableComponent, RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts index 887d7b25b7..84df74f110 100644 --- a/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts +++ b/src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts @@ -1,17 +1,16 @@ import { Component } from '@angular/core'; -import { - ItemMetadataRepresentationListElementComponent -} from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; + +import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { ItemMetadataRepresentationListElementComponent } from '../../../../shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component'; import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; @Component({ - selector: 'ds-project-item-metadata-list-element', - templateUrl: './project-item-metadata-list-element.component.html', - standalone: true, - imports: [TruncatableComponent, RouterLink, NgbTooltipModule] + selector: 'ds-project-item-metadata-list-element', + templateUrl: './project-item-metadata-list-element.component.html', + standalone: true, + imports: [TruncatableComponent, RouterLink, NgbTooltipModule], }) /** * The component for displaying an item of the type Project as a metadata field diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.spec.ts index 41febf19f3..af448acf97 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.spec.ts @@ -29,9 +29,9 @@ describe('ExternalSourceEntryListSubmissionElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ExternalSourceEntryListSubmissionElementComponent], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + imports: [TranslateModule.forRoot(), ExternalSourceEntryListSubmissionElementComponent], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.ts index 66e1959a83..d7c5b8aafd 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.ts @@ -1,8 +1,9 @@ +import { NgIf } from '@angular/common'; import { - Component, OnInit, } from '@angular/core'; + import { Context } from '../../../../../core/shared/context.model'; import { ExternalSourceEntry } from '../../../../../core/shared/external-source-entry.model'; import { MetadataValue } from '../../../../../core/shared/metadata.models'; @@ -10,16 +11,15 @@ import { Metadata } from '../../../../../core/shared/metadata.utils'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { AbstractListableElementComponent } from '../../../../../shared/object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { NgIf } from '@angular/common'; @listableObjectComponent(ExternalSourceEntry, ViewMode.ListElement, Context.EntitySearchModal) @listableObjectComponent(ExternalSourceEntry, ViewMode.ListElement, Context.EntitySearchModalWithNameVariants) @Component({ - selector: 'ds-external-source-entry-list-submission-element', - styleUrls: ['./external-source-entry-list-submission-element.component.scss'], - templateUrl: './external-source-entry-list-submission-element.component.html', - standalone: true, - imports: [NgIf] + selector: 'ds-external-source-entry-list-submission-element', + styleUrls: ['./external-source-entry-list-submission-element.component.scss'], + templateUrl: './external-source-entry-list-submission-element.component.html', + standalone: true, + imports: [NgIf], }) /** * The component for displaying a list element of an external source entry diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts index 7da4889467..a56dc45a39 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts @@ -1,11 +1,21 @@ import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; @@ -25,16 +35,14 @@ import { HALEndpointService } from '../../../../../core/shared/hal-endpoint.serv import { Item } from '../../../../../core/shared/item.model'; import { UUIDService } from '../../../../../core/shared/uuid.service'; import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; -import { - OrgUnitSearchResultListSubmissionElementComponent -} from './org-unit-search-result-list-submission-element.component'; -import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { OrgUnitSearchResultListSubmissionElementComponent } from './org-unit-search-result-list-submission-element.component'; let personListElementComponent: OrgUnitSearchResultListSubmissionElementComponent; let fixture: ComponentFixture; @@ -104,8 +112,8 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => { }, }; TestBed.configureTestingModule({ - imports: [TruncatePipe, OrgUnitSearchResultListSubmissionElementComponent], - providers: [ + imports: [TruncatePipe, OrgUnitSearchResultListSubmissionElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: NotificationsService, useValue: {} }, @@ -125,9 +133,9 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => { { provide: BitstreamDataService, useValue: mockBitstreamDataService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitSearchResultListSubmissionElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(OrgUnitSearchResultListSubmissionElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts index 6389dacd46..b2e62fcb37 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts @@ -1,9 +1,18 @@ -import { Component, Inject, OnInit, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { take } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from '../../../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { ItemDataService } from '../../../../../core/data/item-data.service'; @@ -14,27 +23,21 @@ import { MetadataValue } from '../../../../../core/shared/metadata.models'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - SearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component'; -import { FormsModule } from '@angular/forms'; import { OrgUnitInputSuggestionsComponent } from './org-unit-suggestions/org-unit-input-suggestions.component'; -import { NgIf } from '@angular/common'; @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModal) @listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants) @Component({ - selector: 'ds-person-search-result-list-submission-element', - styleUrls: ['./org-unit-search-result-list-submission-element.component.scss'], - templateUrl: './org-unit-search-result-list-submission-element.component.html', - standalone: true, - imports: [NgIf, OrgUnitInputSuggestionsComponent, FormsModule] + selector: 'ds-person-search-result-list-submission-element', + styleUrls: ['./org-unit-search-result-list-submission-element.component.scss'], + templateUrl: './org-unit-search-result-list-submission-element.component.html', + standalone: true, + imports: [NgIf, OrgUnitInputSuggestionsComponent, FormsModule], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts index be05f9702f..0808749146 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts @@ -1,5 +1,12 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; @@ -20,14 +27,14 @@ describe('OrgUnitInputSuggestionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, OrgUnitInputSuggestionsComponent, TranslateModule.forRoot(), - ], - providers: [], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrgUnitInputSuggestionsComponent, { + ], + providers: [], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(OrgUnitInputSuggestionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts index 0b86222701..073a7aacce 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts @@ -1,26 +1,39 @@ -import { Component, forwardRef, Input, OnInit, } from '@angular/core'; -import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; -import { AsyncPipe, NgClass, NgFor } from '@angular/common'; -import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; -import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.directive'; +import { + AsyncPipe, + NgClass, + NgFor, +} from '@angular/common'; +import { + Component, + forwardRef, + Input, + OnInit, +} from '@angular/core'; +import { + FormsModule, + NG_VALUE_ACCESSOR, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; +import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.directive'; +import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; + @Component({ - selector: 'ds-org-unit-input-suggestions', - styleUrls: ['./org-unit-input-suggestions.component.scss', './../../../../../../shared/input-suggestions/input-suggestions.component.scss'], - templateUrl: './org-unit-input-suggestions.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 - // eslint-disable-next-line @angular-eslint/no-forward-ref - useExisting: forwardRef(() => OrgUnitInputSuggestionsComponent), - multi: true - } - ], - standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-org-unit-input-suggestions', + styleUrls: ['./org-unit-input-suggestions.component.scss', './../../../../../../shared/input-suggestions/input-suggestions.component.scss'], + templateUrl: './org-unit-input-suggestions.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 + // eslint-disable-next-line @angular-eslint/no-forward-ref + useExisting: forwardRef(() => OrgUnitInputSuggestionsComponent), + multi: true, + }, + ], + standalone: true, + imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts index b33cd7a93e..ecb62e6b79 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts @@ -1,13 +1,27 @@ import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, Component, EventEmitter, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; +import { REQUEST } from '@nguniversal/express-engine/tokens'; import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; +import { AuthService } from '../../../../../core/auth/auth.service'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../../core/cache/object-cache.service'; import { CommunityDataService } from '../../../../../core/data/community-data.service'; @@ -21,19 +35,15 @@ import { Bitstream } from '../../../../../core/shared/bitstream.model'; import { HALEndpointService } from '../../../../../core/shared/hal-endpoint.service'; import { Item } from '../../../../../core/shared/item.model'; import { UUIDService } from '../../../../../core/shared/uuid.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; -import { - PersonSearchResultListSubmissionElementComponent -} from './person-search-result-list-submission-element.component'; -import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type'; -import { AuthService } from '../../../../../core/auth/auth.service'; -import { REQUEST } from '@nguniversal/express-engine/tokens'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { PersonSearchResultListSubmissionElementComponent } from './person-search-result-list-submission-element.component'; let personListElementComponent: PersonSearchResultListSubmissionElementComponent; let fixture: ComponentFixture; @@ -61,7 +71,7 @@ const translateServiceStub = { instant: (key) => key, onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), - onDefaultLangChange: new EventEmitter() + onDefaultLangChange: new EventEmitter(), }; function init() { @@ -117,8 +127,8 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { beforeEach(waitForAsync(() => { init(); await TestBed.configureTestingModule({ - imports: [TruncatePipe, PersonSearchResultListSubmissionElementComponent], - providers: [ + imports: [TruncatePipe, PersonSearchResultListSubmissionElementComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: TranslateService, useValue: translateServiceStub }, @@ -138,10 +148,10 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: AuthService, useValue: {} }, { provide: REQUEST, useValue: {} }, { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [NO_ERRORS_SCHEMA] + ], + schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(PersonSearchResultListSubmissionElementComponent, { - set: { changeDetection: ChangeDetectionStrategy.Default } + set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -158,20 +168,20 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { new Item(), { - metadata: { - 'dc.title': [ - { - language: 'en_US', - value: 'This is just another title' - } - ], - 'person.jobTitle': [ - { - language: 'en_US', - value: 'Developer' - } - ] - } + metadata: { + 'dc.title': [ + { + language: 'en_US', + value: 'This is just another title', + }, + ], + 'person.jobTitle': [ + { + language: 'en_US', + value: 'Developer', + }, + ], + }, }); fixture.detectChanges(); }); @@ -217,8 +227,8 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TruncatePipe, PersonSearchResultListSubmissionElementComponent], - providers: [ + imports: [TruncatePipe, PersonSearchResultListSubmissionElementComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: TranslateService, useValue: translateServiceStub }, @@ -235,9 +245,9 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: DSOChangeAnalyzer, useValue: {} }, { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PersonSearchResultListSubmissionElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(PersonSearchResultListSubmissionElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts index 3a1084f156..49d6ecb59c 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts @@ -1,11 +1,22 @@ -import { Component, Inject, OnInit } from '@angular/core'; import { - SearchResultListElementComponent -} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { take } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from '../../../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../../../config/app-config.interface'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { ItemDataService } from '../../../../../core/data/item-data.service'; import { RelationshipDataService } from '../../../../../core/data/relationship-data.service'; @@ -14,24 +25,21 @@ import { Item } from '../../../../../core/shared/item.model'; import { MetadataValue } from '../../../../../core/shared/metadata.models'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; -import { - listableObjectComponent -} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; +import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; -import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component'; -import { FormsModule } from '@angular/forms'; -import { PersonInputSuggestionsComponent } from './person-suggestions/person-input-suggestions.component'; import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; +import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component'; +import { PersonInputSuggestionsComponent } from './person-suggestions/person-input-suggestions.component'; @listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.EntitySearchModalWithNameVariants) @Component({ - selector: 'ds-person-search-result-list-submission-element', - styleUrls: ['./person-search-result-list-submission-element.component.scss'], - templateUrl: './person-search-result-list-submission-element.component.html', - standalone: true, - imports: [NgIf, ThumbnailComponent, NgClass, PersonInputSuggestionsComponent, FormsModule, NgFor, AsyncPipe] + selector: 'ds-person-search-result-list-submission-element', + styleUrls: ['./person-search-result-list-submission-element.component.scss'], + templateUrl: './person-search-result-list-submission-element.component.html', + standalone: true, + imports: [NgIf, ThumbnailComponent, NgClass, PersonInputSuggestionsComponent, FormsModule, NgFor, AsyncPipe], }) /** diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts index d58244c58a..0058789811 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts @@ -1,26 +1,39 @@ -import { Component, forwardRef, Input, OnInit, } from '@angular/core'; -import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; -import { AsyncPipe, NgClass, NgFor } from '@angular/common'; -import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; -import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.directive'; +import { + AsyncPipe, + NgClass, + NgFor, +} from '@angular/common'; +import { + Component, + forwardRef, + Input, + OnInit, +} from '@angular/core'; +import { + FormsModule, + NG_VALUE_ACCESSOR, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; +import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.directive'; +import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; + @Component({ - selector: 'ds-person-input-suggestions', - styleUrls: ['./person-input-suggestions.component.scss', './../../../../../../shared/input-suggestions/input-suggestions.component.scss'], - templateUrl: './person-input-suggestions.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 - // eslint-disable-next-line @angular-eslint/no-forward-ref - useExisting: forwardRef(() => PersonInputSuggestionsComponent), - multi: true - } - ], - standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-person-input-suggestions', + styleUrls: ['./person-input-suggestions.component.scss', './../../../../../../shared/input-suggestions/input-suggestions.component.scss'], + templateUrl: './person-input-suggestions.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 + // eslint-disable-next-line @angular-eslint/no-forward-ref + useExisting: forwardRef(() => PersonInputSuggestionsComponent), + multi: true, + }, + ], + standalone: true, + imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.spec.ts b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.spec.ts index 2f658c383b..ef20ec3a5c 100644 --- a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.spec.ts +++ b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.spec.ts @@ -24,9 +24,9 @@ describe('NameVariantModalComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [NgbModule, TranslateModule.forRoot(), NameVariantModalComponent], - providers: [{ provide: NgbActiveModal, useValue: modal }], -}) + imports: [NgbModule, TranslateModule.forRoot(), NameVariantModalComponent], + providers: [{ provide: NgbActiveModal, useValue: modal }], + }) .compileComponents(); })); diff --git a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts index 16211591aa..2276d1d191 100644 --- a/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts +++ b/src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts @@ -10,11 +10,11 @@ import { TranslateModule } from '@ngx-translate/core'; * The user can either choose to decline or accept to save the name variant as a metadata in the entity */ @Component({ - selector: 'ds-name-variant-modal', - templateUrl: './name-variant-modal.component.html', - styleUrls: ['./name-variant-modal.component.scss'], - standalone: true, - imports: [TranslateModule] + selector: 'ds-name-variant-modal', + templateUrl: './name-variant-modal.component.html', + styleUrls: ['./name-variant-modal.component.scss'], + standalone: true, + imports: [TranslateModule], }) /** * The component for the modal to add a name variant to an item diff --git a/src/app/footer/footer.component.spec.ts b/src/app/footer/footer.component.spec.ts index 92e7db4a84..da8114bdad 100644 --- a/src/app/footer/footer.component.spec.ts +++ b/src/app/footer/footer.component.spec.ts @@ -41,19 +41,19 @@ let notifyInfoService = { describe('Footer component', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), FooterComponent], - providers: [ + imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), FooterComponent], + providers: [ FooterComponent, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: NotifyInfoService, useValue: notifyInfoService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); // synchronous beforeEach diff --git a/src/app/footer/footer.component.ts b/src/app/footer/footer.component.ts index 20869674a6..3043cf3284 100644 --- a/src/app/footer/footer.component.ts +++ b/src/app/footer/footer.component.ts @@ -1,25 +1,29 @@ +import { + AsyncPipe, + DatePipe, + NgIf, +} from '@angular/common'; import { Component, Optional, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { environment } from '../../environments/environment'; import { NotifyInfoService } from '../core/coar-notify/notify-info/notify-info.service'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../core/data/feature-authorization/feature-id'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe, DatePipe } from '@angular/common'; import { KlaroService } from '../shared/cookies/klaro.service'; import { hasValue } from '../shared/empty.util'; @Component({ - selector: 'ds-footer', - styleUrls: ['footer.component.scss'], - templateUrl: 'footer.component.html', - standalone: true, - imports: [NgIf, RouterLink, AsyncPipe, DatePipe, TranslateModule] + selector: 'ds-footer', + styleUrls: ['footer.component.scss'], + templateUrl: 'footer.component.html', + standalone: true, + imports: [NgIf, RouterLink, AsyncPipe, DatePipe, TranslateModule], }) export class FooterComponent { dateObj: number = Date.now(); diff --git a/src/app/footer/themed-footer.component.ts b/src/app/footer/themed-footer.component.ts index 8227f5a8b6..1c3ae83026 100644 --- a/src/app/footer/themed-footer.component.ts +++ b/src/app/footer/themed-footer.component.ts @@ -7,10 +7,10 @@ import { FooterComponent } from './footer.component'; * Themed wrapper for FooterComponent */ @Component({ - selector: 'ds-themed-footer', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-footer', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedFooterComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forbidden/forbidden.component.ts b/src/app/forbidden/forbidden.component.ts index d7cc6044e9..03441f1bff 100644 --- a/src/app/forbidden/forbidden.component.ts +++ b/src/app/forbidden/forbidden.component.ts @@ -2,21 +2,21 @@ import { Component, OnInit, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { AuthService } from '../core/auth/auth.service'; import { ServerResponseService } from '../core/services/server-response.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; /** * This component representing the `Forbidden` DSpace page. */ @Component({ - selector: 'ds-forbidden', - templateUrl: './forbidden.component.html', - styleUrls: ['./forbidden.component.scss'], - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-forbidden', + templateUrl: './forbidden.component.html', + styleUrls: ['./forbidden.component.scss'], + standalone: true, + imports: [RouterLink, TranslateModule], }) export class ForbiddenComponent implements OnInit { diff --git a/src/app/forbidden/themed-forbidden.component.ts b/src/app/forbidden/themed-forbidden.component.ts index 3a97925473..85efec18ee 100644 --- a/src/app/forbidden/themed-forbidden.component.ts +++ b/src/app/forbidden/themed-forbidden.component.ts @@ -7,10 +7,10 @@ import { ForbiddenComponent } from './forbidden.component'; * Themed wrapper for ForbiddenComponent */ @Component({ - selector: 'ds-themed-forbidden', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-forbidden', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedForbiddenComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forgot-password/forgot-password-email/forgot-email.component.spec.ts b/src/app/forgot-password/forgot-password-email/forgot-email.component.spec.ts index 28303e3b43..5ddeae8051 100644 --- a/src/app/forgot-password/forgot-password-email/forgot-email.component.spec.ts +++ b/src/app/forgot-password/forgot-password-email/forgot-email.component.spec.ts @@ -1,11 +1,15 @@ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { RegisterEmailFormComponent } from '../../register-email-form/register-email-form.component'; -import { ThemedRegisterEmailFormComponent } from '../../register-email-form/themed-registry-email-form.component'; import { TranslateModule } from '@ngx-translate/core'; +import { RegisterEmailFormComponent } from '../../register-email-form/register-email-form.component'; +import { ThemedRegisterEmailFormComponent } from '../../register-email-form/themed-registry-email-form.component'; import { ForgotEmailComponent } from './forgot-email.component'; describe('ForgotEmailComponent', () => { @@ -15,12 +19,12 @@ describe('ForgotEmailComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, ForgotEmailComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) .overrideComponent(ForgotEmailComponent, { remove: { - imports: [RegisterEmailFormComponent, ThemedRegisterEmailFormComponent] - } + imports: [RegisterEmailFormComponent, ThemedRegisterEmailFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/forgot-password/forgot-password-email/forgot-email.component.ts b/src/app/forgot-password/forgot-password-email/forgot-email.component.ts index 4c91eb7f1a..a7455c4ca9 100644 --- a/src/app/forgot-password/forgot-password-email/forgot-email.component.ts +++ b/src/app/forgot-password/forgot-password-email/forgot-email.component.ts @@ -1,19 +1,19 @@ import { Component } from '@angular/core'; +import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; import { RegisterEmailFormComponent, - TYPE_REQUEST_FORGOT + TYPE_REQUEST_FORGOT, } from '../../register-email-form/register-email-form.component'; -import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; @Component({ selector: 'ds-forgot-email', styleUrls: ['./forgot-email.component.scss'], templateUrl: './forgot-email.component.html', imports: [ - RegisterEmailFormComponent, ThemedRegisterEmailFormComponent + RegisterEmailFormComponent, ThemedRegisterEmailFormComponent, ], - standalone: true + standalone: true, }) /** * Component responsible the forgot password email step diff --git a/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts b/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts index e6b0ad888b..936815a49c 100644 --- a/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts +++ b/src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts @@ -7,10 +7,10 @@ import { ForgotEmailComponent } from './forgot-email.component'; * Themed wrapper for ForgotEmailComponent */ @Component({ - selector: 'ds-themed-forgot-email', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-forgot-email', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedForgotEmailComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts index 2cb68d7deb..831b46887e 100644 --- a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts +++ b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts @@ -10,6 +10,7 @@ import { UntypedFormBuilder, } from '@angular/forms'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router, @@ -31,7 +32,6 @@ import { } from '../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../shared/testing/router.stub'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; import { ForgotPasswordFormComponent } from './forgot-password-form.component'; @@ -66,25 +66,25 @@ describe('ForgotPasswordFormComponent', () => { }); TestBed.configureTestingModule({ - imports: [ - CommonModule, - RouterTestingModule.withRoutes([]), - TranslateModule.forRoot(), - ReactiveFormsModule, - BrowserOnlyPipe, - ForgotPasswordFormComponent, - NoopAnimationsModule - ], - providers: [ + imports: [ + CommonModule, + RouterTestingModule.withRoutes([]), + TranslateModule.forRoot(), + ReactiveFormsModule, + BrowserOnlyPipe, + ForgotPasswordFormComponent, + NoopAnimationsModule, + ], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: Store, useValue: store }, { provide: EPersonDataService, useValue: ePersonDataService }, { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, { provide: NotificationsService, useValue: notificationsService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(ForgotPasswordFormComponent); diff --git a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts index d1ae534cbd..3d8d6e3cd7 100644 --- a/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts +++ b/src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts @@ -1,7 +1,17 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { Store } from '@ngrx/store'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -10,14 +20,14 @@ import { CoreState } from '../../core/core-state.model'; import { RemoteData } from '../../core/data/remote-data'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; import { - ProfilePageSecurityFormComponent -} from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../core/shared/operators'; import { Registration } from '../../core/shared/registration.model'; +import { ProfilePageSecurityFormComponent } from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { BrowserOnlyPipe } from '../../shared/utils/browser-only.pipe'; @Component({ selector: 'ds-forgot-password-form', @@ -28,9 +38,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s BrowserOnlyPipe, ProfilePageSecurityFormComponent, AsyncPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component for a user to enter a new password for a forgot token. diff --git a/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts b/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts index 81fa215648..e74fed2f36 100644 --- a/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts +++ b/src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts @@ -7,10 +7,10 @@ import { ForgotPasswordFormComponent } from './forgot-password-form.component'; * Themed wrapper for ForgotPasswordFormComponent */ @Component({ - selector: 'ds-themed-forgot-password-form', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-forgot-password-form', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedForgotPasswordFormComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/forgot-password/forgot-password-routes.ts b/src/app/forgot-password/forgot-password-routes.ts index be03400de4..f04f6a2a09 100644 --- a/src/app/forgot-password/forgot-password-routes.ts +++ b/src/app/forgot-password/forgot-password-routes.ts @@ -1,17 +1,18 @@ -import { ItemPageResolver } from '../item-page/item-page.resolver'; -import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed-forgot-password-form.component'; -import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component'; -import { RegistrationGuard } from '../register-page/registration.guard'; import { Route } from '@angular/router'; +import { ItemPageResolver } from '../item-page/item-page.resolver'; +import { RegistrationGuard } from '../register-page/registration.guard'; +import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component'; +import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed-forgot-password-form.component'; + export const ROUTES: Route[] = [ { path: '', component: ThemedForgotEmailComponent, - data: {title: 'forgot-password.title'}, + data: { title: 'forgot-password.title' }, providers: [ ItemPageResolver, - ] + ], }, { path: ':token', @@ -19,6 +20,6 @@ export const ROUTES: Route[] = [ canActivate: [RegistrationGuard], providers: [ ItemPageResolver, - ] - } + ], + }, ]; diff --git a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts index 8496fb350c..862173b9bb 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -1,22 +1,31 @@ -import { Component, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgClass, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { Observable } from 'rxjs'; -import { HostWindowService, WidthCategory, } from '../shared/host-window.service'; +import { ThemedHeaderComponent } from '../header/themed-header.component'; +import { ThemedNavbarComponent } from '../navbar/themed-navbar.component'; +import { + HostWindowService, + WidthCategory, +} from '../shared/host-window.service'; import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; -import { ThemedNavbarComponent } from '../navbar/themed-navbar.component'; -import { ThemedHeaderComponent } from '../header/themed-header.component'; -import { AsyncPipe, NgClass } from '@angular/common'; /** * This component represents a wrapper for the horizontal navbar and the header */ @Component({ - selector: 'ds-header-navbar-wrapper', - styleUrls: ['header-navbar-wrapper.component.scss'], - templateUrl: 'header-navbar-wrapper.component.html', - standalone: true, - imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe] + selector: 'ds-header-navbar-wrapper', + styleUrls: ['header-navbar-wrapper.component.scss'], + templateUrl: 'header-navbar-wrapper.component.html', + standalone: true, + imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe], }) export class HeaderNavbarWrapperComponent implements OnInit { public isNavBarCollapsed$: Observable; diff --git a/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts b/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts index 8bf50098dd..5895530e8a 100644 --- a/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/themed-header-navbar-wrapper.component.ts @@ -7,10 +7,10 @@ import { HeaderNavbarWrapperComponent } from './header-navbar-wrapper.component' * Themed wrapper for {@link HeaderNavbarWrapperComponent} */ @Component({ - selector: 'ds-themed-header-navbar-wrapper', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-header-navbar-wrapper', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedHeaderNavbarWrapperComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts b/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts index 3c0a075286..d538ce520b 100644 --- a/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts +++ b/src/app/header/context-help-toggle/context-help-toggle.component.spec.ts @@ -22,11 +22,11 @@ describe('ContextHelpToggleComponent', () => { ]); contextHelpService.tooltipCount$.and.returnValue(observableOf(0)); await TestBed.configureTestingModule({ - providers: [ + providers: [ { provide: ContextHelpService, useValue: contextHelpService }, - ], - imports: [TranslateModule.forRoot(), ContextHelpToggleComponent], -}) + ], + imports: [TranslateModule.forRoot(), ContextHelpToggleComponent], + }) .compileComponents(); }); diff --git a/src/app/header/context-help-toggle/context-help-toggle.component.ts b/src/app/header/context-help-toggle/context-help-toggle.component.ts index de743e8926..8ef0d107e0 100644 --- a/src/app/header/context-help-toggle/context-help-toggle.component.ts +++ b/src/app/header/context-help-toggle/context-help-toggle.component.ts @@ -1,15 +1,18 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, ElementRef, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, Subscription, } from 'rxjs'; import { map } from 'rxjs/operators'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf, AsyncPipe } from '@angular/common'; import { ContextHelpService } from '../../shared/context-help.service'; @@ -18,11 +21,11 @@ import { ContextHelpService } from '../../shared/context-help.service'; * If there are no tooltip buttons available on the current page, the toggle is unclickable. */ @Component({ - selector: 'ds-context-help-toggle', - templateUrl: './context-help-toggle.component.html', - styleUrls: ['./context-help-toggle.component.scss'], - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + selector: 'ds-context-help-toggle', + templateUrl: './context-help-toggle.component.html', + styleUrls: ['./context-help-toggle.component.scss'], + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule], }) export class ContextHelpToggleComponent implements OnInit { buttonVisible$: Observable; diff --git a/src/app/header/header.component.spec.ts b/src/app/header/header.component.spec.ts index 30dfc3d183..e15d69c9e0 100644 --- a/src/app/header/header.component.spec.ts +++ b/src/app/header/header.component.spec.ts @@ -1,25 +1,32 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateModule } from '@ngx-translate/core'; -import { of, of as observableOf } from 'rxjs'; - -import { HeaderComponent } from './header.component'; -import { MenuService } from '../shared/menu/menu.service'; -import { MenuServiceStub } from '../shared/testing/menu-service.stub'; -import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + of as observableOf, + of, +} from 'rxjs'; + import { LocaleService } from '../core/locale/locale.service'; import { ThemedSearchNavbarComponent } from '../search-navbar/themed-search-navbar.component'; -import { LangSwitchComponent } from '../shared/lang-switch/lang-switch.component'; -import { ContextHelpToggleComponent } from './context-help-toggle/context-help-toggle.component'; import { ThemedAuthNavMenuComponent } from '../shared/auth-nav-menu/themed-auth-nav-menu.component'; -import { ImpersonateNavbarComponent } from '../shared/impersonate-navbar/impersonate-navbar.component'; import { HostWindowService } from '../shared/host-window.service'; -import { HostWindowServiceStub } from '../shared/testing/host-window-service.stub'; +import { ImpersonateNavbarComponent } from '../shared/impersonate-navbar/impersonate-navbar.component'; +import { LangSwitchComponent } from '../shared/lang-switch/lang-switch.component'; import { ThemedLangSwitchComponent } from '../shared/lang-switch/themed-lang-switch.component'; +import { MenuService } from '../shared/menu/menu.service'; +import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; +import { HostWindowServiceStub } from '../shared/testing/host-window-service.stub'; +import { MenuServiceStub } from '../shared/testing/menu-service.stub'; +import { ContextHelpToggleComponent } from './context-help-toggle/context-help-toggle.component'; +import { HeaderComponent } from './header.component'; let comp: HeaderComponent; let fixture: ComponentFixture; @@ -30,30 +37,30 @@ describe('HeaderComponent', () => { const languageList = ['en;q=1', 'it;q=0.9', 'de;q=0.8', 'fr;q=0.7']; const mockLocaleService = jasmine.createSpyObj('LocaleService', { getCurrentLanguageCode: jasmine.createSpy('getCurrentLanguageCode'), - getLanguageCodeList: of(languageList) + getLanguageCodeList: of(languageList), }); // waitForAsync beforeEach beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, ReactiveFormsModule, - HeaderComponent - ], - providers: [ + HeaderComponent, + ], + providers: [ { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: MenuService, useValue: menuService }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub()}, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: LocaleService, useValue: mockLocaleService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(HeaderComponent, { - remove: {imports: [ ThemedLangSwitchComponent, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent,]} + remove: { imports: [ ThemedLangSwitchComponent, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent] }, }) .compileComponents(); // compile template and css })); diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index 07485162f3..e75d03c528 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -1,29 +1,38 @@ -import { Component, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { HostWindowService, WidthCategory, } from '../shared/host-window.service'; +import { ThemedSearchNavbarComponent } from '../search-navbar/themed-search-navbar.component'; +import { ThemedAuthNavMenuComponent } from '../shared/auth-nav-menu/themed-auth-nav-menu.component'; +import { + HostWindowService, + WidthCategory, +} from '../shared/host-window.service'; +import { ImpersonateNavbarComponent } from '../shared/impersonate-navbar/impersonate-navbar.component'; +import { LangSwitchComponent } from '../shared/lang-switch/lang-switch.component'; +import { ThemedLangSwitchComponent } from '../shared/lang-switch/themed-lang-switch.component'; import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ImpersonateNavbarComponent } from '../shared/impersonate-navbar/impersonate-navbar.component'; -import { ThemedAuthNavMenuComponent } from '../shared/auth-nav-menu/themed-auth-nav-menu.component'; import { ContextHelpToggleComponent } from './context-help-toggle/context-help-toggle.component'; -import { LangSwitchComponent } from '../shared/lang-switch/lang-switch.component'; -import { ThemedSearchNavbarComponent } from '../search-navbar/themed-search-navbar.component'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { RouterLink } from '@angular/router'; -import { ThemedLangSwitchComponent } from '../shared/lang-switch/themed-lang-switch.component'; -import { AsyncPipe, NgIf } from '@angular/common'; /** * Represents the header with the logo and simple navigation */ @Component({ - selector: 'ds-header', - styleUrls: ['header.component.scss'], - templateUrl: 'header.component.html', - standalone: true, - imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule, AsyncPipe, NgIf] + selector: 'ds-header', + styleUrls: ['header.component.scss'], + templateUrl: 'header.component.html', + standalone: true, + imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule, AsyncPipe, NgIf], }) export class HeaderComponent implements OnInit { /** diff --git a/src/app/header/themed-header.component.ts b/src/app/header/themed-header.component.ts index c1731c7469..bc3e5af09f 100644 --- a/src/app/header/themed-header.component.ts +++ b/src/app/header/themed-header.component.ts @@ -7,10 +7,10 @@ import { HeaderComponent } from './header.component'; * Themed wrapper for HeaderComponent */ @Component({ - selector: 'ds-themed-header', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-header', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedHeaderComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/health-page/health-info/health-info-component/health-info-component.component.spec.ts b/src/app/health-page/health-info/health-info-component/health-info-component.component.spec.ts index ffedc37eb4..887add011a 100644 --- a/src/app/health-page/health-info/health-info-component/health-info-component.component.spec.ts +++ b/src/app/health-page/health-info/health-info-component/health-info-component.component.spec.ts @@ -32,8 +32,8 @@ describe('HealthInfoComponentComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), HealthInfoComponentComponent, ObjNgFor, diff --git a/src/app/health-page/health-info/health-info-component/health-info-component.component.ts b/src/app/health-page/health-info/health-info-component/health-info-component.component.ts index d3df673d07..5c65586327 100644 --- a/src/app/health-page/health-info/health-info-component/health-info-component.component.ts +++ b/src/app/health-page/health-info/health-info-component/health-info-component.component.ts @@ -1,20 +1,27 @@ -import { Component, Input, } from '@angular/core'; - -import { HealthComponentComponent } from '../../health-panel/health-component/health-component.component'; -import { ObjNgFor } from '../../../shared/utils/object-ngfor.pipe'; +import { + NgFor, + NgIf, + TitleCasePipe, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgFor, NgIf, TitleCasePipe } from '@angular/common'; + +import { ObjNgFor } from '../../../shared/utils/object-ngfor.pipe'; +import { HealthComponentComponent } from '../../health-panel/health-component/health-component.component'; import { HealthInfoComponent } from '../../models/health-component.model'; /** * Shows a health info object */ @Component({ - selector: 'ds-health-info-component', - templateUrl: './health-info-component.component.html', - styleUrls: ['./health-info-component.component.scss'], - standalone: true, - imports: [NgFor, NgIf, NgbCollapseModule, TitleCasePipe, ObjNgFor] + selector: 'ds-health-info-component', + templateUrl: './health-info-component.component.html', + styleUrls: ['./health-info-component.component.scss'], + standalone: true, + imports: [NgFor, NgIf, NgbCollapseModule, TitleCasePipe, ObjNgFor], }) export class HealthInfoComponentComponent extends HealthComponentComponent { diff --git a/src/app/health-page/health-info/health-info.component.spec.ts b/src/app/health-page/health-info/health-info.component.spec.ts index 9373b674c2..725ca1c931 100644 --- a/src/app/health-page/health-info/health-info.component.spec.ts +++ b/src/app/health-page/health-info/health-info.component.spec.ts @@ -21,20 +21,20 @@ describe('HealthInfoComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), HealthInfoComponent, ObjNgFor, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-info/health-info.component.ts b/src/app/health-page/health-info/health-info.component.ts index 808b616213..fe795104e8 100644 --- a/src/app/health-page/health-info/health-info.component.ts +++ b/src/app/health-page/health-info/health-info.component.ts @@ -1,16 +1,20 @@ +import { + NgFor, + NgIf, + TitleCasePipe, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; +import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; -import { HealthInfoResponse } from '../models/health-component.model'; import { ObjNgFor } from '../../shared/utils/object-ngfor.pipe'; -import { HealthInfoComponentComponent } from './health-info-component/health-info-component.component'; import { HealthStatusComponent } from '../health-panel/health-status/health-status.component'; -import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf, NgFor, TitleCasePipe } from '@angular/common'; +import { HealthInfoResponse } from '../models/health-component.model'; +import { HealthInfoComponentComponent } from './health-info-component/health-info-component.component'; /** * A component to render a "health-info component" object. @@ -20,11 +24,11 @@ import { NgIf, NgFor, TitleCasePipe } from '@angular/common'; * API. */ @Component({ - selector: 'ds-health-info', - templateUrl: './health-info.component.html', - styleUrls: ['./health-info.component.scss'], - standalone: true, - imports: [NgIf, NgbAccordionModule, NgFor, HealthStatusComponent, HealthInfoComponentComponent, TitleCasePipe, ObjNgFor] + selector: 'ds-health-info', + templateUrl: './health-info.component.html', + styleUrls: ['./health-info.component.scss'], + standalone: true, + imports: [NgIf, NgbAccordionModule, NgFor, HealthStatusComponent, HealthInfoComponentComponent, TitleCasePipe, ObjNgFor], }) export class HealthInfoComponent implements OnInit { diff --git a/src/app/health-page/health-page-routes.ts b/src/app/health-page/health-page-routes.ts index e1057d7cc5..befd4d218c 100644 --- a/src/app/health-page/health-page-routes.ts +++ b/src/app/health-page/health-page-routes.ts @@ -1,10 +1,8 @@ import { Route } from '@angular/router'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { SiteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { HealthPageComponent } from './health-page.component'; -import { - SiteAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; export const ROUTES: Route[] = [ { @@ -15,7 +13,7 @@ export const ROUTES: Route[] = [ title: 'health-page.title', }, canActivate: [SiteAdministratorGuard], - component: HealthPageComponent - } + component: HealthPageComponent, + }, ]; diff --git a/src/app/health-page/health-page.component.spec.ts b/src/app/health-page/health-page.component.spec.ts index a46c2098e1..7a62471c78 100644 --- a/src/app/health-page/health-page.component.spec.ts +++ b/src/app/health-page/health-page.component.spec.ts @@ -43,22 +43,22 @@ describe('HealthPageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbNavModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - HealthPageComponent - ], - providers: [ + HealthPageComponent, + ], + providers: [ { provide: HealthService, useValue: healthService }, ], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-page.component.ts b/src/app/health-page/health-page.component.ts index 4ce4c4f267..778e63ed50 100644 --- a/src/app/health-page/health-page.component.ts +++ b/src/app/health-page/health-page.component.ts @@ -1,23 +1,32 @@ -import { Component, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { take } from 'rxjs/operators'; -import { HealthService } from './health.service'; -import { HealthInfoResponse, HealthResponse } from './models/health-component.model'; -import { TranslateModule } from '@ngx-translate/core'; import { AlertComponent } from '../shared/alert/alert.component'; +import { AlertType } from '../shared/alert/alert-type'; +import { HealthService } from './health.service'; import { HealthInfoComponent } from './health-info/health-info.component'; import { HealthPanelComponent } from './health-panel/health-panel.component'; -import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { AlertType } from '../shared/alert/alert-type'; +import { + HealthInfoResponse, + HealthResponse, +} from './models/health-component.model'; @Component({ - selector: 'ds-health-page', - templateUrl: './health-page.component.html', - styleUrls: ['./health-page.component.scss'], - standalone: true, - imports: [NgIf, NgbNavModule, HealthPanelComponent, HealthInfoComponent, AlertComponent, AsyncPipe, TranslateModule] + selector: 'ds-health-page', + templateUrl: './health-page.component.html', + styleUrls: ['./health-page.component.scss'], + standalone: true, + imports: [NgIf, NgbNavModule, HealthPanelComponent, HealthInfoComponent, AlertComponent, AsyncPipe, TranslateModule], }) export class HealthPageComponent implements OnInit { diff --git a/src/app/health-page/health-panel/health-component/health-component.component.spec.ts b/src/app/health-page/health-panel/health-component/health-component.component.spec.ts index 053fe86b49..37bd593cf6 100644 --- a/src/app/health-page/health-panel/health-component/health-component.component.spec.ts +++ b/src/app/health-page/health-panel/health-component/health-component.component.spec.ts @@ -26,22 +26,22 @@ describe('HealthComponentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbCollapseModule, NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), HealthComponentComponent, ObjNgFor, - ], + ], schemas: [NO_ERRORS_SCHEMA], - }) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-panel/health-component/health-component.component.ts b/src/app/health-page/health-panel/health-component/health-component.component.ts index 144b8ea547..769f5b545b 100644 --- a/src/app/health-page/health-panel/health-component/health-component.component.ts +++ b/src/app/health-page/health-panel/health-component/health-component.component.ts @@ -1,11 +1,18 @@ -import { Component, Input, } from '@angular/core'; +import { + NgFor, + NgIf, + TitleCasePipe, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; import { ObjNgFor } from '../../../shared/utils/object-ngfor.pipe'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgFor, NgIf, TitleCasePipe } from '@angular/common'; import { HealthComponent } from '../../models/health-component.model'; /** @@ -16,11 +23,11 @@ import { HealthComponent } from '../../models/health-component.model'; * API. */ @Component({ - selector: 'ds-health-component', - templateUrl: './health-component.component.html', - styleUrls: ['./health-component.component.scss'], - standalone: true, - imports: [NgIf, NgFor, NgbCollapseModule, AlertComponent, TitleCasePipe, ObjNgFor] + selector: 'ds-health-component', + templateUrl: './health-component.component.html', + styleUrls: ['./health-component.component.scss'], + standalone: true, + imports: [NgIf, NgFor, NgbCollapseModule, AlertComponent, TitleCasePipe, ObjNgFor], }) export class HealthComponentComponent { diff --git a/src/app/health-page/health-panel/health-panel.component.spec.ts b/src/app/health-page/health-panel/health-panel.component.spec.ts index fb2c608399..ce8fec79ca 100644 --- a/src/app/health-page/health-panel/health-panel.component.spec.ts +++ b/src/app/health-page/health-panel/health-panel.component.spec.ts @@ -1,17 +1,26 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { NgbAccordionModule, NgbNavModule, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + NgbAccordionModule, + NgbNavModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { HealthResponseObj } from '../../shared/mocks/health-endpoint.mocks'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; import { ObjNgFor } from '../../shared/utils/object-ngfor.pipe'; -import { HealthStatusComponent } from './health-status/health-status.component'; import { HealthComponentComponent } from './health-component/health-component.component'; import { HealthPanelComponent } from './health-panel.component'; +import { HealthStatusComponent } from './health-status/health-status.component'; describe('HealthPanelComponent', () => { let component: HealthPanelComponent; @@ -19,28 +28,28 @@ describe('HealthPanelComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbNavModule, NgbAccordionModule, CommonModule, BrowserAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), HealthPanelComponent, ObjNgFor, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(HealthPanelComponent, { - remove: { - imports: [HealthComponentComponent, HealthStatusComponent] - } -}) -.compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(HealthPanelComponent, { + remove: { + imports: [HealthComponentComponent, HealthStatusComponent], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-panel/health-panel.component.ts b/src/app/health-page/health-panel/health-panel.component.ts index dc2f0c91f7..3d72f6b6b7 100644 --- a/src/app/health-page/health-panel/health-panel.component.ts +++ b/src/app/health-page/health-panel/health-panel.component.ts @@ -1,26 +1,33 @@ +import { + NgFor, + NgIf, + TitleCasePipe, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; - -import { HealthResponse } from '../models/health-component.model'; -import { ObjNgFor } from '../../shared/utils/object-ngfor.pipe'; -import { HealthComponentComponent } from './health-component/health-component.component'; -import { NgFor, NgIf, TitleCasePipe } from '@angular/common'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; + +import { ObjNgFor } from '../../shared/utils/object-ngfor.pipe'; +import { HealthResponse } from '../models/health-component.model'; +import { HealthComponentComponent } from './health-component/health-component.component'; import { HealthStatusComponent } from './health-status/health-status.component'; /** * Show the health panel */ @Component({ - selector: 'ds-health-panel', - templateUrl: './health-panel.component.html', - styleUrls: ['./health-panel.component.scss'], - standalone: true, - imports: [HealthStatusComponent, NgbAccordionModule, NgFor, NgIf, HealthComponentComponent, TitleCasePipe, ObjNgFor, TranslateModule] + selector: 'ds-health-panel', + templateUrl: './health-panel.component.html', + styleUrls: ['./health-panel.component.scss'], + standalone: true, + imports: [HealthStatusComponent, NgbAccordionModule, NgFor, NgIf, HealthComponentComponent, TitleCasePipe, ObjNgFor, TranslateModule], }) export class HealthPanelComponent implements OnInit { diff --git a/src/app/health-page/health-panel/health-status/health-status.component.spec.ts b/src/app/health-page/health-panel/health-status/health-status.component.spec.ts index 772c99e933..ff3ec5a4b3 100644 --- a/src/app/health-page/health-panel/health-status/health-status.component.spec.ts +++ b/src/app/health-page/health-panel/health-status/health-status.component.spec.ts @@ -19,18 +19,18 @@ describe('HealthStatusComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbTooltipModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - HealthStatusComponent - ], -}) - .compileComponents(); + HealthStatusComponent, + ], + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/health-page/health-panel/health-status/health-status.component.ts b/src/app/health-page/health-panel/health-status/health-status.component.ts index 7ceecbcbf8..1a1c15bf0b 100644 --- a/src/app/health-page/health-panel/health-status/health-status.component.ts +++ b/src/app/health-page/health-panel/health-status/health-status.component.ts @@ -1,22 +1,25 @@ +import { + NgSwitch, + NgSwitchCase, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { HealthStatus } from '../../models/health-component.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgSwitch, NgSwitchCase } from '@angular/common'; /** * Show a health status object */ @Component({ - selector: 'ds-health-status', - templateUrl: './health-status.component.html', - styleUrls: ['./health-status.component.scss'], - standalone: true, - imports: [NgSwitch, NgSwitchCase, NgbTooltipModule, TranslateModule] + selector: 'ds-health-status', + templateUrl: './health-status.component.html', + styleUrls: ['./health-status.component.scss'], + standalone: true, + imports: [NgSwitch, NgSwitchCase, NgbTooltipModule, TranslateModule], }) export class HealthStatusComponent { /** diff --git a/src/app/home-page/home-news/home-news.component.ts b/src/app/home-page/home-news/home-news.component.ts index f0f77e1497..ffbd082048 100644 --- a/src/app/home-page/home-news/home-news.component.ts +++ b/src/app/home-page/home-news/home-news.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; @Component({ - selector: 'ds-home-news', - styleUrls: ['./home-news.component.scss'], - templateUrl: './home-news.component.html', - standalone: true + selector: 'ds-home-news', + styleUrls: ['./home-news.component.scss'], + templateUrl: './home-news.component.html', + standalone: true, }) /** diff --git a/src/app/home-page/home-news/themed-home-news.component.ts b/src/app/home-page/home-news/themed-home-news.component.ts index 969050099b..c51c1318df 100644 --- a/src/app/home-page/home-news/themed-home-news.component.ts +++ b/src/app/home-page/home-news/themed-home-news.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { HomeNewsComponent } from './home-news.component'; @Component({ - selector: 'ds-themed-home-news', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-home-news', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) /** diff --git a/src/app/home-page/home-page-routes.ts b/src/app/home-page/home-page-routes.ts index 04abc5bae9..34bd369551 100644 --- a/src/app/home-page/home-page-routes.ts +++ b/src/app/home-page/home-page-routes.ts @@ -1,9 +1,10 @@ -import { HomePageResolver } from './home-page.resolver'; -import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; -import { ThemedHomePageComponent } from './themed-home-page.component'; -import { MenuItemType } from '../shared/menu/menu-item-type.model'; import { Route } from '@angular/router'; + import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; +import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; +import { MenuItemType } from '../shared/menu/menu-item-type.model'; +import { HomePageResolver } from './home-page.resolver'; +import { ThemedHomePageComponent } from './themed-home-page.component'; export const ROUTES: Route[] = [ { @@ -11,7 +12,7 @@ export const ROUTES: Route[] = [ component: ThemedHomePageComponent, providers: [ HomePageResolver, - provideSuggestionNotifications() + provideSuggestionNotifications(), ], pathMatch: 'full', data: { @@ -31,7 +32,7 @@ export const ROUTES: Route[] = [ }, }, resolve: { - site: HomePageResolver - } - } + site: HomePageResolver, + }, + }, ]; diff --git a/src/app/home-page/home-page.component.ts b/src/app/home-page/home-page.component.ts index 3276681df3..afc71ae381 100644 --- a/src/app/home-page/home-page.component.ts +++ b/src/app/home-page/home-page.component.ts @@ -1,34 +1,54 @@ -import { AsyncPipe, isPlatformServer, NgClass, NgIf } from '@angular/common'; -import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID, } from '@angular/core'; +import { + AsyncPipe, + isPlatformServer, + NgClass, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Observable, } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from 'src/config/app-config.interface'; +import { TranslateModule } from '@ngx-translate/core'; +import { + EMPTY, + Observable, +} from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; +import { + APP_CONFIG, + AppConfig, +} from 'src/config/app-config.interface'; import { environment } from '../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { RecentItemListComponent } from './recent-item-list/recent-item-list.component'; +import { NotifyInfoService } from '../core/coar-notify/notify-info/notify-info.service'; import { - ThemedTopLevelCommunityListComponent -} from './top-level-community-list/themed-top-level-community-list.component'; + LinkDefinition, + LinkHeadService, +} from '../core/services/link-head.service'; +import { ServerResponseService } from '../core/services/server-response.service'; +import { Site } from '../core/shared/site.model'; +import { SuggestionsPopupComponent } from '../notifications/suggestions-popup/suggestions-popup.component'; +import { ConfigurationSearchPageComponent } from '../search-page/configuration-search-page.component'; +import { isNotEmpty } from '../shared/empty.util'; import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; import { ThemedHomeNewsComponent } from './home-news/themed-home-news.component'; -import { NotifyInfoService } from '../core/coar-notify/notify-info/notify-info.service'; -import { LinkDefinition, LinkHeadService, } from '../core/services/link-head.service'; -import { ServerResponseService } from '../core/services/server-response.service'; -import { Site } from '../core/shared/site.model'; -import { isNotEmpty } from '../shared/empty.util'; -import { ConfigurationSearchPageComponent } from '../search-page/configuration-search-page.component'; -import { SuggestionsPopupComponent } from '../notifications/suggestions-popup/suggestions-popup.component'; -import { EMPTY } from 'rxjs/internal/observable/empty'; +import { RecentItemListComponent } from './recent-item-list/recent-item-list.component'; +import { ThemedTopLevelCommunityListComponent } from './top-level-community-list/themed-top-level-community-list.component'; @Component({ - selector: 'ds-home-page', - styleUrls: ['./home-page.component.scss'], - templateUrl: './home-page.component.html', - standalone: true, - imports: [ThemedHomeNewsComponent, NgIf, ViewTrackerComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, ConfigurationSearchPageComponent, SuggestionsPopupComponent] + selector: 'ds-home-page', + styleUrls: ['./home-page.component.scss'], + templateUrl: './home-page.component.html', + standalone: true, + imports: [ThemedHomeNewsComponent, NgIf, ViewTrackerComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, ConfigurationSearchPageComponent, SuggestionsPopupComponent], }) export class HomePageComponent implements OnInit, OnDestroy { @@ -51,7 +71,7 @@ export class HomePageComponent implements OnInit, OnDestroy { // Get COAR REST API URLs from REST configuration // only if COAR configuration is enabled this.notifyInfoService.isCoarConfigEnabled().pipe( - switchMap((coarLdnEnabled: boolean) => coarLdnEnabled ? this.notifyInfoService.getCoarLdnLocalInboxUrls() : EMPTY /*{ + switchMap((coarLdnEnabled: boolean) => coarLdnEnabled ? this.notifyInfoService.getCoarLdnLocalInboxUrls() : EMPTY, /*{ if (coarLdnEnabled) { return this.notifyInfoService.getCoarLdnLocalInboxUrls(); } else { diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts index 056c82174b..298e66b05c 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.spec.ts @@ -1,19 +1,25 @@ import { PLATFORM_ID } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { of as observableOf } from 'rxjs'; -import { SearchService } from '../../core/shared/search/search.service'; -import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; -import { SearchServiceStub } from '../../shared/testing/search-service.stub'; -import { createPaginatedList } from '../../shared/testing/utils.test'; import { APP_CONFIG } from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginationService } from '../../core/pagination/pagination.service'; +import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; +import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; +import { SearchServiceStub } from '../../shared/testing/search-service.stub'; +import { createPaginatedList } from '../../shared/testing/utils.test'; import { RecentItemListComponent } from './recent-item-list.component'; describe('RecentItemListComponent', () => { @@ -41,16 +47,16 @@ describe('RecentItemListComponent', () => { }; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RecentItemListComponent], - providers: [ + imports: [RecentItemListComponent], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { provide: PaginationService, useValue: paginationService }, { provide: SearchConfigurationService, useValue: searchConfigServiceStub }, { provide: APP_CONFIG, useValue: environment }, { provide: PLATFORM_ID, useValue: 'browser' }, - ] -}) - .compileComponents(); + ], + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/home-page/recent-item-list/recent-item-list.component.ts b/src/app/home-page/recent-item-list/recent-item-list.component.ts index 14be17a422..b1f863e813 100644 --- a/src/app/home-page/recent-item-list/recent-item-list.component.ts +++ b/src/app/home-page/recent-item-list/recent-item-list.component.ts @@ -1,10 +1,30 @@ -import { AsyncPipe, isPlatformBrowser, NgClass, NgFor, NgIf } from '@angular/common'; -import { ChangeDetectionStrategy, Component, ElementRef, Inject, OnInit, PLATFORM_ID, } from '@angular/core'; +import { + AsyncPipe, + isPlatformBrowser, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + ElementRef, + Inject, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { APP_CONFIG, AppConfig, } from '../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { PaginationService } from '../../core/pagination/pagination.service'; @@ -13,31 +33,34 @@ import { Item } from '../../core/shared/item.model'; import { toDSpaceObjectListRD } from '../../core/shared/operators'; import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { ViewMode } from '../../core/shared/view-mode.model'; -import { fadeIn, fadeInOut, } from '../../shared/animations/fade'; +import { + fadeIn, + fadeInOut, +} from '../../shared/animations/fade'; +import { ErrorComponent } from '../../shared/error/error.component'; +import { LoadingComponent } from '../../shared/loading/loading.component'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; -import { setPlaceHolderAttributes } from '../../shared/utils/object-list-utils'; -import { TranslateModule } from '@ngx-translate/core'; -import { LoadingComponent } from '../../shared/loading/loading.component'; -import { ErrorComponent } from '../../shared/error/error.component'; import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; + followLink, + FollowLinkConfig, +} from '../../shared/utils/follow-link-config.model'; +import { setPlaceHolderAttributes } from '../../shared/utils/object-list-utils'; import { VarDirective } from '../../shared/utils/var.directive'; @Component({ - selector: 'ds-recent-item-list', - templateUrl: './recent-item-list.component.html', - styleUrls: ['./recent-item-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [ - fadeIn, - fadeInOut - ], - standalone: true, - imports: [VarDirective, NgIf, NgClass, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, LoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-recent-item-list', + templateUrl: './recent-item-list.component.html', + styleUrls: ['./recent-item-list.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [ + fadeIn, + fadeInOut, + ], + standalone: true, + imports: [VarDirective, NgIf, NgClass, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, LoadingComponent, AsyncPipe, TranslateModule], }) export class RecentItemListComponent implements OnInit { itemRD$: Observable>>; diff --git a/src/app/home-page/themed-home-page.component.ts b/src/app/home-page/themed-home-page.component.ts index 764b494f4a..41a66b53b1 100644 --- a/src/app/home-page/themed-home-page.component.ts +++ b/src/app/home-page/themed-home-page.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../shared/theme-support/themed.component'; import { HomePageComponent } from './home-page.component'; @Component({ - selector: 'ds-themed-home-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-home-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedHomePageComponent extends ThemedComponent { diff --git a/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts b/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts index 24e19d7ebd..7445b3ac1c 100644 --- a/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts +++ b/src/app/home-page/top-level-community-list/themed-top-level-community-list.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { TopLevelCommunityListComponent } from './top-level-community-list.component'; @Component({ - selector: 'ds-themed-top-level-community-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-top-level-community-list', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedTopLevelCommunityListComponent extends ThemedComponent { protected inAndOutputNames: (keyof TopLevelCommunityListComponent & keyof this)[]; diff --git a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts index 9f9b068b8f..3b397846cc 100644 --- a/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts +++ b/src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -139,14 +143,14 @@ describe('TopLevelCommunityListComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, NoopAnimationsModule, - TopLevelCommunityListComponent - ], - providers: [ + TopLevelCommunityListComponent, + ], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: CommunityDataService, useValue: communityDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, @@ -157,9 +161,9 @@ describe('TopLevelCommunityListComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home-page/top-level-community-list/top-level-community-list.component.ts b/src/app/home-page/top-level-community-list/top-level-community-list.component.ts index b4ae846e38..d49f9f264f 100644 --- a/src/app/home-page/top-level-community-list/top-level-community-list.component.ts +++ b/src/app/home-page/top-level-community-list/top-level-community-list.component.ts @@ -1,9 +1,30 @@ -import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, } from '@angular/core'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription, } from 'rxjs'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, + OnDestroy, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Subscription, +} from 'rxjs'; import { switchMap } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from 'src/config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from 'src/config/app-config.interface'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { CommunityDataService } from '../../core/data/community-data.service'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; @@ -11,25 +32,23 @@ import { PaginationService } from '../../core/pagination/pagination.service'; import { Community } from '../../core/shared/community.model'; import { fadeInOut } from '../../shared/animations/fade'; import { hasValue } from '../../shared/empty.util'; -import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { ErrorComponent } from '../../shared/error/error.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { VarDirective } from '../../shared/utils/var.directive'; /** * this component renders the Top-Level Community list */ @Component({ - selector: 'ds-top-level-community-list', - styleUrls: ['./top-level-community-list.component.scss'], - templateUrl: './top-level-community-list.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [fadeInOut], - standalone: true, - imports: [VarDirective, NgIf, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-top-level-community-list', + styleUrls: ['./top-level-community-list.component.scss'], + templateUrl: './top-level-community-list.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [fadeInOut], + standalone: true, + imports: [VarDirective, NgIf, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class TopLevelCommunityListComponent implements OnInit, OnDestroy { diff --git a/src/app/import-external-page/import-external-page-routes.ts b/src/app/import-external-page/import-external-page-routes.ts index 6308f4c57b..b31cff2162 100644 --- a/src/app/import-external-page/import-external-page-routes.ts +++ b/src/app/import-external-page/import-external-page-routes.ts @@ -1,8 +1,7 @@ import { Route } from '@angular/router'; + import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { - ThemedSubmissionImportExternalComponent -} from '../submission/import-external/themed-submission-import-external.component'; +import { ThemedSubmissionImportExternalComponent } from '../submission/import-external/themed-submission-import-external.component'; import { provideSubmission } from '../submission/provide-submission'; export const ROUTES: Route[] = [ @@ -13,8 +12,8 @@ export const ROUTES: Route[] = [ providers: [provideSubmission()], pathMatch: 'full', data: { - title: 'submission.import-external.page.title' - } - } + title: 'submission.import-external.page.title', + }, + }, ]; diff --git a/src/app/import-external-page/import-external-page.component.spec.ts b/src/app/import-external-page/import-external-page.component.spec.ts index 533b4a7a65..60e17d288c 100644 --- a/src/app/import-external-page/import-external-page.component.spec.ts +++ b/src/app/import-external-page/import-external-page.component.spec.ts @@ -1,15 +1,17 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ImportExternalPageComponent } from './import-external-page.component'; -import { ThemeService } from '../shared/theme-support/theme.service'; - -import { getMockThemeService } from '../shared/mocks/theme-service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; import { - ThemedSubmissionImportExternalComponent -} from '../submission/import-external/themed-submission-import-external.component'; + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; + +import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; +import { getMockThemeService } from '../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; +import { ThemeService } from '../shared/theme-support/theme.service'; +import { ThemedSubmissionImportExternalComponent } from '../submission/import-external/themed-submission-import-external.component'; +import { ImportExternalPageComponent } from './import-external-page.component'; describe('ImportExternalPageComponent', () => { let component: ImportExternalPageComponent; @@ -17,19 +19,19 @@ describe('ImportExternalPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ImportExternalPageComponent], - providers: [ + imports: [ImportExternalPageComponent], + providers: [ { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - { provide: SearchConfigurationService, useValue: {}}, - ], + { provide: SearchConfigurationService, useValue: {} }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(ImportExternalPageComponent, { - remove: { - imports: [ThemedSubmissionImportExternalComponent] - } - } + remove: { + imports: [ThemedSubmissionImportExternalComponent], + }, + }, ) .compileComponents(); })); diff --git a/src/app/import-external-page/import-external-page.component.ts b/src/app/import-external-page/import-external-page.component.ts index 4cb8062ceb..8a3029a856 100644 --- a/src/app/import-external-page/import-external-page.component.ts +++ b/src/app/import-external-page/import-external-page.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; -import { - ThemedSubmissionImportExternalComponent -} from '../submission/import-external/themed-submission-import-external.component'; + +import { ThemedSubmissionImportExternalComponent } from '../submission/import-external/themed-submission-import-external.component'; /** * Component representing the external import page of the submission. @@ -11,9 +10,9 @@ import { templateUrl: './import-external-page.component.html', styleUrls: ['./import-external-page.component.scss'], imports: [ - ThemedSubmissionImportExternalComponent + ThemedSubmissionImportExternalComponent, ], - standalone: true + standalone: true, }) export class ImportExternalPageComponent { diff --git a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts index 65f2d3495a..e0bc3da890 100644 --- a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts +++ b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts @@ -1,10 +1,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { RouterLink } from '@angular/router'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { EndUserAgreementContentComponent } from './end-user-agreement-content.component'; @@ -16,12 +16,12 @@ describe('EndUserAgreementContentComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), EndUserAgreementContentComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(EndUserAgreementContentComponent, { remove: { - imports: [RouterLink] - } + imports: [RouterLink], + }, }) .compileComponents(); })); diff --git a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts index a7fb34f285..75928c8440 100644 --- a/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts +++ b/src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts @@ -1,13 +1,13 @@ import { Component } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-end-user-agreement-content', - templateUrl: './end-user-agreement-content.component.html', - styleUrls: ['./end-user-agreement-content.component.scss'], - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-end-user-agreement-content', + templateUrl: './end-user-agreement-content.component.html', + styleUrls: ['./end-user-agreement-content.component.scss'], + standalone: true, + imports: [RouterLink, TranslateModule], }) /** * Component displaying the contents of the End User Agreement diff --git a/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts b/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts index 83fa08e3f6..fbb5ebc49b 100644 --- a/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts +++ b/src/app/info/end-user-agreement/end-user-agreement.component.spec.ts @@ -18,8 +18,8 @@ import { AuthService } from '../../core/auth/auth.service'; import { EndUserAgreementService } from '../../core/end-user-agreement/end-user-agreement.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { EndUserAgreementContentComponent } from './end-user-agreement-content/end-user-agreement-content.component'; import { EndUserAgreementComponent } from './end-user-agreement.component'; +import { EndUserAgreementContentComponent } from './end-user-agreement-content/end-user-agreement-content.component'; describe('EndUserAgreementComponent', () => { let component: EndUserAgreementComponent; @@ -70,8 +70,8 @@ describe('EndUserAgreementComponent', () => { }) .overrideComponent(EndUserAgreementComponent, { remove: { - imports: [EndUserAgreementContentComponent] - } + imports: [EndUserAgreementContentComponent], + }, }) .compileComponents(); })); diff --git a/src/app/info/end-user-agreement/end-user-agreement.component.ts b/src/app/info/end-user-agreement/end-user-agreement.component.ts index 37531ef6dc..419cbfebfe 100644 --- a/src/app/info/end-user-agreement/end-user-agreement.component.ts +++ b/src/app/info/end-user-agreement/end-user-agreement.component.ts @@ -2,13 +2,21 @@ import { Component, OnInit, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { ActivatedRoute, Router, } from '@angular/router'; import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; import { map, switchMap, @@ -19,20 +27,19 @@ import { AppState } from '../../app.reducer'; import { LogOutAction } from '../../core/auth/auth.actions'; import { AuthService } from '../../core/auth/auth.service'; import { EndUserAgreementService } from '../../core/end-user-agreement/end-user-agreement.service'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; import { isNotEmpty } from '../../shared/empty.util'; -import { FormsModule } from '@angular/forms'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; import { EndUserAgreementContentComponent } from './end-user-agreement-content/end-user-agreement-content.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; @Component({ - selector: 'ds-end-user-agreement', - templateUrl: './end-user-agreement.component.html', - styleUrls: ['./end-user-agreement.component.scss'], - standalone: true, - imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule] + selector: 'ds-end-user-agreement', + templateUrl: './end-user-agreement.component.html', + styleUrls: ['./end-user-agreement.component.scss'], + standalone: true, + imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule], }) /** * Component displaying the End User Agreement and an option to accept it diff --git a/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts b/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts index 150ecfddcc..941b08c2eb 100644 --- a/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts +++ b/src/app/info/end-user-agreement/themed-end-user-agreement.component.ts @@ -7,10 +7,10 @@ import { EndUserAgreementComponent } from './end-user-agreement.component'; * Themed wrapper for EndUserAgreementComponent */ @Component({ - selector: 'ds-themed-end-user-agreement', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-end-user-agreement', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedEndUserAgreementComponent extends ThemedComponent { diff --git a/src/app/info/feedback/feedback-form/feedback-form.component.spec.ts b/src/app/info/feedback/feedback-form/feedback-form.component.spec.ts index 70677e0769..4329c923c4 100644 --- a/src/app/info/feedback/feedback-form/feedback-form.component.spec.ts +++ b/src/app/info/feedback/feedback-form/feedback-form.component.spec.ts @@ -45,8 +45,8 @@ describe('FeedbackFormComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), FeedbackFormComponent], - providers: [ + imports: [TranslateModule.forRoot(), FeedbackFormComponent], + providers: [ { provide: RouteService, useValue: routeServiceStub }, { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, { provide: NotificationsService, useValue: notificationService }, @@ -54,9 +54,9 @@ describe('FeedbackFormComponent', () => { { provide: AuthService, useValue: authService }, { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, { provide: Router, useValue: routerStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/info/feedback/feedback-form/feedback-form.component.ts b/src/app/info/feedback/feedback-form/feedback-form.component.ts index d6b5c5a1f5..d658e5472e 100644 --- a/src/app/info/feedback/feedback-form/feedback-form.component.ts +++ b/src/app/info/feedback/feedback-form/feedback-form.component.ts @@ -1,47 +1,65 @@ -import { RemoteData } from '../../../core/data/remote-data'; -import { NoContent } from '../../../core/shared/NoContent.model'; -import { FeedbackDataService } from '../../../core/feedback/feedback-data.service'; -import { Component, Inject, OnInit } from '@angular/core'; -import { RouteService } from '../../../core/services/route.service'; -import { UntypedFormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; import { + Component, Component, Inject, + Inject, + OnInit, OnInit, } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, + UntypedFormBuilder, + Validators, Validators, } from '@angular/forms'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { take } from 'rxjs/operators'; import { getHomePageRoute } from '../../../app-routing-paths'; import { AuthService } from '../../../core/auth/auth.service'; -import { RemoteData } from '../../../core/data/remote-data'; +import { + RemoteData, + RemoteData, +} from '../../../core/data/remote-data'; import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { FeedbackDataService } from '../../../core/feedback/feedback-data.service'; -import { RouteService } from '../../../core/services/route.service'; +import { + FeedbackDataService, + FeedbackDataService, +} from '../../../core/feedback/feedback-data.service'; +import { + RouteService, + RouteService, +} from '../../../core/services/route.service'; import { NativeWindowRef, NativeWindowService, } from '../../../core/services/window.service'; -import { NoContent } from '../../../core/shared/NoContent.model'; +import { + NoContent, + NoContent, +} from '../../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { URLCombiner } from '../../../core/url-combiner/url-combiner'; import { ErrorComponent } from '../../../shared/error/error.component'; -import { NgIf } from '@angular/common'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; @Component({ - selector: 'ds-feedback-form', - templateUrl: './feedback-form.component.html', - styleUrls: ['./feedback-form.component.scss'], - standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgIf, ErrorComponent, TranslateModule] + selector: 'ds-feedback-form', + templateUrl: './feedback-form.component.html', + styleUrls: ['./feedback-form.component.scss'], + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgIf, ErrorComponent, TranslateModule], }) /** * Component displaying the contents of the Feedback Statement diff --git a/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts b/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts index 786f55e45b..c45565928c 100644 --- a/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts +++ b/src/app/info/feedback/feedback-form/themed-feedback-form.component.ts @@ -7,10 +7,10 @@ import { FeedbackFormComponent } from './feedback-form.component'; * Themed wrapper for {@link FeedbackFormComponent} */ @Component({ - selector: 'ds-themed-feedback-form', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-feedback-form', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedFeedbackFormComponent extends ThemedComponent { diff --git a/src/app/info/feedback/feedback.component.spec.ts b/src/app/info/feedback/feedback.component.spec.ts index 43211dca9f..8710263616 100644 --- a/src/app/info/feedback/feedback.component.spec.ts +++ b/src/app/info/feedback/feedback.component.spec.ts @@ -1,17 +1,17 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { ThemedFeedbackFormComponent } from './feedback-form/themed-feedback-form.component'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { ThemeService } from '../../shared/theme-support/theme.service'; import { FeedbackComponent } from './feedback.component'; +import { ThemedFeedbackFormComponent } from './feedback-form/themed-feedback-form.component'; describe('FeedbackComponent', () => { let component: FeedbackComponent; @@ -24,12 +24,12 @@ describe('FeedbackComponent', () => { { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(FeedbackComponent, { remove: { - imports: [ThemedFeedbackFormComponent] - } + imports: [ThemedFeedbackFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/info/feedback/feedback.component.ts b/src/app/info/feedback/feedback.component.ts index a1bbd99212..1087009810 100644 --- a/src/app/info/feedback/feedback.component.ts +++ b/src/app/info/feedback/feedback.component.ts @@ -1,12 +1,13 @@ import { Component } from '@angular/core'; + import { ThemedFeedbackFormComponent } from './feedback-form/themed-feedback-form.component'; @Component({ - selector: 'ds-feedback', - templateUrl: './feedback.component.html', - styleUrls: ['./feedback.component.scss'], - standalone: true, - imports: [ThemedFeedbackFormComponent] + selector: 'ds-feedback', + templateUrl: './feedback.component.html', + styleUrls: ['./feedback.component.scss'], + standalone: true, + imports: [ThemedFeedbackFormComponent], }) /** * Component displaying the Feedback Statement diff --git a/src/app/info/feedback/themed-feedback.component.ts b/src/app/info/feedback/themed-feedback.component.ts index 6fed1fb27b..4f6080081d 100644 --- a/src/app/info/feedback/themed-feedback.component.ts +++ b/src/app/info/feedback/themed-feedback.component.ts @@ -7,10 +7,10 @@ import { FeedbackComponent } from './feedback.component'; * Themed wrapper for FeedbackComponent */ @Component({ - selector: 'ds-themed-feedback', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-feedback', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedFeedbackComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/info/info-routes.ts b/src/app/info/info-routes.ts index 45ec369887..8697529619 100644 --- a/src/app/info/info-routes.ts +++ b/src/app/info/info-routes.ts @@ -1,30 +1,34 @@ -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { END_USER_AGREEMENT_PATH, FEEDBACK_PATH, PRIVACY_PATH } from './info-routing-paths'; -import { ThemedEndUserAgreementComponent } from './end-user-agreement/themed-end-user-agreement.component'; -import { ThemedPrivacyComponent } from './privacy/themed-privacy.component'; -import { ThemedFeedbackComponent } from './feedback/themed-feedback.component'; -import { FeedbackGuard } from '../core/feedback/feedback.guard'; import { environment } from '../../environments/environment'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { FeedbackGuard } from '../core/feedback/feedback.guard'; +import { ThemedEndUserAgreementComponent } from './end-user-agreement/themed-end-user-agreement.component'; +import { ThemedFeedbackComponent } from './feedback/themed-feedback.component'; +import { + END_USER_AGREEMENT_PATH, + FEEDBACK_PATH, + PRIVACY_PATH, +} from './info-routing-paths'; +import { ThemedPrivacyComponent } from './privacy/themed-privacy.component'; export const ROUTES = [ { path: FEEDBACK_PATH, component: ThemedFeedbackComponent, - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'info.feedback.title', breadcrumbKey: 'info.feedback'}, - canActivate: [FeedbackGuard] + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'info.feedback.title', breadcrumbKey: 'info.feedback' }, + canActivate: [FeedbackGuard], }, environment.info.enableEndUserAgreement ? { path: END_USER_AGREEMENT_PATH, component: ThemedEndUserAgreementComponent, - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'info.end-user-agreement.title', breadcrumbKey: 'info.end-user-agreement'} + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'info.end-user-agreement.title', breadcrumbKey: 'info.end-user-agreement' }, } : undefined, environment.info.enablePrivacyStatement ? { path: PRIVACY_PATH, component: ThemedPrivacyComponent, - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'info.privacy.title', breadcrumbKey: 'info.privacy'} - } : undefined + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'info.privacy.title', breadcrumbKey: 'info.privacy' }, + } : undefined, ]; diff --git a/src/app/info/privacy/privacy-content/privacy-content.component.spec.ts b/src/app/info/privacy/privacy-content/privacy-content.component.spec.ts index 4dc63aea35..3b521bdb53 100644 --- a/src/app/info/privacy/privacy-content/privacy-content.component.spec.ts +++ b/src/app/info/privacy/privacy-content/privacy-content.component.spec.ts @@ -1,9 +1,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { PrivacyContentComponent } from './privacy-content.component'; describe('PrivacyContentComponent', () => { @@ -12,10 +16,10 @@ describe('PrivacyContentComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), PrivacyContentComponent], - providers: [{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + imports: [TranslateModule.forRoot(), PrivacyContentComponent], + providers: [{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/info/privacy/privacy-content/privacy-content.component.ts b/src/app/info/privacy/privacy-content/privacy-content.component.ts index 5d5a10580c..4e9e58a44f 100644 --- a/src/app/info/privacy/privacy-content/privacy-content.component.ts +++ b/src/app/info/privacy/privacy-content/privacy-content.component.ts @@ -1,13 +1,13 @@ import { Component } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-privacy-content', - templateUrl: './privacy-content.component.html', - styleUrls: ['./privacy-content.component.scss'], - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-privacy-content', + templateUrl: './privacy-content.component.html', + styleUrls: ['./privacy-content.component.scss'], + standalone: true, + imports: [RouterLink, TranslateModule], }) /** * Component displaying the contents of the Privacy Statement diff --git a/src/app/info/privacy/privacy.component.spec.ts b/src/app/info/privacy/privacy.component.spec.ts index 9b166341eb..9aff6586f4 100644 --- a/src/app/info/privacy/privacy.component.spec.ts +++ b/src/app/info/privacy/privacy.component.spec.ts @@ -1,9 +1,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { PrivacyComponent } from './privacy.component'; describe('PrivacyComponent', () => { @@ -12,12 +16,12 @@ describe('PrivacyComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), PrivacyComponent], - providers: [ - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + imports: [TranslateModule.forRoot(), PrivacyComponent], + providers: [ + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/info/privacy/privacy.component.ts b/src/app/info/privacy/privacy.component.ts index 7640e19b9e..db38fffe03 100644 --- a/src/app/info/privacy/privacy.component.ts +++ b/src/app/info/privacy/privacy.component.ts @@ -1,12 +1,13 @@ import { Component } from '@angular/core'; + import { PrivacyContentComponent } from './privacy-content/privacy-content.component'; @Component({ - selector: 'ds-privacy', - templateUrl: './privacy.component.html', - styleUrls: ['./privacy.component.scss'], - standalone: true, - imports: [PrivacyContentComponent] + selector: 'ds-privacy', + templateUrl: './privacy.component.html', + styleUrls: ['./privacy.component.scss'], + standalone: true, + imports: [PrivacyContentComponent], }) /** * Component displaying the Privacy Statement diff --git a/src/app/info/privacy/themed-privacy.component.ts b/src/app/info/privacy/themed-privacy.component.ts index 539bd657ed..77bf277a43 100644 --- a/src/app/info/privacy/themed-privacy.component.ts +++ b/src/app/info/privacy/themed-privacy.component.ts @@ -7,10 +7,10 @@ import { PrivacyComponent } from './privacy.component'; * Themed wrapper for PrivacyComponent */ @Component({ - selector: 'ds-themed-privacy', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-privacy', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedPrivacyComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/init.service.ts b/src/app/init.service.ts index 6bbe706f66..5e3a811bf0 100644 --- a/src/app/init.service.ts +++ b/src/app/init.service.ts @@ -5,13 +5,28 @@ * * http://www.dspace.org/license/ */ -import { APP_INITIALIZER, Inject, Provider, Type, } from '@angular/core'; -import { makeStateKey, TransferState, } from '@angular/platform-browser'; -import { select, Store, } from '@ngrx/store'; +import { + APP_INITIALIZER, + Inject, + Provider, + Type, +} from '@angular/core'; +import { + makeStateKey, + TransferState, +} from '@angular/platform-browser'; +import { + select, + Store, +} from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import isEqual from 'lodash/isEqual'; import { Observable } from 'rxjs'; -import { distinctUntilChanged, find, } from 'rxjs/operators'; +import { + distinctUntilChanged, + find, +} from 'rxjs/operators'; + import { APP_CONFIG, APP_DATA_SERVICES_MAP, @@ -23,12 +38,12 @@ import { AppState } from './app.reducer'; import { BreadcrumbsService } from './breadcrumbs/breadcrumbs.service'; import { CheckAuthenticationTokenAction } from './core/auth/auth.actions'; import { isAuthenticationBlocking } from './core/auth/selectors'; +import { LAZY_DATA_SERVICES } from './core/data-services-map'; import { LocaleService } from './core/locale/locale.service'; import { MetadataService } from './core/metadata/metadata.service'; import { CorrelationIdService } from './correlation-id/correlation-id.service'; -import { MenuService } from './shared/menu/menu.service'; -import { LAZY_DATA_SERVICES } from './core/data-services-map'; import { dsDynamicFormControlMapFn } from './shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; +import { MenuService } from './shared/menu/menu.service'; import { ThemeService } from './shared/theme-support/theme.service'; import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider'; diff --git a/src/app/item-page/alerts/item-alerts.component.spec.ts b/src/app/item-page/alerts/item-alerts.component.spec.ts index 34d0c12837..6804da333c 100644 --- a/src/app/item-page/alerts/item-alerts.component.spec.ts +++ b/src/app/item-page/alerts/item-alerts.component.spec.ts @@ -5,9 +5,8 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -24,6 +23,7 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { createPaginatedList } from '../../shared/testing/utils.test'; import { ItemAlertsComponent } from './item-alerts.component'; @@ -46,17 +46,17 @@ describe('ItemAlertsComponent', () => { dsoWithdrawnReinstateModalService = jasmine.createSpyObj('dsoWithdrawnReinstateModalService', ['openCreateWithdrawnReinstateModal']); correctionTypeDataService = jasmine.createSpyObj('correctionTypeDataService', ['findByItem']); TestBed.configureTestingModule({ - providers: [ - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - imports: [TranslateModule.forRoot(), ItemAlertsComponent, NoopAnimationsModule], + providers: [ + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + imports: [TranslateModule.forRoot(), ItemAlertsComponent, NoopAnimationsModule], providers: [ { provide: AuthorizationDataService, useValue: authorizationService }, { provide: DsoWithdrawnReinstateModalService, useValue: dsoWithdrawnReinstateModalService }, { provide: CorrectionTypeDataService, useValue: correctionTypeDataService }, ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/item-page/alerts/item-alerts.component.ts b/src/app/item-page/alerts/item-alerts.component.ts index e4d70889e3..6a8838a55a 100644 --- a/src/app/item-page/alerts/item-alerts.component.ts +++ b/src/app/item-page/alerts/item-alerts.component.ts @@ -1,14 +1,15 @@ -import { Component, Input } from '@angular/core'; -import { Item } from '../../core/shared/item.model'; -import { AlertType } from '../../shared/alert/alert-type'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + Input, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest, map, @@ -22,9 +23,16 @@ import { import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { Item } from '../../core/shared/item.model'; +import { + Item, + Item, +} from '../../core/shared/item.model'; import { CorrectionTypeDataService } from '../../core/submission/correctiontype-data.service'; -import { AlertType } from '../../shared/alert/alert-type'; +import { AlertComponent } from '../../shared/alert/alert.component'; +import { + AlertType, + AlertType, +} from '../../shared/alert/alert-type'; import { DsoWithdrawnReinstateModalService, REQUEST_REINSTATE, @@ -39,9 +47,9 @@ import { NgIf, TranslateModule, RouterLink, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component displaying alerts for an item diff --git a/src/app/item-page/alerts/themed-item-alerts.component.ts b/src/app/item-page/alerts/themed-item-alerts.component.ts index a16bb826a0..9a686d9a36 100644 --- a/src/app/item-page/alerts/themed-item-alerts.component.ts +++ b/src/app/item-page/alerts/themed-item-alerts.component.ts @@ -11,10 +11,10 @@ import { ItemAlertsComponent } from './item-alerts.component'; * Themed wrapper for {@link ItemAlertsComponent} */ @Component({ - selector: 'ds-themed-item-alerts', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-alerts', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedItemAlertsComponent extends ThemedComponent { protected inAndOutputNames: (keyof ItemAlertsComponent & keyof this)[] = ['item']; diff --git a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts index 7dc1551c9f..5a5a8e6fca 100644 --- a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts +++ b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts @@ -113,8 +113,8 @@ describe('BitstreamRequestACopyPageComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), FormsModule, ReactiveFormsModule, BitstreamRequestACopyPageComponent], - providers: [ + imports: [CommonModule, TranslateModule.forRoot(), FormsModule, ReactiveFormsModule, BitstreamRequestACopyPageComponent], + providers: [ { provide: Location, useValue: location }, { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, @@ -125,7 +125,7 @@ describe('BitstreamRequestACopyPageComponent', () => { { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: BitstreamDataService, useValue: bitstreamDataService }, ], -}) + }) .compileComponents(); } diff --git a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts index 0960241091..17777957eb 100644 --- a/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts +++ b/src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts @@ -1,77 +1,105 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { filter, map, switchMap, take } from 'rxjs/operators'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; -import { Bitstream } from '../../../core/shared/bitstream.model'; -import { Location } from '@angular/common'; +import { + AsyncPipe, + Location, + Location, + NgIf, +} from '@angular/common'; import { + Component, Component, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { + ReactiveFormsModule, + UntypedFormBuilder, UntypedFormBuilder, UntypedFormControl, + UntypedFormControl, UntypedFormGroup, + UntypedFormGroup, + Validators, Validators, } from '@angular/forms'; import { + ActivatedRoute, ActivatedRoute, Router, + Router, + RouterLink, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, + combineLatest as observableCombineLatest, + Observable, Observable, of as observableOf, + of as observableOf, + Subscription, Subscription, } from 'rxjs'; import { filter, + filter, + map, map, switchMap, + switchMap, + take, take, } from 'rxjs/operators'; import { getBitstreamDownloadRoute, + getBitstreamDownloadRoute, + getForbiddenRoute, getForbiddenRoute, } from '../../../app-routing-paths'; -import { AuthService } from '../../../core/auth/auth.service'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; +import { + AuthService, + AuthService, +} from '../../../core/auth/auth.service'; +import { + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; +import { + BitstreamDataService, + BitstreamDataService, +} from '../../../core/data/bitstream-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; -import { AuthService } from '../../../core/auth/auth.service'; -import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; -import { getBitstreamDownloadRoute, getForbiddenRoute } from '../../../app-routing-paths'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { - ReactiveFormsModule, - UntypedFormBuilder, - UntypedFormControl, - UntypedFormGroup, - Validators -} from '@angular/forms'; import { ItemRequestDataService } from '../../../core/data/item-request-data.service'; -import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { Bitstream } from '../../../core/shared/bitstream.model'; +import { + EPerson, + EPerson, +} from '../../../core/eperson/models/eperson.model'; +import { + Bitstream, + Bitstream, +} from '../../../core/shared/bitstream.model'; import { Item } from '../../../core/shared/item.model'; import { ItemRequest } from '../../../core/shared/item-request.model'; import { getFirstCompletedRemoteData, + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { AsyncPipe, Location, NgIf } from '@angular/common'; -import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ @@ -82,9 +110,9 @@ import { getItemPageRoute } from '../../item-page-routing-paths'; RouterLink, AsyncPipe, ReactiveFormsModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Page component for requesting a copy for a bitstream diff --git a/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts index 918f8b9892..6a57c6d4b5 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts @@ -1,7 +1,14 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; @@ -17,10 +24,7 @@ import { Bitstream } from '../../../core/shared/bitstream.model'; import { Bundle } from '../../../core/shared/bundle.model'; import { Item } from '../../../core/shared/item.model'; import { PageInfo } from '../../../core/shared/page-info.model'; -import { UploaderComponent } from '../../../shared/upload/uploader/uploader.component'; -import { - DsoInputSuggestionsComponent -} from '../../../shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component'; +import { DsoInputSuggestionsComponent } from '../../../shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject, @@ -30,6 +34,7 @@ import { AuthServiceStub } from '../../../shared/testing/auth-service.stub'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../../shared/testing/router.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { UploaderComponent } from '../../../shared/upload/uploader/uploader.component'; import { VarDirective } from '../../../shared/utils/var.directive'; import { UploadBitstreamComponent } from './upload-bitstream.component'; @@ -310,8 +315,8 @@ describe('UploadBitstreamComponent', () => { }) .overrideComponent(UploadBitstreamComponent, { remove: { - imports: [UploaderComponent, DsoInputSuggestionsComponent] - } + imports: [UploaderComponent, DsoInputSuggestionsComponent], + }, }) .compileComponents(); } diff --git a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts index 4f2ba5de7b..49b1ffa5fb 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts @@ -1,13 +1,36 @@ -import { Component, OnDestroy, OnInit, ViewChild, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; -import { map, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { environment } from '../../../../environments/environment'; import { getBitstreamModuleRoute } from '../../../app-routing-paths'; import { AuthService } from '../../../core/auth/auth.service'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { BundleDataService } from '../../../core/data/bundle-data.service'; import { ItemDataService } from '../../../core/data/item-data.service'; @@ -16,17 +39,21 @@ import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; import { Bundle } from '../../../core/shared/bundle.model'; import { Item } from '../../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; -import { hasValue, isEmpty, isNotEmpty, } from '../../../shared/empty.util'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; +import { + hasValue, + isEmpty, + isNotEmpty, +} from '../../../shared/empty.util'; +import { DsoInputSuggestionsComponent } from '../../../shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { UploaderComponent } from '../../../shared/upload/uploader/uploader.component'; import { UploaderOptions } from '../../../shared/upload/uploader/uploader-options.model'; -import { getEntityEditRoute } from '../../item-page-routing-paths'; -import { AsyncPipe, NgIf } from '@angular/common'; import { VarDirective } from '../../../shared/utils/var.directive'; -import { - DsoInputSuggestionsComponent -} from '../../../shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component'; -import { FormsModule } from '@angular/forms'; +import { getEntityEditRoute } from '../../item-page-routing-paths'; @Component({ selector: 'ds-upload-bitstream', @@ -38,9 +65,9 @@ import { FormsModule } from '@angular/forms'; NgIf, DsoInputSuggestionsComponent, FormsModule, - UploaderComponent + UploaderComponent, ], - standalone: true + standalone: true, }) /** * Page component for uploading a bitstream to an item diff --git a/src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts b/src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts index c93d40a9a8..77c3fdaafb 100644 --- a/src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts +++ b/src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts @@ -37,9 +37,9 @@ import { ITEM_PAGE_LINKS_TO_FOLLOW } from '../../item.resolver'; import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ - selector: 'ds-abstract-item-update', - template: '', - standalone: true + selector: 'ds-abstract-item-update', + template: '', + standalone: true, }) /** * Abstract component for managing object updates of an item diff --git a/src/app/item-page/edit-item-page/edit-item-page-routes.ts b/src/app/item-page/edit-item-page/edit-item-page-routes.ts index ae94b2ed51..fc44f1e43b 100644 --- a/src/app/item-page/edit-item-page/edit-item-page-routes.ts +++ b/src/app/item-page/edit-item-page/edit-item-page-routes.ts @@ -1,23 +1,14 @@ import { Route } from '@angular/router'; -import { EditItemPageComponent } from './edit-item-page.component'; -import { ItemWithdrawComponent } from './item-withdraw/item-withdraw.component'; -import { ItemReinstateComponent } from './item-reinstate/item-reinstate.component'; -import { ItemPrivateComponent } from './item-private/item-private.component'; -import { ItemPublicComponent } from './item-public/item-public.component'; -import { ItemDeleteComponent } from './item-delete/item-delete.component'; -import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component'; -import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component'; -import { ItemMoveComponent } from './item-move/item-move.component'; -import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component'; -import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component'; + import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component'; -import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component'; -import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; -import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; +import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; +import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component'; import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; -import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; +import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; +import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; +import { ItemPageAdministratorGuard } from '../item-page-administrator.guard'; +import { EditItemPageComponent } from './edit-item-page.component'; import { ITEM_EDIT_AUTHORIZATIONS_PATH, ITEM_EDIT_DELETE_PATH, @@ -26,24 +17,34 @@ import { ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_REGISTER_DOI_PATH, ITEM_EDIT_REINSTATE_PATH, - ITEM_EDIT_WITHDRAW_PATH + ITEM_EDIT_WITHDRAW_PATH, } from './edit-item-page.routing-paths'; -import { ItemPageReinstateGuard } from './item-page-reinstate.guard'; -import { ItemPageWithdrawGuard } from './item-page-withdraw.guard'; -import { ItemPageMetadataGuard } from './item-page-metadata.guard'; -import { ItemPageAdministratorGuard } from '../item-page-administrator.guard'; -import { ItemPageStatusGuard } from './item-page-status.guard'; +import { ItemAccessControlComponent } from './item-access-control/item-access-control.component'; +import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component'; +import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component'; +import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component'; +import { ItemCurateComponent } from './item-curate/item-curate.component'; +import { ItemDeleteComponent } from './item-delete/item-delete.component'; +import { ItemMoveComponent } from './item-move/item-move.component'; +import { ItemPageAccessControlGuard } from './item-page-access-control.guard'; import { ItemPageBitstreamsGuard } from './item-page-bitstreams.guard'; -import { ItemPageRelationshipsGuard } from './item-page-relationships.guard'; -import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard'; import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.guard'; import { ItemPageCurateGuard } from './item-page-curate.guard'; -import { ItemPageAccessControlGuard } from './item-page-access-control.guard'; -import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component'; +import { ItemPageMetadataGuard } from './item-page-metadata.guard'; import { ItemPageRegisterDoiGuard } from './item-page-register-doi.guard'; -import { ItemCurateComponent } from './item-curate/item-curate.component'; +import { ItemPageReinstateGuard } from './item-page-reinstate.guard'; +import { ItemPageRelationshipsGuard } from './item-page-relationships.guard'; +import { ItemPageStatusGuard } from './item-page-status.guard'; +import { ItemPageVersionHistoryGuard } from './item-page-version-history.guard'; +import { ItemPageWithdrawGuard } from './item-page-withdraw.guard'; +import { ItemPrivateComponent } from './item-private/item-private.component'; +import { ItemPublicComponent } from './item-public/item-public.component'; +import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component'; +import { ItemReinstateComponent } from './item-reinstate/item-reinstate.component'; +import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component'; import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; -import { ItemAccessControlComponent } from './item-access-control/item-access-control.component'; +import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component'; +import { ItemWithdrawComponent } from './item-withdraw/item-withdraw.component'; /** * Routing module that handles the routing for the Edit Item page administrator functionality @@ -53,7 +54,7 @@ export const ROUTES: Route[] = [ { path: '', resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, providers: [ I18nBreadcrumbResolver, @@ -82,37 +83,37 @@ export const ROUTES: Route[] = [ { path: '', redirectTo: 'status', - pathMatch: 'full' + pathMatch: 'full', }, { path: 'status', component: ThemedItemStatusComponent, data: { title: 'item.edit.tabs.status.title', showBreadcrumbs: true }, - canActivate: [ItemPageStatusGuard] + canActivate: [ItemPageStatusGuard], }, { path: 'bitstreams', component: ItemBitstreamsComponent, data: { title: 'item.edit.tabs.bitstreams.title', showBreadcrumbs: true }, - canActivate: [ItemPageBitstreamsGuard] + canActivate: [ItemPageBitstreamsGuard], }, { path: 'metadata', component: ThemedDsoEditMetadataComponent, data: { title: 'item.edit.tabs.metadata.title', showBreadcrumbs: true }, - canActivate: [ItemPageMetadataGuard] + canActivate: [ItemPageMetadataGuard], }, { path: 'curate', component: ItemCurateComponent, data: { title: 'item.edit.tabs.curate.title', showBreadcrumbs: true }, - canActivate: [ItemPageCurateGuard] + canActivate: [ItemPageCurateGuard], }, { path: 'relationships', component: ItemRelationshipsComponent, data: { title: 'item.edit.tabs.relationships.title', showBreadcrumbs: true }, - canActivate: [ItemPageRelationshipsGuard] + canActivate: [ItemPageRelationshipsGuard], }, /* TODO - uncomment & fix when view page exists { @@ -130,21 +131,21 @@ export const ROUTES: Route[] = [ path: 'versionhistory', component: ItemVersionHistoryComponent, data: { title: 'item.edit.tabs.versionhistory.title', showBreadcrumbs: true }, - canActivate: [ItemPageVersionHistoryGuard] + canActivate: [ItemPageVersionHistoryGuard], }, { path: 'access-control', component: ItemAccessControlComponent, data: { title: 'item.edit.tabs.access-control.title', showBreadcrumbs: true }, - canActivate: [ItemPageAccessControlGuard] + canActivate: [ItemPageAccessControlGuard], }, { path: 'mapper', component: ItemCollectionMapperComponent, data: { title: 'item.edit.tabs.item-mapper.title', showBreadcrumbs: true }, - canActivate: [ItemPageCollectionMapperGuard] - } - ] + canActivate: [ItemPageCollectionMapperGuard], + }, + ], }, { path: 'mapper', @@ -153,12 +154,12 @@ export const ROUTES: Route[] = [ { path: ITEM_EDIT_WITHDRAW_PATH, component: ItemWithdrawComponent, - canActivate: [ItemPageWithdrawGuard] + canActivate: [ItemPageWithdrawGuard], }, { path: ITEM_EDIT_REINSTATE_PATH, component: ItemReinstateComponent, - canActivate: [ItemPageReinstateGuard] + canActivate: [ItemPageReinstateGuard], }, { path: ITEM_EDIT_PRIVATE_PATH, @@ -189,26 +190,26 @@ export const ROUTES: Route[] = [ { path: 'create', resolve: { - resourcePolicyTarget: ResourcePolicyTargetResolver + resourcePolicyTarget: ResourcePolicyTargetResolver, }, component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' } + data: { title: 'resource-policies.create.page.title' }, }, { path: 'edit', resolve: { - resourcePolicy: ResourcePolicyResolver + resourcePolicy: ResourcePolicyResolver, }, component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' } + data: { title: 'resource-policies.edit.page.title' }, }, { path: '', component: ItemAuthorizationsComponent, - data: { title: 'item.edit.authorizations.title' } - } - ] - } - ] - } + data: { title: 'item.edit.authorizations.title' }, + }, + ], + }, + ], + }, ]; diff --git a/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts index 64dbd91833..d0017e6ac6 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts @@ -3,6 +3,10 @@ import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, fakeAsync, @@ -12,10 +16,15 @@ import { import { By } from '@angular/platform-browser'; import { ActivatedRoute, + ActivatedRoute, + ActivatedRouteSnapshot, ActivatedRouteSnapshot, CanActivate, - Router, + CanActivate, + RouterModule, RouterStateSnapshot, + RouterStateSnapshot, + UrlTree, UrlTree, } from '@angular/router'; import { @@ -29,15 +38,6 @@ import { import { Item } from '../../core/shared/item.model'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; -import { - ActivatedRoute, - ActivatedRouteSnapshot, - CanActivate, - RouterModule, - RouterStateSnapshot, - UrlTree -} from '@angular/router'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { EditItemPageComponent } from './edit-item-page.component'; @@ -96,23 +96,23 @@ describe('ItemPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - RouterModule.forRoot([]), - TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + imports: [ + RouterModule.forRoot([]), + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - EditItemPageComponent - ], - providers: [ + EditItemPageComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: mockRoute }, AcceptAllGuard, AcceptNoneGuard, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(EditItemPageComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(EditItemPageComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/edit-item-page/edit-item-page.component.ts b/src/app/item-page/edit-item-page/edit-item-page.component.ts index 7ca3c7a57b..552823aa3a 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.component.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.component.ts @@ -1,18 +1,33 @@ -import { fadeIn, fadeInOut } from '../../shared/animations/fade'; -import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; -import { ActivatedRoute, CanActivate, Route, Router, RouterLink, RouterOutlet } from '@angular/router'; +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, + ChangeDetectionStrategy, + Component, Component, Injector, + Injector, + OnInit, OnInit, } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + CanActivate, CanActivate, Route, + Route, Router, + Router, + RouterLink, + RouterOutlet, } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, @@ -21,18 +36,19 @@ import { import { map } from 'rxjs/operators'; import { RemoteData } from '../../core/data/remote-data'; -import { GenericConstructor } from '../../core/shared/generic-constructor'; +import { + GenericConstructor, + GenericConstructor, +} from '../../core/shared/generic-constructor'; import { Item } from '../../core/shared/item.model'; import { fadeIn, + fadeIn, + fadeInOut, fadeInOut, } from '../../shared/animations/fade'; import { isNotEmpty } from '../../shared/empty.util'; import { getItemPageRoute } from '../item-page-routing-paths'; -import { GenericConstructor } from '../../core/shared/generic-constructor'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'ds-edit-item-page', @@ -40,7 +56,7 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut + fadeInOut, ], imports: [ TranslateModule, @@ -50,9 +66,9 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; AsyncPipe, NgbTooltipModule, RouterLink, - RouterOutlet + RouterOutlet, ], - standalone: true + standalone: true, }) /** * Page component for editing an item diff --git a/src/app/item-page/edit-item-page/edit-item-page.module.ts b/src/app/item-page/edit-item-page/edit-item-page.module.ts index 99b214cc0e..9f0bdaa763 100644 --- a/src/app/item-page/edit-item-page/edit-item-page.module.ts +++ b/src/app/item-page/edit-item-page/edit-item-page.module.ts @@ -3,36 +3,29 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { NgbModule, + NgbModule, + NgbTooltipModule, NgbTooltipModule, } from '@ng-bootstrap/ng-bootstrap'; -import { NgbModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; - import { BundleDataService } from '../../core/data/bundle-data.service'; import { IdentifierDataService } from '../../core/data/identifier-data.service'; -import { DsoSharedModule } from '../../dso-shared/dso-shared.module'; import { SearchPageModule } from '../../search-page/search-page.module'; -import { AccessControlFormModule } from '../../shared/access-control-form-container/access-control-form.module'; import { IdentifierDataComponent } from '../../shared/object-list/identifier-data/identifier-data.component'; import { ResourcePoliciesModule } from '../../shared/resource-policies/resource-policies.module'; -import { ResultsBackButtonModule } from '../../shared/results-back-button/results-back-button.module'; -import { SharedModule } from '../../shared/shared.module'; import { ObjectValuesPipe } from '../../shared/utils/object-values-pipe'; import { ItemVersionsModule } from '../versions/item-versions.module'; import { AbstractItemUpdateComponent } from './abstract-item-update/abstract-item-update.component'; import { EditItemPageComponent } from './edit-item-page.component'; -import { EditItemPageRoutingModule } from './edit-item-page.routing.module'; -import { ItemAccessControlComponent } from './item-access-control/item-access-control.component'; +import { + ItemAccessControlComponent, + ItemAccessControlComponent, +} from './item-access-control/item-access-control.component'; import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component'; import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component'; import { ItemEditBitstreamComponent } from './item-bitstreams/item-edit-bitstream/item-edit-bitstream.component'; - -import { - ItemEditBitstreamBundleComponent -} from './item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component'; -import { - PaginatedDragAndDropBitstreamListComponent -} from './item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component'; +import { ItemEditBitstreamBundleComponent } from './item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component'; +import { PaginatedDragAndDropBitstreamListComponent } from './item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component'; import { ItemEditBitstreamDragHandleComponent } from './item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component'; import { ItemCurateComponent } from './item-curate/item-curate.component'; @@ -48,8 +41,6 @@ import { EditRelationshipListComponent } from './item-relationships/edit-relatio import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component'; import { ItemStatusComponent } from './item-status/item-status.component'; import { ThemedItemStatusComponent } from './item-status/themed-item-status.component'; - -import { ItemAccessControlComponent } from './item-access-control/item-access-control.component'; import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component'; import { ItemWithdrawComponent } from './item-withdraw/item-withdraw.component'; import { AbstractSimpleItemActionComponent } from './simple-item-action/abstract-simple-item-action.component'; @@ -59,7 +50,7 @@ import { VirtualMetadataComponent } from './virtual-metadata/virtual-metadata.co * Module that contains all components related to the Edit Item page administrator functionality */ @NgModule({ - imports: [ + imports: [ CommonModule, NgbTooltipModule, SearchPageModule, @@ -94,15 +85,15 @@ import { VirtualMetadataComponent } from './virtual-metadata/virtual-metadata.co IdentifierDataComponent, ItemRegisterDoiComponent, ItemCurateComponent, - ItemAccessControlComponent -], - providers: [ - BundleDataService, - IdentifierDataService, + ItemAccessControlComponent, + ], + providers: [ + BundleDataService, + IdentifierDataService, ObjectValuesPipe, - ], - exports: [ - ItemOperationComponent, + ], + exports: [ + ItemOperationComponent, ], }) export class EditItemPageModule { diff --git a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts index f7682212d5..fb7fff0e12 100644 --- a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts @@ -2,13 +2,11 @@ import { ComponentFixture, TestBed, } from '@angular/core/testing'; - -import { ItemAccessControlComponent } from './item-access-control.component'; -import { of } from 'rxjs'; import { ActivatedRoute } from '@angular/router'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; +import { of } from 'rxjs'; + +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; +import { ItemAccessControlComponent } from './item-access-control.component'; describe('ItemAccessControlComponent', () => { let component: ItemAccessControlComponent; @@ -21,26 +19,26 @@ describe('ItemAccessControlComponent', () => { return { pipe: () => { return of({}); - } + }, }; - } - } - } - } + }, + }, + }, + }, }; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ItemAccessControlComponent], - providers: [{ - provide: ActivatedRoute, useValue: routeStub - }] -}) - .overrideComponent(ItemAccessControlComponent, { - remove: { - imports: [AccessControlFormContainerComponent] - } + imports: [ItemAccessControlComponent], + providers: [{ + provide: ActivatedRoute, useValue: routeStub, + }], }) + .overrideComponent(ItemAccessControlComponent, { + remove: { + imports: [AccessControlFormContainerComponent], + }, + }) .compileComponents(); }); diff --git a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.ts b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.ts index f309f34a06..1a2fc7292b 100644 --- a/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.ts +++ b/src/app/item-page/edit-item-page/item-access-control/item-access-control.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -9,10 +13,7 @@ import { map } from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { - AccessControlFormContainerComponent -} from '../../../shared/access-control-form-container/access-control-form-container.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component'; @Component({ selector: 'ds-item-access-control', @@ -21,9 +22,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; imports: [ AccessControlFormContainerComponent, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class ItemAccessControlComponent implements OnInit { diff --git a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts index 454fbc3c97..3181b0e766 100644 --- a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts @@ -1,5 +1,13 @@ -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,11 +18,17 @@ import { LinkService } from '../../../core/cache/builders/link.service'; import { Bitstream } from '../../../core/shared/bitstream.model'; import { Bundle } from '../../../core/shared/bundle.model'; import { Item } from '../../../core/shared/item.model'; -import { getMockLinkService } from '../../../shared/mocks/link-service.mock'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { createPaginatedList, createTestComponent } from '../../../shared/testing/utils.test'; -import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; import { AlertComponent } from '../../../shared/alert/alert.component'; +import { getMockLinkService } from '../../../shared/mocks/link-service.mock'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, +} from '../../../shared/remote-data.utils'; +import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; +import { + createPaginatedList, + createTestComponent, +} from '../../../shared/testing/utils.test'; import { ItemAuthorizationsComponent } from './item-authorizations.component'; describe('ItemAuthorizationsComponent test suite', () => { @@ -76,26 +90,26 @@ describe('ItemAuthorizationsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), ItemAuthorizationsComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, ItemAuthorizationsComponent, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, - ], -}) + ], + }) .overrideComponent(ItemAuthorizationsComponent, { remove: { imports: [ - ResourcePoliciesComponent, - AlertComponent - ]} + ResourcePoliciesComponent, + AlertComponent, + ] }, }) .compileComponents(); })); @@ -175,9 +189,9 @@ describe('ItemAuthorizationsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts index 6e3d4bb495..da13102bc9 100644 --- a/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts +++ b/src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts @@ -1,9 +1,16 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, OnDestroy, OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import isEqual from 'lodash/isEqual'; import { BehaviorSubject, @@ -21,33 +28,37 @@ import { } from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { LinkService } from '../../../core/cache/builders/link.service'; +import { + LinkService, + LinkService, +} from '../../../core/cache/builders/link.service'; import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model'; -import { Bitstream } from '../../../core/shared/bitstream.model'; -import { Bundle } from '../../../core/shared/bundle.model'; +import { + Bitstream, + Bitstream, +} from '../../../core/shared/bitstream.model'; +import { + Bundle, + Bundle, +} from '../../../core/shared/bundle.model'; import { Item } from '../../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataWithNotEmptyPayload, } from '../../../core/shared/operators'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../shared/empty.util'; -import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { LinkService } from '../../../core/cache/builders/link.service'; -import { Bundle } from '../../../core/shared/bundle.model'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; -import { Bitstream } from '../../../core/shared/bitstream.model'; -import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { AlertComponent } from '../../../shared/alert/alert.component'; import { NgForTrackByIdDirective } from '../../../shared/ng-for-track-by-id.directive'; +import { ResourcePoliciesComponent } from '../../../shared/resource-policies/resource-policies.component'; +import { followLink } from '../../../shared/utils/follow-link-config.model'; /** * Interface for a bundle's bitstream map entry @@ -69,9 +80,9 @@ interface BundleBitstreamsMapEntry { NgForTrackByIdDirective, AsyncPipe, NgIf, - AlertComponent + AlertComponent, ], - standalone: true + standalone: true, }) /** * Component that handles the item Authorizations diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts index 7d2bfecc66..6fcb2fab84 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts @@ -26,6 +26,7 @@ import { Bitstream } from '../../../core/shared/bitstream.model'; import { Bundle } from '../../../core/shared/bundle.model'; import { Item } from '../../../core/shared/item.model'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { getMockRequestService } from '../../../shared/mocks/request.service.mock'; import { INotification, @@ -44,10 +45,7 @@ import { ObjectValuesPipe } from '../../../shared/utils/object-values-pipe'; import { VarDirective } from '../../../shared/utils/var.directive'; import { ItemBitstreamsComponent } from './item-bitstreams.component'; import { ItemEditBitstreamBundleComponent } from './item-edit-bitstream-bundle/item-edit-bitstream-bundle.component'; -import { - ItemEditBitstreamDragHandleComponent -} from './item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { ItemEditBitstreamDragHandleComponent } from './item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; let comp: ItemBitstreamsComponent; let fixture: ComponentFixture; @@ -171,8 +169,8 @@ describe('ItemBitstreamsComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ItemBitstreamsComponent, ObjectValuesPipe, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), ItemBitstreamsComponent, ObjectValuesPipe, VarDirective], + providers: [ { provide: ItemDataService, useValue: itemService }, { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: Router, useValue: router }, @@ -184,16 +182,16 @@ describe('ItemBitstreamsComponent', () => { { provide: SearchConfigurationService, useValue: searchConfig }, { provide: BundleDataService, useValue: bundleService }, ChangeDetectorRef, - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA, - ], -}) + ], + }) .overrideComponent(ItemBitstreamsComponent, { remove: { imports: [ItemEditBitstreamBundleComponent, ItemEditBitstreamDragHandleComponent, - ThemedLoadingComponent] - } + ThemedLoadingComponent], + }, }) .compileComponents(); })); diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts index d2f1d59f7d..d96699d3c2 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts @@ -1,39 +1,68 @@ -import { ChangeDetectorRef, Component, NgZone, OnDestroy } from '@angular/core'; -import { AbstractItemUpdateComponent } from '../abstract-item-update/abstract-item-update.component'; -import { filter, map, switchMap, take } from 'rxjs/operators'; -import { Observable, Subscription, zip as observableZip } from 'rxjs'; -import { ItemDataService } from '../../../core/data/item-data.service'; -import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; -import { hasValue, isNotEmpty } from '../../../shared/empty.util'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + NgZone, + OnDestroy, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; +import { + Observable, + Subscription, + zip as observableZip, +} from 'rxjs'; +import { + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; +import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { BundleDataService } from '../../../core/data/bundle-data.service'; +import { ItemDataService } from '../../../core/data/item-data.service'; import { FieldChangeType } from '../../../core/data/object-updates/field-change-type.model'; import { FieldUpdate } from '../../../core/data/object-updates/field-update.model'; import { FieldUpdates } from '../../../core/data/object-updates/field-updates.model'; +import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; import { Bitstream } from '../../../core/shared/bitstream.model'; import { Bundle } from '../../../core/shared/bundle.model'; import { NoContent } from '../../../core/shared/NoContent.model'; -import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../../../core/shared/operators'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ResponsiveColumnSizes } from '../../../shared/responsive-table-sizes/responsive-column-sizes'; import { ResponsiveTableSizes } from '../../../shared/responsive-table-sizes/responsive-table-sizes'; import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { ItemEditBitstreamBundleComponent } from './item-edit-bitstream-bundle/item-edit-bitstream-bundle.component'; -import { - ItemEditBitstreamDragHandleComponent -} from './item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; import { ObjectValuesPipe } from '../../../shared/utils/object-values-pipe'; +import { VarDirective } from '../../../shared/utils/var.directive'; +import { AbstractItemUpdateComponent } from '../abstract-item-update/abstract-item-update.component'; +import { ItemEditBitstreamBundleComponent } from './item-edit-bitstream-bundle/item-edit-bitstream-bundle.component'; +import { ItemEditBitstreamDragHandleComponent } from './item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; @Component({ selector: 'ds-item-bitstreams', @@ -48,10 +77,10 @@ import { ObjectValuesPipe } from '../../../shared/utils/object-values-pipe'; VarDirective, ItemEditBitstreamDragHandleComponent, NgForOf, - ThemedLoadingComponent + ThemedLoadingComponent, ], providers: [ObjectValuesPipe], - standalone: true + standalone: true, }) /** * Component for displaying an item's bitstreams edit page diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts index d5cf8feca0..d39f9eb265 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts @@ -41,11 +41,11 @@ describe('ItemEditBitstreamBundleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ItemEditBitstreamBundleComponent], - schemas: [ + imports: [TranslateModule.forRoot(), ItemEditBitstreamBundleComponent], + schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts index 31d7cdb528..60654108c9 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts @@ -1,4 +1,15 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, ViewContainerRef, } from '@angular/core'; +import { + Component, + EventEmitter, + Input, + OnDestroy, + OnInit, + Output, + ViewChild, + ViewContainerRef, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Bundle } from '../../../../core/shared/bundle.model'; @@ -6,14 +17,8 @@ import { Item } from '../../../../core/shared/item.model'; import { ResponsiveColumnSizes } from '../../../../shared/responsive-table-sizes/responsive-column-sizes'; import { ResponsiveTableSizes } from '../../../../shared/responsive-table-sizes/responsive-table-sizes'; import { getItemPageRoute } from '../../../item-page-routing-paths'; -import { - PaginatedDragAndDropBitstreamListComponent -} from './paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { - ItemEditBitstreamDragHandleComponent -} from '../item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; +import { ItemEditBitstreamDragHandleComponent } from '../item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; +import { PaginatedDragAndDropBitstreamListComponent } from './paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component'; @Component({ selector: 'ds-item-edit-bitstream-bundle', @@ -23,9 +28,9 @@ import { PaginatedDragAndDropBitstreamListComponent, TranslateModule, RouterLink, - ItemEditBitstreamDragHandleComponent + ItemEditBitstreamDragHandleComponent, ], - standalone: true + standalone: true, }) /** * Component that displays a single bundle of an item on the item bitstreams edit page diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts index f846eec5f5..cbb3314252 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.spec.ts @@ -1,5 +1,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -11,13 +16,12 @@ import { PaginationService } from '../../../../../core/pagination/pagination.ser import { Bitstream } from '../../../../../core/shared/bitstream.model'; import { BitstreamFormat } from '../../../../../core/shared/bitstream-format.model'; import { Bundle } from '../../../../../core/shared/bundle.model'; +import { PaginationComponent } from '../../../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils'; import { ResponsiveColumnSizes } from '../../../../../shared/responsive-table-sizes/responsive-column-sizes'; import { ResponsiveTableSizes } from '../../../../../shared/responsive-table-sizes/responsive-table-sizes'; -import { PaginationServiceStub } from '../../../../../shared/testing/pagination-service.stub'; -import { PaginationComponent } from '../../../../../shared/pagination/pagination.component'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { PaginationServiceStub } from '../../../../../shared/testing/pagination-service.stub'; import { createPaginatedList } from '../../../../../shared/testing/utils.test'; import { ObjectValuesPipe } from '../../../../../shared/utils/object-values-pipe'; import { VarDirective } from '../../../../../shared/utils/var.directive'; @@ -133,8 +137,8 @@ describe('PaginatedDragAndDropBitstreamListComponent', () => { }) .overrideComponent(PaginatedDragAndDropBitstreamListComponent, { remove: { - imports: [PaginationComponent] - } + imports: [PaginationComponent], + }, }) .compileComponents(); })); diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts index 562d8c4d7d..24d827ac61 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component.ts @@ -1,4 +1,21 @@ -import { Component, ElementRef, Input, OnInit, } from '@angular/core'; +import { + CdkDrag, + CdkDragHandle, + CdkDropList, +} from '@angular/cdk/drag-drop'; +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + ElementRef, + Input, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { switchMap } from 'rxjs/operators'; import { BundleDataService } from '../../../../../core/data/bundle-data.service'; @@ -7,24 +24,17 @@ import { RequestService } from '../../../../../core/data/request.service'; import { PaginationService } from '../../../../../core/pagination/pagination.service'; import { Bitstream } from '../../../../../core/shared/bitstream.model'; import { Bundle } from '../../../../../core/shared/bundle.model'; -import { PaginationComponentOptions } from '../../../../../shared/pagination/pagination-component-options.model'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { PaginationComponent } from '../../../../../shared/pagination/pagination.component'; -import { VarDirective } from '../../../../../shared/utils/var.directive'; -import { CdkDrag, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop'; -import { ItemEditBitstreamComponent } from '../../item-edit-bitstream/item-edit-bitstream.component'; -import { - ItemEditBitstreamDragHandleComponent -} from '../../item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; import { ThemedLoadingComponent } from '../../../../../shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - AbstractPaginatedDragAndDropListComponent -} from '../../../../../shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component'; +import { PaginationComponent } from '../../../../../shared/pagination/pagination.component'; +import { PaginationComponentOptions } from '../../../../../shared/pagination/pagination-component-options.model'; +import { AbstractPaginatedDragAndDropListComponent } from '../../../../../shared/pagination-drag-and-drop/abstract-paginated-drag-and-drop-list.component'; import { ResponsiveTableSizes } from '../../../../../shared/responsive-table-sizes/responsive-table-sizes'; import { PaginatedSearchOptions } from '../../../../../shared/search/models/paginated-search-options.model'; import { followLink } from '../../../../../shared/utils/follow-link-config.model'; import { ObjectValuesPipe } from '../../../../../shared/utils/object-values-pipe'; +import { VarDirective } from '../../../../../shared/utils/var.directive'; +import { ItemEditBitstreamComponent } from '../../item-edit-bitstream/item-edit-bitstream.component'; +import { ItemEditBitstreamDragHandleComponent } from '../../item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component'; @Component({ selector: 'ds-paginated-drag-and-drop-bitstream-list', @@ -43,9 +53,9 @@ import { ObjectValuesPipe } from '../../../../../shared/utils/object-values-pipe ItemEditBitstreamDragHandleComponent, CdkDragHandle, ThemedLoadingComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * A component listing edit-bitstream rows for each bitstream within the given bundle. diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts index 1fe64e2ca7..b993eb7193 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts @@ -12,9 +12,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['../item-bitstreams.component.scss'], templateUrl: './item-edit-bitstream-drag-handle.component.html', imports: [ - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Component displaying a drag handle for the item-edit-bitstream page diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts index 9c941f50d7..bceb0a1207 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts @@ -5,6 +5,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -16,7 +17,6 @@ import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model' import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { ResponsiveColumnSizes } from '../../../../shared/responsive-table-sizes/responsive-column-sizes'; import { ResponsiveTableSizes } from '../../../../shared/responsive-table-sizes/responsive-table-sizes'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { VarDirective } from '../../../../shared/utils/var.directive'; import { ItemEditBitstreamComponent } from './item-edit-bitstream.component'; @@ -79,19 +79,19 @@ describe('ItemEditBitstreamComponent', () => { ); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemEditBitstreamComponent, - VarDirective - ], - providers: [ + VarDirective, + ], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], schemas: [ + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts index f8155f0312..5706805661 100644 --- a/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts +++ b/src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -8,6 +12,9 @@ import { ViewChild, ViewContainerRef, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import cloneDeep from 'lodash/cloneDeep'; import { Observable } from 'rxjs'; @@ -23,11 +30,7 @@ import { getRemoteDataPayload, } from '../../../../core/shared/operators'; import { ResponsiveTableSizes } from '../../../../shared/responsive-table-sizes/responsive-table-sizes'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; import { BrowserOnlyPipe } from '../../../../shared/utils/browser-only.pipe'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-item-edit-bitstream', @@ -39,9 +42,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; BrowserOnlyPipe, NgbTooltipModule, AsyncPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component that displays a single bitstream of an item on the edit page diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts index 20a104ea39..624f71242a 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts @@ -131,8 +131,8 @@ describe('ItemCollectionMapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemCollectionMapperComponent, CollectionSelectComponent, SearchFormComponent, PaginationComponent, EnumKeysPipe, VarDirective, ErrorComponent, LoadingComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemCollectionMapperComponent, CollectionSelectComponent, SearchFormComponent, PaginationComponent, EnumKeysPipe, VarDirective, ErrorComponent, LoadingComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useValue: routerStub }, { provide: SearchConfigurationService, useValue: searchConfigServiceStub }, @@ -145,7 +145,7 @@ describe('ItemCollectionMapperComponent', () => { { provide: CollectionDataService, useValue: collectionDataServiceStub }, { provide: AuthorizationDataService, useValue: authorizationDataService }, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts index d3cb5d9aff..bc962e27ff 100644 --- a/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts +++ b/src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts @@ -1,8 +1,34 @@ -import { ChangeDetectionStrategy, Component, OnInit, ViewChild, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, } from 'rxjs'; -import { filter, map, startWith, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + OnInit, + ViewChild, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Observable, +} from 'rxjs'; +import { + filter, + map, + startWith, + switchMap, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; @@ -23,15 +49,19 @@ import { } from '../../../core/shared/operators'; import { SearchService } from '../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { fadeIn, fadeInOut, } from '../../../shared/animations/fade'; -import { hasValue, isNotEmpty, } from '../../../shared/empty.util'; +import { + fadeIn, + fadeInOut, +} from '../../../shared/animations/fade'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; -import { getItemPageRoute } from '../../item-page-routing-paths'; -import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { CollectionSelectComponent } from '../../../shared/object-select/collection-select/collection-select.component'; +import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; import { ThemedSearchFormComponent } from '../../../shared/search-form/themed-search-form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ selector: 'ds-item-collection-mapper', @@ -40,7 +70,7 @@ import { AsyncPipe, NgIf } from '@angular/common'; changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut + fadeInOut, ], imports: [ NgbNavModule, @@ -48,9 +78,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; ThemedSearchFormComponent, AsyncPipe, TranslateModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component for mapping collections to an item diff --git a/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts b/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts index 39dd1e8bc4..4b92ceb09f 100644 --- a/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts @@ -1,5 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA, DebugElement, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -37,19 +44,19 @@ describe('ItemCurateComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ItemCurateComponent], - providers: [ + imports: [TranslateModule.forRoot(), ItemCurateComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: DSONameService, useValue: dsoNameService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) -.overrideComponent(ItemCurateComponent, { - remove: { - imports: [CurationFormComponent] - } -}) -.compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .overrideComponent(ItemCurateComponent, { + remove: { + imports: [CurationFormComponent], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts b/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts index e8d5a93783..3890d1b8ed 100644 --- a/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts +++ b/src/app/item-page/edit-item-page/item-curate/item-curate.component.ts @@ -1,8 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { filter, @@ -12,12 +17,12 @@ import { import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; -import { Item } from '../../../core/shared/item.model'; -import { hasValue } from '../../../shared/empty.util'; -import { Item } from '../../../core/shared/item.model'; +import { + Item, + Item, +} from '../../../core/shared/item.model'; import { CurationFormComponent } from '../../../curation-form/curation-form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; +import { hasValue } from '../../../shared/empty.util'; /** * Component for managing a collection's curation tasks @@ -29,9 +34,9 @@ import { TranslateModule } from '@ngx-translate/core'; CurationFormComponent, NgIf, TranslateModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class ItemCurateComponent implements OnInit { dsoRD$: Observable>; diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts index 09b888f1dc..e54d41296c 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts @@ -1,18 +1,23 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; -import { Relationship } from '../../../core/shared/item-relationships/relationship.model'; -import { Item } from '../../../core/shared/item.model'; -import { RouterStub } from '../../../shared/testing/router.stub'; -import { EMPTY, of as observableOf } from 'rxjs'; -import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { + EMPTY, + of as observableOf, +} from 'rxjs'; import { LinkService } from '../../../core/cache/builders/link.service'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; @@ -20,22 +25,25 @@ import { ItemDataService } from '../../../core/data/item-data.service'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { RelationshipTypeDataService } from '../../../core/data/relationship-type-data.service'; +import { Item } from '../../../core/shared/item.model'; +import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; +import { Relationship } from '../../../core/shared/item-relationships/relationship.model'; import { RelationshipType } from '../../../core/shared/item-relationships/relationship-type.model'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; +import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; +import { RouterStub } from '../../../shared/testing/router.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; import { VarDirective } from '../../../shared/utils/var.directive'; import { getItemEditRoute } from '../../item-page-routing-paths'; -import { ItemDeleteComponent } from './item-delete.component'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; +import { ItemDeleteComponent } from './item-delete.component'; let comp: ItemDeleteComponent; let fixture: ComponentFixture; @@ -156,24 +164,24 @@ describe('ItemDeleteComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemDeleteComponent, VarDirective], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemDeleteComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, - {provide: NotificationsService, useValue: notificationsServiceStub}, - {provide: ObjectUpdatesService, useValue: objectUpdatesServiceStub}, - {provide: RelationshipDataService, useValue: relationshipService}, - {provide: EntityTypeDataService, useValue: entityTypeService}, - {provide: RelationshipTypeDataService, useValue: {}}, - {provide: LinkService, useValue: linkService}, - {provide: ThemeService, useValue: getMockThemeService()} - ], schemas: [ + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: ObjectUpdatesService, useValue: objectUpdatesServiceStub }, + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: EntityTypeDataService, useValue: entityTypeService }, + { provide: RelationshipTypeDataService, useValue: {} }, + { provide: LinkService, useValue: linkService }, + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], }) .overrideComponent(ItemDeleteComponent, { - remove: {imports: [ListableObjectComponentLoaderComponent, ModifyItemOverviewComponent,]} + remove: { imports: [ListableObjectComponentLoaderComponent, ModifyItemOverviewComponent] }, }) .compileComponents(); })); diff --git a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts index 9bebb19232..dd1e08c98d 100644 --- a/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts +++ b/src/app/item-page/edit-item-page/item-delete/item-delete.component.ts @@ -1,7 +1,27 @@ -import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink, } from '@angular/router'; -import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -10,7 +30,13 @@ import { of as observableOf, Subscription, } from 'rxjs'; -import { defaultIfEmpty, filter, map, switchMap, take, } from 'rxjs/operators'; +import { + defaultIfEmpty, + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; import { LinkService } from '../../../core/cache/builders/link.service'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; @@ -29,18 +55,18 @@ import { getRemoteDataPayload, } from '../../../core/shared/operators'; import { ViewMode } from '../../../core/shared/view-mode.model'; -import { hasValue, isNotEmpty, } from '../../../shared/empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { followLink } from '../../../shared/utils/follow-link-config.model'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { getItemEditRoute } from '../../item-page-routing-paths'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { VirtualMetadata } from '../virtual-metadata/virtual-metadata.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; @Component({ selector: 'ds-item-delete', @@ -53,9 +79,9 @@ import { VarDirective } from '../../../shared/utils/var.directive'; AsyncPipe, VarDirective, NgForOf, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) /** * Component responsible for rendering the item delete page diff --git a/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts b/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts index 5bf89b3e7d..658223c661 100644 --- a/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts @@ -19,6 +19,7 @@ import { RequestService } from '../../../core/data/request.service'; import { Collection } from '../../../core/shared/collection.model'; import { Item } from '../../../core/shared/item.model'; import { SearchService } from '../../../core/shared/search/search.service'; +import { AuthorizedCollectionSelectorComponent } from '../../../shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; import { getMockRequestService } from '../../../shared/mocks/request.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { @@ -30,7 +31,6 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications- import { RouterStub } from '../../../shared/testing/router.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { ItemMoveComponent } from './item-move.component'; -import { AuthorizedCollectionSelectorComponent } from '../../../shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; describe('ItemMoveComponent', () => { let comp: ItemMoveComponent; @@ -100,24 +100,24 @@ describe('ItemMoveComponent', () => { itemDataService = mockItemDataService; TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemMoveComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemMoveComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, { provide: SearchService, useValue: mockSearchService }, { provide: RequestService, useValue: getMockRequestService() }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, - ], -}) -.overrideComponent(ItemMoveComponent, { - remove: { - imports: [AuthorizedCollectionSelectorComponent] - } -}) -.compileComponents(); + ], + }) + .overrideComponent(ItemMoveComponent, { + remove: { + imports: [AuthorizedCollectionSelectorComponent], + }, + }) + .compileComponents(); fixture = TestBed.createComponent(ItemMoveComponent); comp = fixture.componentInstance; fixture.detectChanges(); diff --git a/src/app/item-page/edit-item-page/item-move/item-move.component.ts b/src/app/item-page/edit-item-page/item-move/item-move.component.ts index 1fa337f563..1115260901 100644 --- a/src/app/item-page/edit-item-page/item-move/item-move.component.ts +++ b/src/app/item-page/edit-item-page/item-move/item-move.component.ts @@ -1,17 +1,35 @@ -import { Component, OnInit } from '@angular/core'; -import { map, switchMap } from 'rxjs/operators'; -import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; -import { RemoteData } from '../../../core/data/remote-data'; -import { Item } from '../../../core/shared/item.model'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { ItemDataService } from '../../../core/data/item-data.service'; +import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; import { Collection } from '../../../core/shared/collection.model'; +import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; +import { Item } from '../../../core/shared/item.model'; import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, @@ -19,14 +37,13 @@ import { getRemoteDataPayload, } from '../../../core/shared/operators'; import { SearchService } from '../../../core/shared/search/search.service'; +import { AuthorizedCollectionSelectorComponent } from '../../../shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { getItemEditRoute, getItemPageRoute, } from '../../item-page-routing-paths'; -import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgIf } from '@angular/common'; import { - AuthorizedCollectionSelectorComponent -} from '../../../shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; + getItemEditRoute, + getItemPageRoute, +} from '../../item-page-routing-paths'; @Component({ selector: 'ds-item-move', @@ -38,9 +55,9 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; RouterLink, AsyncPipe, AuthorizedCollectionSelectorComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component that handles the moving of an item to a different collection diff --git a/src/app/item-page/edit-item-page/item-operation/item-operation.component.spec.ts b/src/app/item-page/edit-item-page/item-operation/item-operation.component.spec.ts index aeb051371b..e2e6da826f 100644 --- a/src/app/item-page/edit-item-page/item-operation/item-operation.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-operation/item-operation.component.spec.ts @@ -17,8 +17,8 @@ describe('ItemOperationComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemOperationComponent], -}).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemOperationComponent], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts b/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts index c193594ba3..9cf4b30e6c 100644 --- a/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts +++ b/src/app/item-page/edit-item-page/item-operation/item-operation.component.ts @@ -1,13 +1,13 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; - -import { ItemOperation } from './itemOperation.model'; -import { TranslateModule } from '@ngx-translate/core'; import { RouterLink } from '@angular/router'; import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ItemOperation } from './itemOperation.model'; @Component({ selector: 'ds-item-operation', @@ -16,9 +16,9 @@ import { NgIf } from '@angular/common'; TranslateModule, RouterLink, NgbTooltipModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Operation that can be performed on an item diff --git a/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts b/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts index 8699078b67..0c4ca07f3f 100644 --- a/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts @@ -68,16 +68,16 @@ describe('ItemPrivateComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemPrivateComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemPrivateComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-private/item-private.component.ts b/src/app/item-page/edit-item-page/item-private/item-private.component.ts index bcf9f7e7b8..fe82c3d677 100644 --- a/src/app/item-page/edit-item-page/item-private/item-private.component.ts +++ b/src/app/item-page/edit-item-page/item-private/item-private.component.ts @@ -1,14 +1,20 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; - -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; @Component({ @@ -18,7 +24,7 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac imports: [ ModifyItemOverviewComponent, TranslateModule, - RouterLink + RouterLink, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts b/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts index d95b8d7ee4..64ac870804 100644 --- a/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts @@ -65,16 +65,16 @@ describe('ItemPublicComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemPublicComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemPublicComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-public/item-public.component.ts b/src/app/item-page/edit-item-page/item-public/item-public.component.ts index 7ce9d02ae8..c4858fd250 100644 --- a/src/app/item-page/edit-item-page/item-public/item-public.component.ts +++ b/src/app/item-page/edit-item-page/item-public/item-public.component.ts @@ -1,13 +1,20 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; @Component({ @@ -17,7 +24,7 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac imports: [ ModifyItemOverviewComponent, TranslateModule, - RouterLink + RouterLink, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts index 8469fd61a0..36e5c143c5 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts @@ -75,17 +75,17 @@ describe('ItemRegisterDoiComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemRegisterDoiComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemRegisterDoiComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: IdentifierDataService, useValue: mockIdentifierDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts index 162e9daa2e..9acc12e95d 100644 --- a/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts +++ b/src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts @@ -1,8 +1,23 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { first, map, } from 'rxjs/operators'; +import { + first, + map, +} from 'rxjs/operators'; import { IdentifierDataService } from '../../../core/data/identifier-data.service'; import { ItemDataService } from '../../../core/data/item-data.service'; @@ -12,9 +27,8 @@ import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { Identifier } from '../../../shared/object-list/identifier-data/identifier.model'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; import { getItemPageRoute } from '../../item-page-routing-paths'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; @Component({ @@ -26,9 +40,9 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac TranslateModule, AsyncPipe, NgIf, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * Component responsible for rendering the Item Register DOI page diff --git a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts index c993e9ae76..ff517a6f25 100644 --- a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts @@ -67,16 +67,16 @@ describe('ItemReinstateComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemReinstateComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemReinstateComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts index 2e4c3dfb87..534a79c602 100644 --- a/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts +++ b/src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts @@ -1,13 +1,20 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; @Component({ @@ -17,7 +24,7 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac imports: [ ModifyItemOverviewComponent, TranslateModule, - RouterLink + RouterLink, ], }) /** diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts index 4f092ca6a6..45c78fba46 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts @@ -8,11 +8,25 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Router } from '@angular/router'; +import { + ActivatedRoute, + Router, + Router, +} from '@angular/router'; +import { provideMockStore } from '@ngrx/store/testing'; +import { REQUEST } from '@nguniversal/express-engine/tokens'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthRequestService } from 'src/app/core/auth/auth-request.service'; +import { CookieService } from 'src/app/core/services/cookie.service'; +import { HardRedirectService } from 'src/app/core/services/hard-redirect.service'; +import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; +import { AuthRequestServiceStub } from 'src/app/shared/testing/auth-request-service.stub'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../../../config/app-config.interface'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ConfigurationDataService } from '../../../../core/data/configuration-data.service'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; @@ -20,44 +34,52 @@ import { ObjectUpdatesService } from '../../../../core/data/object-updates/objec import { RelationshipDataService } from '../../../../core/data/relationship-data.service'; import { RelationshipTypeDataService } from '../../../../core/data/relationship-type-data.service'; import { GroupDataService } from '../../../../core/eperson/group-data.service'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../../../core/pagination/pagination.service'; import { LinkHeadService } from '../../../../core/services/link-head.service'; -import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; -import { Item } from '../../../../core/shared/item.model'; +import { + ConfigurationProperty, + ConfigurationProperty, +} from '../../../../core/shared/configuration-property.model'; +import { + Item, + Item, +} from '../../../../core/shared/item.model'; import { ItemType } from '../../../../core/shared/item-relationships/item-type.model'; import { Relationship } from '../../../../core/shared/item-relationships/relationship.model'; -import { Item } from '../../../../core/shared/item.model'; -import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; -import { EditRelationshipListComponent } from './edit-relationship-list.component'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { createPaginatedList } from '../../../../shared/testing/utils.test'; -import { PaginationService } from '../../../../core/pagination/pagination.service'; -import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; import { RelationshipType } from '../../../../core/shared/item-relationships/relationship-type.model'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; import { HostWindowService } from '../../../../shared/host-window.service'; -import { RouterMock } from '../../../../shared/mocks/router.mock'; -import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; +import { + RouterMock, + RouterMock, +} from '../../../../shared/mocks/router.mock'; +import { + SelectableListService, + SelectableListService, +} from '../../../../shared/object-list/selectable-list/selectable-list.service'; import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; -import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { SharedModule } from '../../../../shared/shared.module'; +import { + createSuccessfulRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../../../shared/remote-data.utils'; import { HostWindowServiceStub } from '../../../../shared/testing/host-window-service.stub'; -import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; +import { + PaginationServiceStub, + PaginationServiceStub, +} from '../../../../shared/testing/pagination-service.stub'; import { SearchConfigurationServiceStub } from '../../../../shared/testing/search-configuration-service.stub'; -import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; -import { ActivatedRoute, Router } from '@angular/router'; -import { RouterMock } from '../../../../shared/mocks/router.mock'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { provideMockStore } from '@ngrx/store/testing'; -import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; -import { REQUEST } from '@nguniversal/express-engine/tokens'; -import { AuthRequestServiceStub } from 'src/app/shared/testing/auth-request-service.stub'; -import { AuthRequestService } from 'src/app/core/auth/auth-request.service'; -import { CookieService } from 'src/app/core/services/cookie.service'; -import { HardRedirectService } from 'src/app/core/services/hard-redirect.service'; -import { createPaginatedList } from '../../../../shared/testing/utils.test'; -import { EditRelationshipListComponent } from './edit-relationship-list.component'; +import { + createPaginatedList, + createPaginatedList, +} from '../../../../shared/testing/utils.test'; +import { + EditRelationshipListComponent, + EditRelationshipListComponent, +} from './edit-relationship-list.component'; let comp: EditRelationshipListComponent; let fixture: ComponentFixture; @@ -106,7 +128,7 @@ describe('EditRelationshipListComponent', () => { 'cache/object-updates': {}, 'data/request': {}, 'index': {}, - } + }, }; hardRedirectService = jasmine.createSpyObj('hardRedirectService', ['redirect']); @@ -248,9 +270,9 @@ describe('EditRelationshipListComponent', () => { }; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), EditRelationshipListComponent], - providers: [ - provideMockStore({initialState}), + imports: [TranslateModule.forRoot(), EditRelationshipListComponent], + providers: [ + provideMockStore({ initialState }), { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: RelationshipDataService, useValue: relationshipService }, { provide: SelectableListService, useValue: selectableListService }, @@ -268,11 +290,11 @@ describe('EditRelationshipListComponent', () => { { provide: HardRedirectService, useValue: hardRedirectService }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: REQUEST, useValue: {} }, - CookieService - ], schemas: [ + CookieService, + ], schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); resetComponent(); })); diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts index 7b80286a0f..d9029a7af4 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -11,6 +17,7 @@ import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -18,7 +25,8 @@ import { Observable, Subscription, } from 'rxjs'; -import {defaultIfEmpty, +import { + defaultIfEmpty, map, mergeMap, startWith, @@ -59,22 +67,18 @@ import { hasValue, hasValueOperator, } from '../../../../shared/empty.util'; -import { - DsDynamicLookupRelationModalComponent -} from '../../../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component'; +import { DsDynamicLookupRelationModalComponent } from '../../../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component'; import { RelationshipOptions } from '../../../../shared/form/builder/models/relationship-options.model'; +import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; import { SelectableListService } from '../../../../shared/object-list/selectable-list/selectable-list.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; import { SearchResult } from '../../../../shared/search/models/search-result.model'; import { FollowLinkConfig } from '../../../../shared/utils/follow-link-config.model'; -import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils'; -import { EditRelationshipComponent } from '../edit-relationship/edit-relationship.component'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; import { ObjectValuesPipe } from '../../../../shared/utils/object-values-pipe'; +import { itemLinksToFollow } from '../../../../shared/utils/relation-query.utils'; import { VarDirective } from '../../../../shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; +import { EditRelationshipComponent } from '../edit-relationship/edit-relationship.component'; @Component({ selector: 'ds-edit-relationship-list', @@ -90,9 +94,9 @@ import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loadin NgFor, TranslateModule, NgClass, - ThemedLoadingComponent + ThemedLoadingComponent, ], - standalone: true + standalone: true, }) /** * A component creating a list of editable relationships of a certain type diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts index 69f0f86fd2..aa44b733dd 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts @@ -1,33 +1,43 @@ // eslint-disable-next-line max-classes-per-file -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, + ComponentFixture, + TestBed, TestBed, waitForAsync, + waitForAsync, } from '@angular/core/testing'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; -import { Item } from '../../../../core/shared/item.model'; +import { + Item, + Item, +} from '../../../../core/shared/item.model'; import { Relationship } from '../../../../core/shared/item-relationships/relationship.model'; -import { Item } from '../../../../core/shared/item.model'; -import { EditRelationshipComponent } from './edit-relationship.component'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { RelationshipType } from '../../../../core/shared/item-relationships/relationship-type.model'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ListableObjectComponentLoaderComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../../shared/testing/utils.test'; -import { EditRelationshipComponent } from './edit-relationship.component'; import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { VirtualMetadataComponent } from '../../virtual-metadata/virtual-metadata.component'; import { - ListableObjectComponentLoaderComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; + EditRelationshipComponent, + EditRelationshipComponent, +} from './edit-relationship.component'; let objectUpdatesService; const url = 'http://test-url.com/test-url'; @@ -134,25 +144,25 @@ describe('EditRelationshipComponent', () => { mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({})} as NgbModalRef - ) + { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + ), }; spyOn(objectUpdatesService, 'isSelectedVirtualMetadata').and.callFake((a, b, uuid) => observableOf(itemSelection[uuid])); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), EditRelationshipComponent], - providers: [ + imports: [TranslateModule.forRoot(), EditRelationshipComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: NgbModal, useValue: mockNgbModal }, - { provide: ThemeService, useValue: getMockThemeService() } - ], schemas: [ + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [ NO_ERRORS_SCHEMA, - ], -}) + ], + }) .overrideComponent(EditRelationshipComponent, { remove: { imports: [ VirtualMetadataComponent, ListableObjectComponentLoaderComponent ] }, - add: { imports: [ MockVirtualMetadataComponent, MockListableObjectComponentLoaderComponent ] } + add: { imports: [ MockVirtualMetadataComponent, MockListableObjectComponentLoaderComponent ] }, }) .compileComponents(); })); @@ -242,7 +252,7 @@ describe('EditRelationshipComponent', () => { @Component({ selector: 'ds-virtual-metadata', template: ``, - standalone: true + standalone: true, }) class MockVirtualMetadataComponent {} diff --git a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts index c2e9e22d30..6396f01a13 100644 --- a/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -5,8 +9,11 @@ import { } from '@angular/core'; import { NgbModal, + NgbModal, + NgbModalRef, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, @@ -19,8 +26,14 @@ import { take, } from 'rxjs/operators'; -import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; -import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; +import { + FieldChangeType, + FieldChangeType, +} from '../../../../core/data/object-updates/field-change-type.model'; +import { + FieldUpdate, + FieldUpdate, +} from '../../../../core/data/object-updates/field-update.model'; import { DeleteRelationship, RelationshipIdentifiable, @@ -32,20 +45,14 @@ import { getRemoteDataPayload, } from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { hasValue, isNotEmpty } from '../../../../shared/empty.util'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; -import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { VirtualMetadataComponent } from '../../virtual-metadata/virtual-metadata.component'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../../shared/empty.util'; +import { ListableObjectComponentLoaderComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { VirtualMetadataComponent } from '../../virtual-metadata/virtual-metadata.component'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector @@ -57,9 +64,9 @@ import { AsyncPipe, NgIf, TranslateModule, - VirtualMetadataComponent + VirtualMetadataComponent, ], - standalone: true + standalone: true, }) export class EditRelationshipComponent implements OnChanges { /** diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts index 5d42ffad46..106edb08ef 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts @@ -1,9 +1,23 @@ -import { ChangeDetectorRef, DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ChangeDetectorRef, + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { combineLatest as observableCombineLatest, of as observableOf, } from 'rxjs'; +import { + combineLatest as observableCombineLatest, + of as observableOf, +} from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; @@ -20,7 +34,10 @@ import { ItemType } from '../../../core/shared/item-relationships/item-type.mode import { Relationship } from '../../../core/shared/item-relationships/relationship.model'; import { RelationshipType } from '../../../core/shared/item-relationships/relationship-type.model'; import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { INotification, Notification, } from '../../../shared/notifications/models/notification.model'; +import { + INotification, + Notification, +} from '../../../shared/notifications/models/notification.model'; import { NotificationType } from '../../../shared/notifications/models/notification-type'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { @@ -213,8 +230,8 @@ describe('ItemRelationshipsComponent', () => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ItemRelationshipsComponent], - providers: [ + imports: [TranslateModule.forRoot(), ItemRelationshipsComponent], + providers: [ { provide: ThemeService, useValue: getMockThemeService() }, { provide: ItemDataService, useValue: itemService }, { provide: ObjectUpdatesService, useValue: objectUpdatesService }, @@ -227,10 +244,10 @@ describe('ItemRelationshipsComponent', () => { { provide: RequestService, useValue: requestService }, { provide: RelationshipTypeDataService, useValue: relationshipTypeService }, ChangeDetectorRef, - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts index 83648faca4..16ad92143d 100644 --- a/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts +++ b/src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts @@ -1,13 +1,24 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, @@ -32,9 +43,6 @@ import { RelationshipIdentifiable, } from '../../../core/data/object-updates/object-updates.reducer'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { RelationshipTypeDataService } from '../../../core/data/relationship-type-data.service'; @@ -50,13 +58,15 @@ import { getRemoteDataPayload, } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { followLink } from '../../../shared/utils/follow-link-config.model'; -import { AbstractItemUpdateComponent } from '../abstract-item-update/abstract-item-update.component'; import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { EditRelationshipListComponent } from './edit-relationship-list/edit-relationship-list.component'; +import { + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; +import { followLink } from '../../../shared/utils/follow-link-config.model'; import { VarDirective } from '../../../shared/utils/var.directive'; +import { AbstractItemUpdateComponent } from '../abstract-item-update/abstract-item-update.component'; +import { EditRelationshipListComponent } from './edit-relationship-list/edit-relationship-list.component'; @Component({ selector: 'ds-item-relationships', @@ -69,9 +79,9 @@ import { VarDirective } from '../../../shared/utils/var.directive'; NgIf, EditRelationshipListComponent, NgForOf, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) /** * Component for displaying an item's relationships edit page diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts index 3ae90e5701..4a11901f86 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.spec.ts @@ -79,8 +79,8 @@ describe('ItemStatusComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemStatusComponent], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemStatusComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: AuthorizationDataService, useValue: authorizationService }, diff --git a/src/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/app/item-page/edit-item-page/item-status/item-status.component.ts index 28462a07a3..f330c2e457 100644 --- a/src/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -1,9 +1,19 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, RouterLink } from '@angular/router'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -40,13 +50,11 @@ import { import { hasValue } from '../../../shared/empty.util'; import { Identifier } from '../../../shared/object-list/identifier-data/identifier.model'; import { IdentifierData } from '../../../shared/object-list/identifier-data/identifier-data.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { ItemOperationComponent } from '../item-operation/item-operation.component'; import { getItemEditRoute, getItemPageRoute, } from '../../item-page-routing-paths'; +import { ItemOperationComponent } from '../item-operation/item-operation.component'; import { ItemOperation } from '../item-operation/itemOperation.model'; @Component({ @@ -55,7 +63,7 @@ import { ItemOperation } from '../item-operation/itemOperation.model'; changeDetection: ChangeDetectionStrategy.Default, animations: [ fadeIn, - fadeInOut + fadeInOut, ], imports: [ TranslateModule, @@ -64,9 +72,9 @@ import { ItemOperation } from '../item-operation/itemOperation.model'; NgIf, RouterLink, ItemOperationComponent, - NgClass + NgClass, ], - standalone: true + standalone: true, }) /** * Component for displaying an item's status diff --git a/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts index 223cdc3adf..705ef6d8ad 100644 --- a/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts +++ b/src/app/item-page/edit-item-page/item-status/themed-item-status.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../../shared/theme-support/themed.component' import { ItemStatusComponent } from './item-status.component'; @Component({ - selector: 'ds-themed-item-status', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-status', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedItemStatusComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts index f1532cc27f..f1ba067ddc 100644 --- a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts @@ -1,14 +1,22 @@ -import { ItemVersionHistoryComponent } from './item-version-history.component'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { VarDirective } from '../../../shared/utils/var.directive'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { Item } from '../../../core/shared/item.model'; -import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; + +import { Item } from '../../../core/shared/item.model'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { ItemVersionsComponent } from '../../versions/item-versions.component'; +import { ItemVersionHistoryComponent } from './item-version-history.component'; describe('ItemVersionHistoryComponent', () => { let component: ItemVersionHistoryComponent; @@ -29,20 +37,20 @@ describe('ItemVersionHistoryComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ItemVersionHistoryComponent, - VarDirective - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ItemVersionHistoryComponent, + VarDirective, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ItemVersionHistoryComponent, { - remove: {imports: [ItemVersionsComponent]}, - add: { imports: [MockItemVersionsComponent]} + remove: { imports: [ItemVersionsComponent] }, + add: { imports: [MockItemVersionsComponent] }, }) .compileComponents(); })); @@ -64,6 +72,6 @@ describe('ItemVersionHistoryComponent', () => { @Component({ selector: 'ds-item-versions', template: '', - standalone: true + standalone: true, }) class MockItemVersionsComponent {} diff --git a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts index 9dab618d8e..9c61231164 100644 --- a/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts +++ b/src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; @@ -7,9 +11,8 @@ import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { AlertType } from '../../../shared/alert/alert-type'; -import { ItemVersionsComponent } from '../../versions/item-versions.component'; import { VarDirective } from '../../../shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { ItemVersionsComponent } from '../../versions/item-versions.component'; @Component({ selector: 'ds-item-version-history', @@ -18,9 +21,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; ItemVersionsComponent, VarDirective, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component for listing and managing an item's version history diff --git a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts index 6939b4d976..bef3978ed2 100644 --- a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts +++ b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts @@ -65,16 +65,16 @@ describe('ItemWithdrawComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemWithdrawComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, ItemWithdrawComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts index a4cc1f13ec..720c0a62e9 100644 --- a/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts +++ b/src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts @@ -1,14 +1,20 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; - -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { ItemDataService } from '../../../core/data/item-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; @Component({ @@ -18,7 +24,7 @@ import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstrac imports: [ ModifyItemOverviewComponent, TranslateModule, - RouterLink + RouterLink, ], }) /** diff --git a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.spec.ts b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.spec.ts index e2a29a8b75..45759aa90b 100644 --- a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.spec.ts +++ b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.spec.ts @@ -29,8 +29,8 @@ const mockItem = Object.assign(new Item(), { describe('ModifyItemOverviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ModifyItemOverviewComponent] -}).compileComponents(); + imports: [TranslateModule.forRoot(), ModifyItemOverviewComponent], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts index c8337d8224..2d4b622ea9 100644 --- a/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts +++ b/src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts @@ -1,19 +1,22 @@ +import { + KeyValuePipe, + NgFor, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../core/shared/item.model'; import { MetadataMap } from '../../../core/shared/metadata.models'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgFor, KeyValuePipe } from '@angular/common'; @Component({ - selector: 'ds-modify-item-overview', - templateUrl: './modify-item-overview.component.html', - standalone: true, - imports: [NgFor, KeyValuePipe, TranslateModule] + selector: 'ds-modify-item-overview', + templateUrl: './modify-item-overview.component.html', + standalone: true, + imports: [NgFor, KeyValuePipe, TranslateModule], }) /** * Component responsible for rendering a table containing the metadatavalues from the to be edited item diff --git a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts index 375d70499c..5613403d2d 100644 --- a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts +++ b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts @@ -38,10 +38,10 @@ import { AbstractSimpleItemActionComponent } from './abstract-simple-item-action * AbstractSimpleItemActionComponent component */ @Component({ - selector: 'ds-simple-action', - templateUrl: './abstract-simple-item-action.component.html', - standalone: true, - imports: [CommonModule, FormsModule, NgbModule, TranslateModule], + selector: 'ds-simple-action', + templateUrl: './abstract-simple-item-action.component.html', + standalone: true, + imports: [CommonModule, FormsModule, NgbModule, TranslateModule], }) export class MySimpleItemActionComponent extends AbstractSimpleItemActionComponent { @@ -96,16 +96,16 @@ describe('AbstractSimpleItemActionComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MySimpleItemActionComponent], - providers: [ + imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MySimpleItemActionComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, { provide: NotificationsService, useValue: notificationsServiceStub }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts index 561afff428..d5e3eff25a 100644 --- a/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts +++ b/src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts @@ -1,27 +1,47 @@ -import { Component, OnInit, Predicate } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { ItemDataService } from '../../../core/data/item-data.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Item } from '../../../core/shared/item.model'; -import { RemoteData } from '../../../core/data/remote-data'; +import { + Component, + OnInit, + Predicate, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { first, map, } from 'rxjs/operators'; -import { ItemDataService } from '../../../core/data/item-data.service'; -import { RemoteData } from '../../../core/data/remote-data'; -import { Item } from '../../../core/shared/item.model'; +import { + ItemDataService, + ItemDataService, +} from '../../../core/data/item-data.service'; +import { + RemoteData, + RemoteData, +} from '../../../core/data/remote-data'; +import { + Item, + Item, +} from '../../../core/shared/item.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; import { getItemEditRoute, + getItemEditRoute, + getItemPageRoute, getItemPageRoute, } from '../../item-page-routing-paths'; import { findSuccessfulAccordingTo } from '../edit-item-operators'; -import { getItemEditRoute, getItemPageRoute } from '../../item-page-routing-paths'; import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; /** @@ -34,9 +54,9 @@ import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item imports: [ ModifyItemOverviewComponent, TranslateModule, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) export class AbstractSimpleItemActionComponent implements OnInit { diff --git a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts index 651d888392..66727871c0 100644 --- a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts +++ b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts @@ -1,18 +1,22 @@ -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../config/app-config.interface'; import { environment } from '../../../../environments/environment'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { Item } from '../../../core/shared/item.model'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; import { VarDirective } from '../../../shared/utils/var.directive'; import { VirtualMetadataComponent } from './virtual-metadata.component'; @@ -61,8 +65,8 @@ describe('VirtualMetadataComponent', () => { }) .overrideComponent(VirtualMetadataComponent, { remove: { - imports: [ListableObjectComponentLoaderComponent] - } + imports: [ListableObjectComponentLoaderComponent], + }, }) .compileComponents(); diff --git a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts index df70ef769a..11c9a291f8 100644 --- a/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts +++ b/src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts @@ -1,16 +1,28 @@ -import { Component, EventEmitter, Inject, Input, OnInit, Output, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgForOf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Inject, + Input, + OnInit, + Output, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { APP_CONFIG, AppConfig, } from '../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../config/app-config.interface'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { Item } from '../../../core/shared/item.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; -import { AsyncPipe, NgClass, NgForOf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { VarDirective } from '../../../shared/utils/var.directive'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; @Component({ selector: 'ds-virtual-metadata', @@ -21,9 +33,9 @@ import { NgForOf, VarDirective, AsyncPipe, - ListableObjectComponentLoaderComponent + ListableObjectComponentLoaderComponent, ], - standalone: true + standalone: true, }) /** * Component that lists both items of a relationship, along with their virtual metadata of the relationship. diff --git a/src/app/item-page/field-components/collections/collections.component.spec.ts b/src/app/item-page/field-components/collections/collections.component.spec.ts index 00daccfb6e..13f94410a7 100644 --- a/src/app/item-page/field-components/collections/collections.component.spec.ts +++ b/src/app/item-page/field-components/collections/collections.component.spec.ts @@ -8,6 +8,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @@ -22,13 +23,12 @@ import { Collection } from '../../../core/shared/collection.model'; import { Item } from '../../../core/shared/item.model'; import { PageInfo } from '../../../core/shared/page-info.model'; import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { getMockRemoteDataBuildService } from '../../../shared/mocks/remote-data-build.service.mock'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { CollectionsComponent } from './collections.component'; const createMockCollection = (id: string) => Object.assign(new Collection(), { @@ -61,15 +61,15 @@ describe('CollectionsComponent', () => { mockCollection4 = createMockCollection('c4'); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CollectionsComponent], - providers: [ + imports: [TranslateModule.forRoot(), CollectionsComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: RemoteDataBuildService, useValue: getMockRemoteDataBuildService() }, { provide: CollectionDataService, useValue: collectionDataService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CollectionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CollectionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/field-components/collections/collections.component.ts b/src/app/item-page/field-components/collections/collections.component.ts index 64dbf9082f..e70dcfba2c 100644 --- a/src/app/item-page/field-components/collections/collections.component.ts +++ b/src/app/item-page/field-components/collections/collections.component.ts @@ -1,9 +1,16 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, Input, OnInit, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -32,9 +39,6 @@ import { } from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; /** * This component renders the parent collections section of the item @@ -50,9 +54,9 @@ import { RouterLink } from '@angular/router'; NgForOf, AsyncPipe, RouterLink, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class CollectionsComponent implements OnInit { diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.spec.ts b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.spec.ts index a026040b89..4bbea37fd3 100644 --- a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.spec.ts +++ b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.spec.ts @@ -41,17 +41,17 @@ const mockLinkText = 'fake link text'; describe('MetadataUriValuesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), MetadataUriValuesComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), MetadataUriValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MetadataUriValuesComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(MetadataUriValuesComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts index 105a9e3c99..76c7defe35 100644 --- a/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts +++ b/src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts @@ -1,9 +1,15 @@ -import { Component, Input, } from '@angular/core'; +import { + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgForOf, NgIf } from '@angular/common'; import { MetadataValuesComponent } from '../metadata-values/metadata-values.component'; /** @@ -21,9 +27,9 @@ import { MetadataValuesComponent } from '../metadata-values/metadata-values.comp MetadataFieldWrapperComponent, TranslateModule, NgForOf, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MetadataUriValuesComponent extends MetadataValuesComponent { diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts index f0aba64903..8e93175c46 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts @@ -41,17 +41,17 @@ const mockLabel = 'fake.message'; describe('MetadataValuesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, - }, - }), MetadataValuesComponent], - providers: [ + }, + }), MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MetadataValuesComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(MetadataValuesComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index 9fcc10d029..23963c0a20 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -1,17 +1,31 @@ -import { Component, Inject, Input, OnChanges, SimpleChanges, } from '@angular/core'; +import { + AsyncPipe, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnChanges, + SimpleChanges, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { APP_CONFIG, AppConfig, } from '../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../config/app-config.interface'; import { environment } from '../../../../environments/environment'; import { BrowseDefinition } from '../../../core/shared/browse-definition.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { VALUE_LIST_BROWSE_DEFINITION } from '../../../core/shared/value-list-browse-definition.resource-type'; -import { TranslateModule } from '@ngx-translate/core'; -import { MarkdownPipe as MarkdownPipe_1 } from '../../../shared/utils/markdown.pipe'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; -import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ImageField } from '../../simple/field-components/specific-field/image-field'; import { hasValue } from '../../../shared/empty.util'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { MarkdownPipe as MarkdownPipe_1 } from '../../../shared/utils/markdown.pipe'; +import { ImageField } from '../../simple/field-components/specific-field/image-field'; import { ImageField } from '../../simple/field-components/specific-field/item-page-field.component'; /** @@ -19,11 +33,11 @@ import { ImageField } from '../../simple/field-components/specific-field/item-pa * It puts the given 'separator' between each two values. */ @Component({ - selector: 'ds-metadata-values', - styleUrls: ['./metadata-values.component.scss'], - templateUrl: './metadata-values.component.html', - standalone: true, - imports: [MetadataFieldWrapperComponent, NgFor, NgTemplateOutlet, NgIf, RouterLink, AsyncPipe, MarkdownPipe_1, TranslateModule] + selector: 'ds-metadata-values', + styleUrls: ['./metadata-values.component.scss'], + templateUrl: './metadata-values.component.html', + standalone: true, + imports: [MetadataFieldWrapperComponent, NgFor, NgTemplateOutlet, NgIf, RouterLink, AsyncPipe, MarkdownPipe_1, TranslateModule], }) export class MetadataValuesComponent implements OnChanges { diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts index aeb482dcec..9eba8c5fd1 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts @@ -1,34 +1,38 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { provideMockStore } from '@ngrx/store/testing'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment'; + import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { Bitstream } from '../../../../core/shared/bitstream.model'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; +import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { MockBitstreamFormat1 } from '../../../../shared/mocks/item.mock'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; import { createPaginatedList } from '../../../../shared/testing/utils.test'; import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { VarDirective } from '../../../../shared/utils/var.directive'; -import { FullFileSectionComponent } from './full-file-section.component'; -import { provideMockStore } from '@ngrx/store/testing'; -import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../shared/file-download-link/themed-file-download-link.component'; import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { FullFileSectionComponent } from './full-file-section.component'; describe('FullFileSectionComponent', () => { let comp: FullFileSectionComponent; @@ -81,20 +85,20 @@ describe('FullFileSectionComponent', () => { FullFileSectionComponent, VarDirective, FileSizePipe, - MetadataFieldWrapperComponent + MetadataFieldWrapperComponent, ], providers: [ provideMockStore(), - {provide: BitstreamDataService, useValue: bitstreamDataService}, - {provide: NotificationsService, useValue: new NotificationsServiceStub()}, - {provide: SearchConfigurationService, useValue: jasmine.createSpyObj(['getCurrentConfiguration'])}, - {provide: PaginationService, useValue: paginationService}, - {provide: APP_CONFIG, useValue: environment}, + { provide: BitstreamDataService, useValue: bitstreamDataService }, + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, + { provide: SearchConfigurationService, useValue: jasmine.createSpyObj(['getCurrentConfiguration']) }, + { provide: PaginationService, useValue: paginationService }, + { provide: APP_CONFIG, useValue: environment }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(FullFileSectionComponent, { - remove: {imports: [PaginationComponent, MetadataFieldWrapperComponent, ThemedFileDownloadLinkComponent, ThemedThumbnailComponent]} + remove: { imports: [PaginationComponent, MetadataFieldWrapperComponent, ThemedFileDownloadLinkComponent, ThemedThumbnailComponent] }, }) .compileComponents(); })); diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts index 2d8653e73f..8f8b01eb26 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -1,8 +1,28 @@ -import { Component, Inject, Input, OnDestroy, OnInit, } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { switchMap, tap, } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from 'src/config/app-config.interface'; +import { + switchMap, + tap, +} from 'rxjs/operators'; +import { + APP_CONFIG, + AppConfig, +} from 'src/config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; @@ -11,22 +31,20 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { Bitstream } from '../../../../core/shared/bitstream.model'; import { Item } from '../../../../core/shared/item.model'; -import { hasValue, isEmpty, } from '../../../../shared/empty.util'; +import { + hasValue, + isEmpty, +} from '../../../../shared/empty.util'; +import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; -import { followLink } from '../../../../shared/utils/follow-link-config.model'; -import { FileSectionComponent } from '../../../simple/field-components/file-section/file-section.component'; import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model'; +import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; +import { followLink } from '../../../../shared/utils/follow-link-config.model'; import { VarDirective } from '../../../../shared/utils/var.directive'; import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../shared/file-download-link/themed-file-download-link.component'; -import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { FileSectionComponent } from '../../../simple/field-components/file-section/file-section.component'; /** * This component renders the file section of the item @@ -47,9 +65,9 @@ import { NgForOf, ThemedFileDownloadLinkComponent, FileSizePipe, - MetadataFieldWrapperComponent + MetadataFieldWrapperComponent, ], - standalone: true + standalone: true, }) export class FullFileSectionComponent extends FileSectionComponent implements OnDestroy, OnInit { diff --git a/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts b/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts index 7dc391e92d..38a4879715 100644 --- a/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts +++ b/src/app/item-page/full/field-components/file-section/themed-full-file-section.component.ts @@ -11,10 +11,10 @@ import { FullFileSectionComponent } from './full-file-section.component'; * Themed wrapper for {@link FullFileSectionComponent} */ @Component({ - selector: 'ds-themed-item-page-full-file-section', - styleUrls: [], - templateUrl: './../../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-page-full-file-section', + styleUrls: [], + templateUrl: './../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedFullFileSectionComponent extends ThemedComponent { diff --git a/src/app/item-page/full/full-item-page.component.spec.ts b/src/app/item-page/full/full-item-page.component.spec.ts index ca40a3ca57..01faa08044 100644 --- a/src/app/item-page/full/full-item-page.component.spec.ts +++ b/src/app/item-page/full/full-item-page.component.spec.ts @@ -1,11 +1,26 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, PLATFORM_ID, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, + PLATFORM_ID, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service'; @@ -15,29 +30,30 @@ import { RemoteData } from '../../core/data/remote-data'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { MetadataService } from '../../core/metadata/metadata.service'; import { LinkHeadService } from '../../core/services/link-head.service'; -import { ItemVersionsComponent } from '../versions/item-versions.component'; -import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ServerResponseService } from '../../core/services/server-response.service'; +import { Item } from '../../core/shared/item.model'; import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; +import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, +} from '../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { createPaginatedList } from '../../shared/testing/utils.test'; +import { ThemeService } from '../../shared/theme-support/theme.service'; +import { TruncatePipe } from '../../shared/utils/truncate.pipe'; +import { VarDirective } from '../../shared/utils/var.directive'; import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; import { CollectionsComponent } from '../field-components/collections/collections.component'; -import { ThemedFullFileSectionComponent } from './field-components/file-section/themed-full-file-section.component'; -import { ServerResponseService } from '../../core/services/server-response.service'; -import { Item } from '../../core/shared/item.model'; -import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { createPaginatedList } from '../../shared/testing/utils.test'; -import { TruncatePipe } from '../../shared/utils/truncate.pipe'; -import { VarDirective } from '../../shared/utils/var.directive'; +import { ThemedItemPageTitleFieldComponent } from '../simple/field-components/specific-field/title/themed-item-page-field.component'; import { createRelationshipsObservable } from '../simple/item-types/shared/item.component.spec'; +import { ItemVersionsComponent } from '../versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; +import { ThemedFullFileSectionComponent } from './field-components/file-section/themed-full-file-section.component'; import { FullItemPageComponent } from './full-item-page.component'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../shared/theme-support/theme.service'; const mockItem: Item = Object.assign(new Item(), { bundles: createSuccessfulRemoteDataObject$(createPaginatedList([])), @@ -128,13 +144,13 @@ describe('FullItemPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), RouterTestingModule.withRoutes([]), BrowserAnimationsModule, FullItemPageComponent, TruncatePipe, VarDirective], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), RouterTestingModule.withRoutes([]), BrowserAnimationsModule, FullItemPageComponent, TruncatePipe, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: ItemDataService, useValue: {} }, { provide: MetadataService, useValue: metadataServiceStub }, @@ -160,8 +176,8 @@ describe('FullItemPageComponent', () => { ViewTrackerComponent, ThemedItemAlertsComponent, CollectionsComponent, - ThemedFullFileSectionComponent - ] + ThemedFullFileSectionComponent, + ], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/item-page/full/full-item-page.component.ts b/src/app/item-page/full/full-item-page.component.ts index 9499097e79..fba1d00e9b 100644 --- a/src/app/item-page/full/full-item-page.component.ts +++ b/src/app/item-page/full/full-item-page.component.ts @@ -1,8 +1,33 @@ -import { filter, map } from 'rxjs/operators'; -import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, Data, Router, RouterLink } from '@angular/router'; -import { AsyncPipe, KeyValuePipe, Location, NgForOf, NgIf } from '@angular/common'; -import { BehaviorSubject, Observable, } from 'rxjs'; +import { + AsyncPipe, + KeyValuePipe, + Location, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + ActivatedRoute, + Data, + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; +import { + filter, + map, +} from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service'; @@ -15,22 +40,19 @@ import { ServerResponseService } from '../../core/services/server-response.servi import { Item } from '../../core/shared/item.model'; import { MetadataMap } from '../../core/shared/metadata.models'; import { fadeInOut } from '../../shared/animations/fade'; +import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { hasValue } from '../../shared/empty.util'; import { ErrorComponent } from '../../shared/error/error.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedFullFileSectionComponent } from './field-components/file-section/themed-full-file-section.component'; -import { CollectionsComponent } from '../field-components/collections/collections.component'; -import { ItemVersionsComponent } from '../versions/item-versions.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; +import { VarDirective } from '../../shared/utils/var.directive'; import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; -import { VarDirective } from '../../shared/utils/var.directive'; +import { CollectionsComponent } from '../field-components/collections/collections.component'; +import { ThemedItemPageTitleFieldComponent } from '../simple/field-components/specific-field/title/themed-item-page-field.component'; import { ItemPageComponent } from '../simple/item-page.component'; +import { ItemVersionsComponent } from '../versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; +import { ThemedFullFileSectionComponent } from './field-components/file-section/themed-full-file-section.component'; /** * This component renders a full item page. @@ -60,9 +82,9 @@ import { ItemPageComponent } from '../simple/item-page.component'; ItemVersionsNoticeComponent, ViewTrackerComponent, ThemedItemAlertsComponent, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class FullItemPageComponent extends ItemPageComponent implements OnInit, OnDestroy { diff --git a/src/app/item-page/full/themed-full-item-page.component.ts b/src/app/item-page/full/themed-full-item-page.component.ts index d7103bc76b..f29947b075 100644 --- a/src/app/item-page/full/themed-full-item-page.component.ts +++ b/src/app/item-page/full/themed-full-item-page.component.ts @@ -7,10 +7,10 @@ import { FullItemPageComponent } from './full-item-page.component'; * Themed wrapper for FullItemPageComponent */ @Component({ - selector: 'ds-themed-full-item-page', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-full-item-page', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedFullItemPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/item-page/item-page-routes.ts b/src/app/item-page/item-page-routes.ts index b74236a516..01aad3fd65 100644 --- a/src/app/item-page/item-page-routes.ts +++ b/src/app/item-page/item-page-routes.ts @@ -1,25 +1,28 @@ import { Route } from '@angular/router'; -import { ItemPageResolver } from './item-page.resolver'; -import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { ItemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver'; -import { VersionResolver } from './version-page/version.resolver'; -import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; -import { LinkService } from '../core/cache/builders/link.service'; -import { UploadBitstreamComponent } from './bitstreams/upload/upload-bitstream.component'; -import { ITEM_EDIT_PATH, ORCID_PATH, UPLOAD_BITSTREAM_PATH } from './item-page-routing-paths'; -import { ItemPageAdministratorGuard } from './item-page-administrator.guard'; -import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; -import { ThemedItemPageComponent } from './simple/themed-item-page.component'; -import { ThemedFullItemPageComponent } from './full/themed-full-item-page.component'; -import { MenuItemType } from '../shared/menu/menu-item-type.model'; -import { VersionPageComponent } from './version-page/version-page/version-page.component'; -import { - BitstreamRequestACopyPageComponent -} from './bitstreams/request-a-copy/bitstream-request-a-copy-page.component'; + import { REQUEST_COPY_MODULE_PATH } from '../app-routing-paths'; +import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; +import { ItemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver'; +import { LinkService } from '../core/cache/builders/link.service'; +import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model'; +import { MenuItemType } from '../shared/menu/menu-item-type.model'; +import { BitstreamRequestACopyPageComponent } from './bitstreams/request-a-copy/bitstream-request-a-copy-page.component'; +import { UploadBitstreamComponent } from './bitstreams/upload/upload-bitstream.component'; +import { ThemedFullItemPageComponent } from './full/themed-full-item-page.component'; +import { ItemPageResolver } from './item-page.resolver'; +import { ItemPageAdministratorGuard } from './item-page-administrator.guard'; +import { + ITEM_EDIT_PATH, + ORCID_PATH, + UPLOAD_BITSTREAM_PATH, +} from './item-page-routing-paths'; import { OrcidPageComponent } from './orcid-page/orcid-page.component'; import { OrcidPageGuard } from './orcid-page/orcid-page.guard'; -import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver'; +import { ThemedItemPageComponent } from './simple/themed-item-page.component'; +import { VersionResolver } from './version-page/version.resolver'; +import { VersionPageComponent } from './version-page/version-page/version-page.component'; export const ROUTES: Route[] = [ { @@ -27,7 +30,7 @@ export const ROUTES: Route[] = [ resolve: { dso: ItemPageResolver, breadcrumb: ItemBreadcrumbResolver, - menu: DSOEditMenuResolver + menu: DSOEditMenuResolver, }, providers: [ ItemPageResolver, @@ -36,7 +39,7 @@ export const ROUTES: Route[] = [ LinkService, ItemPageAdministratorGuard, VersionResolver, - OrcidPageGuard + OrcidPageGuard, ], runGuardsAndResolvers: 'always', children: [ @@ -57,7 +60,7 @@ export const ROUTES: Route[] = [ { path: UPLOAD_BITSTREAM_PATH, component: UploadBitstreamComponent, - canActivate: [AuthenticatedGuard] + canActivate: [AuthenticatedGuard], }, { path: REQUEST_COPY_MODULE_PATH, @@ -66,8 +69,8 @@ export const ROUTES: Route[] = [ { path: ORCID_PATH, component: OrcidPageComponent, - canActivate: [AuthenticatedGuard, OrcidPageGuard] - } + canActivate: [AuthenticatedGuard, OrcidPageGuard], + }, ], data: { menu: { @@ -94,7 +97,7 @@ export const ROUTES: Route[] = [ resolve: { dso: VersionResolver, }, - } + }, ], providers: [ ItemPageResolver, @@ -103,7 +106,7 @@ export const ROUTES: Route[] = [ LinkService, ItemPageAdministratorGuard, VersionResolver, - OrcidPageGuard - ] - } + OrcidPageGuard, + ], + }, ]; diff --git a/src/app/item-page/item-page.module.ts b/src/app/item-page/item-page.module.ts index 67b8ffbae3..5ac36f1877 100644 --- a/src/app/item-page/item-page.module.ts +++ b/src/app/item-page/item-page.module.ts @@ -3,41 +3,19 @@ import { NgModule } from '@angular/core'; import { NgxGalleryModule } from '@kolkov/ngx-gallery'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; - -import { ItemPageComponent } from './simple/item-page.component'; -import { MetadataUriValuesComponent } from './field-components/metadata-uri-values/metadata-uri-values.component'; -import { - ItemPageAuthorFieldComponent -} from './simple/field-components/specific-field/author/item-page-author-field.component'; -import { - ItemPageDateFieldComponent -} from './simple/field-components/specific-field/date/item-page-date-field.component'; -import { - ItemPageAbstractFieldComponent -} from './simple/field-components/specific-field/abstract/item-page-abstract-field.component'; -import { ItemPageUriFieldComponent } from './simple/field-components/specific-field/uri/item-page-uri-field.component'; -import { ItemPageFieldComponent } from './simple/field-components/specific-field/item-page-field.component'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; import { UploadModule } from '../shared/upload/upload.module'; import { StatisticsModule } from '../statistics/statistics.module'; import { ItemAlertsComponent } from './alerts/item-alerts.component'; import { ThemedItemAlertsComponent } from './alerts/themed-item-alerts.component'; -import { - BitstreamRequestACopyPageComponent -} from './bitstreams/request-a-copy/bitstream-request-a-copy-page.component'; +import { BitstreamRequestACopyPageComponent } from './bitstreams/request-a-copy/bitstream-request-a-copy-page.component'; import { UploadBitstreamComponent } from './bitstreams/upload/upload-bitstream.component'; import { EditItemPageModule } from './edit-item-page/edit-item-page.module'; import { CollectionsComponent } from './field-components/collections/collections.component'; +import { MetadataUriValuesComponent } from './field-components/metadata-uri-values/metadata-uri-values.component'; import { FullFileSectionComponent } from './full/field-components/file-section/full-file-section.component'; -import { - ThemedFullFileSectionComponent -} from './full/field-components/file-section/themed-full-file-section.component'; +import { ThemedFullFileSectionComponent } from './full/field-components/file-section/themed-full-file-section.component'; import { FullItemPageComponent } from './full/full-item-page.component'; -import { ItemComponent } from './simple/item-types/shared/item.component'; -import { - AbstractIncrementalListComponent -} from './simple/abstract-incremental-list/abstract-incremental-list.component'; -import { ThemedItemPageComponent } from './simple/themed-item-page.component'; import { ThemedFullItemPageComponent } from './full/themed-full-item-page.component'; import { ItemSharedModule } from './item-shared.module'; import { MediaViewerComponent } from './media-viewer/media-viewer.component'; @@ -51,17 +29,22 @@ import { OrcidAuthComponent } from './orcid-page/orcid-auth/orcid-auth.component import { OrcidPageComponent } from './orcid-page/orcid-page.component'; import { OrcidQueueComponent } from './orcid-page/orcid-queue/orcid-queue.component'; import { OrcidSyncSettingsComponent } from './orcid-page/orcid-sync-settings/orcid-sync-settings.component'; -import { ItemVersionsModule } from './versions/item-versions.module'; +import { AbstractIncrementalListComponent } from './simple/abstract-incremental-list/abstract-incremental-list.component'; import { FileSectionComponent } from './simple/field-components/file-section/file-section.component'; import { ThemedFileSectionComponent } from './simple/field-components/file-section/themed-file-section.component'; -import { - NotifyRequestsStatusComponent -} from './simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component'; -import { - RequestStatusAlertBoxComponent -} from './simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component'; +import { ItemPageAbstractFieldComponent } from './simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageAuthorFieldComponent } from './simple/field-components/specific-field/author/item-page-author-field.component'; +import { ItemPageDateFieldComponent } from './simple/field-components/specific-field/date/item-page-date-field.component'; +import { ItemPageFieldComponent } from './simple/field-components/specific-field/item-page-field.component'; +import { ItemPageUriFieldComponent } from './simple/field-components/specific-field/uri/item-page-uri-field.component'; +import { ItemPageComponent } from './simple/item-page.component'; +import { ItemComponent } from './simple/item-types/shared/item.component'; +import { NotifyRequestsStatusComponent } from './simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component'; +import { RequestStatusAlertBoxComponent } from './simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component'; import { QaEventNotificationComponent } from './simple/qa-event-notification/qa-event-notification.component'; +import { ThemedItemPageComponent } from './simple/themed-item-page.component'; import { VersionPageComponent } from './version-page/version-page/version-page.component'; +import { ItemVersionsModule } from './versions/item-versions.module'; const DECLARATIONS = [ @@ -104,7 +87,7 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ + imports: [ CommonModule, EditItemPageModule, ItemVersionsModule, @@ -114,10 +97,10 @@ const DECLARATIONS = [ NgbAccordionModule, UploadModule, DsoPageModule, - ...DECLARATIONS -], - exports: [ - ...DECLARATIONS, + ...DECLARATIONS, + ], + exports: [ + ...DECLARATIONS, ], }) export class ItemPageModule { diff --git a/src/app/item-page/item-shared.module.ts b/src/app/item-page/item-shared.module.ts index 29822130e2..28c4f99246 100644 --- a/src/app/item-page/item-shared.module.ts +++ b/src/app/item-page/item-shared.module.ts @@ -1,38 +1,24 @@ -import { CommonModule, NgOptimizedImage, } from '@angular/common'; +import { + CommonModule, + NgOptimizedImage, +} from '@angular/common'; import { NgModule } from '@angular/core'; import { DYNAMIC_FORM_CONTROL_MAP_FN } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; -import { - ItemWithdrawnReinstateModalComponent -} from '../shared/correction-suggestion/withdrawn-reinstate-modal.component'; -import { SearchModule } from '../shared/search/search.module'; -import { - TabbedRelatedEntitiesSearchComponent -} from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { - ItemVersionsDeleteModalComponent -} from './versions/item-versions-delete-modal/item-versions-delete-modal.component'; -import { - ItemVersionsSummaryModalComponent -} from './versions/item-versions-summary-modal/item-versions-summary-modal.component'; -import { MetadataValuesComponent } from './field-components/metadata-values/metadata-values.component'; -import { - GenericItemPageFieldComponent -} from './simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { ItemPageImgFieldComponent } from './simple/field-components/specific-field/img/item-page-img-field.component'; -import { - MetadataRepresentationListComponent -} from './simple/metadata-representation-list/metadata-representation-list.component'; -import { - ThemedMetadataRepresentationListComponent -} from './simple/metadata-representation-list/themed-metadata-representation-list.component'; -import { - RelatedEntitiesSearchComponent -} from './simple/related-entities/related-entities-search/related-entities-search.component'; -import { RelatedItemsComponent } from './simple/related-items/related-items-component'; - +import { ItemWithdrawnReinstateModalComponent } from '../shared/correction-suggestion/withdrawn-reinstate-modal.component'; import { dsDynamicFormControlMapFn } from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; +import { SearchModule } from '../shared/search/search.module'; +import { MetadataValuesComponent } from './field-components/metadata-values/metadata-values.component'; +import { GenericItemPageFieldComponent } from './simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ItemPageImgFieldComponent } from './simple/field-components/specific-field/img/item-page-img-field.component'; +import { MetadataRepresentationListComponent } from './simple/metadata-representation-list/metadata-representation-list.component'; +import { ThemedMetadataRepresentationListComponent } from './simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { RelatedEntitiesSearchComponent } from './simple/related-entities/related-entities-search/related-entities-search.component'; +import { TabbedRelatedEntitiesSearchComponent } from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { RelatedItemsComponent } from './simple/related-items/related-items-component'; +import { ItemVersionsDeleteModalComponent } from './versions/item-versions-delete-modal/item-versions-delete-modal.component'; +import { ItemVersionsSummaryModalComponent } from './versions/item-versions-summary-modal/item-versions-summary-modal.component'; const ENTRY_COMPONENTS = [ ItemVersionsDeleteModalComponent, @@ -59,7 +45,7 @@ const COMPONENTS = [ SearchModule, TranslateModule, NgOptimizedImage, - ...COMPONENTS + ...COMPONENTS, ], exports: [ ...COMPONENTS, diff --git a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts index 6e4082cef2..f5f031903a 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.spec.ts @@ -60,12 +60,12 @@ describe('MediaViewerImageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [MediaViewerImageComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + imports: [MediaViewerImageComponent], + schemas: [NO_ERRORS_SCHEMA], + providers: [ { provide: AuthService, useValue: authService }, - ] -}).compileComponents(); + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts index 0b808552e2..4523068118 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts @@ -1,10 +1,20 @@ -import { Component, Input, OnChanges, OnInit } from '@angular/core'; -import { NgxGalleryAnimation, NgxGalleryImage, NgxGalleryModule, NgxGalleryOptions } from '@kolkov/ngx-gallery'; -import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + Input, + OnChanges, + OnInit, +} from '@angular/core'; +import { + NgxGalleryAnimation, + NgxGalleryImage, + NgxGalleryModule, + NgxGalleryOptions, +} from '@kolkov/ngx-gallery'; import { Observable } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; -import { AsyncPipe } from '@angular/common'; +import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; /** * This componenet render an image gallery for the image viewer @@ -15,9 +25,9 @@ import { AsyncPipe } from '@angular/common'; styleUrls: ['./media-viewer-image.component.scss'], imports: [ NgxGalleryModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class MediaViewerImageComponent implements OnChanges, OnInit { @Input() images: MediaViewerItem[]; diff --git a/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts b/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts index d1b0437a98..84ffeaca5c 100644 --- a/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component.ts @@ -11,10 +11,10 @@ import { MediaViewerImageComponent } from './media-viewer-image.component'; * Themed wrapper for {@link MediaViewerImageComponent}. */ @Component({ - selector: 'ds-themed-media-viewer-image', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-media-viewer-image', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedMediaViewerImageComponent extends ThemedComponent { diff --git a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts index 4b6e0d6d3e..19b86d7448 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.spec.ts @@ -27,21 +27,21 @@ describe('MediaViewerVideoComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), BrowserAnimationsModule, MediaViewerVideoComponent, VarDirective, FileSizePipe, - MetadataFieldWrapperComponent - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + MetadataFieldWrapperComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); const mockBitstream: Bitstream = Object.assign(new Bitstream(), { diff --git a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts index 79e9219171..7523e0109f 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts @@ -1,11 +1,14 @@ +import { + NgForOf, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; -import { Bitstream } from 'src/app/core/shared/bitstream.model'; -import { NgForOf, NgIf } from '@angular/common'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { Bitstream } from 'src/app/core/shared/bitstream.model'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; @@ -23,9 +26,9 @@ import { languageHelper } from './language-helper'; NgForOf, NgbDropdownModule, TranslateModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MediaViewerVideoComponent { @Input() medias: MediaViewerItem[]; diff --git a/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts b/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts index 9edb43a5a7..797780d3b8 100644 --- a/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts +++ b/src/app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component.ts @@ -12,10 +12,10 @@ import { MediaViewerVideoComponent } from './media-viewer-video.component'; * Themed wrapper for {@link MediaViewerVideoComponent}. */ @Component({ - selector: 'ds-themed-media-viewer-video', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-media-viewer-video', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedMediaViewerVideoComponent extends ThemedComponent { diff --git a/src/app/item-page/media-viewer/media-viewer.component.spec.ts b/src/app/item-page/media-viewer/media-viewer.component.spec.ts index 326ecc4679..4d02307452 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.spec.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.spec.ts @@ -1,23 +1,30 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { AuthService } from '../../core/auth/auth.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { Bitstream } from '../../core/shared/bitstream.model'; import { MediaViewerItem } from '../../core/shared/media-viewer-item.model'; import { MetadataFieldWrapperComponent } from '../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; import { MockBitstreamFormat1 } from '../../shared/mocks/item.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { createPaginatedList } from '../../shared/testing/utils.test'; -import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../core/auth/auth.service'; -import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; +import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { VarDirective } from '../../shared/utils/var.directive'; import { MediaViewerComponent } from './media-viewer.component'; @@ -67,26 +74,26 @@ describe('MediaViewerComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), BrowserAnimationsModule, MediaViewerComponent, VarDirective, FileSizePipe, - MetadataFieldWrapperComponent - ], - providers: [ + MetadataFieldWrapperComponent, + ], + providers: [ { provide: BitstreamDataService, useValue: bitstreamDataService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/item-page/media-viewer/media-viewer.component.ts b/src/app/item-page/media-viewer/media-viewer.component.ts index 033e0a2d1c..60c88ce64a 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.ts @@ -1,6 +1,25 @@ -import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { BehaviorSubject, Observable, Subscription, } from 'rxjs'; -import { filter, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + Subscription, +} from 'rxjs'; +import { Subscription } from 'rxjs/internal/Subscription'; +import { + filter, + take, +} from 'rxjs/operators'; import { MediaViewerConfig } from '../../../config/media-viewer-config.interface'; import { environment } from '../../../environments/environment'; @@ -13,15 +32,12 @@ import { Item } from '../../core/shared/item.model'; import { MediaViewerItem } from '../../core/shared/media-viewer-item.model'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { hasValue } from '../../shared/empty.util'; -import { followLink } from '../../shared/utils/follow-link-config.model'; -import { Subscription } from 'rxjs/internal/Subscription'; -import { ThemedMediaViewerImageComponent } from './media-viewer-image/themed-media-viewer-image.component'; -import { ThumbnailComponent } from '../../thumbnail/thumbnail.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedMediaViewerVideoComponent } from './media-viewer-video/themed-media-viewer-video.component'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { followLink } from '../../shared/utils/follow-link-config.model'; import { VarDirective } from '../../shared/utils/var.directive'; +import { ThumbnailComponent } from '../../thumbnail/thumbnail.component'; +import { ThemedMediaViewerImageComponent } from './media-viewer-image/themed-media-viewer-image.component'; +import { ThemedMediaViewerVideoComponent } from './media-viewer-video/themed-media-viewer-video.component'; /** * This component renders the media viewers @@ -38,9 +54,9 @@ import { VarDirective } from '../../shared/utils/var.directive'; ThemedMediaViewerVideoComponent, TranslateModule, ThemedLoadingComponent, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class MediaViewerComponent implements OnDestroy, OnInit { @Input() item: Item; diff --git a/src/app/item-page/media-viewer/themed-media-viewer.component.ts b/src/app/item-page/media-viewer/themed-media-viewer.component.ts index e818cbd90c..da790fbd4a 100644 --- a/src/app/item-page/media-viewer/themed-media-viewer.component.ts +++ b/src/app/item-page/media-viewer/themed-media-viewer.component.ts @@ -12,10 +12,10 @@ import { MediaViewerComponent } from './media-viewer.component'; * Themed wrapper for {@link MediaViewerComponent}. */ @Component({ - selector: 'ds-themed-media-viewer', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-media-viewer', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedMediaViewerComponent extends ThemedComponent { diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts index 3899540634..3175773bc1 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts @@ -46,19 +46,19 @@ describe('MiradorViewerComponent with search', () => { beforeEach(waitForAsync(() => { viewerService.showEmbeddedViewer.and.returnValue(true); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), MiradorViewerComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), MiradorViewerComponent], + providers: [ { provide: BitstreamDataService, useValue: {} }, { provide: BundleDataService, useValue: {} }, { provide: HostWindowService, useValue: mockHostWindowService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MiradorViewerComponent, { + }).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService }, @@ -108,19 +108,19 @@ describe('MiradorViewerComponent with multiple images', () => { viewerService.showEmbeddedViewer.and.returnValue(true); viewerService.getImageCount.and.returnValue(observableOf(2)); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), MiradorViewerComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), MiradorViewerComponent], + providers: [ { provide: BitstreamDataService, useValue: {} }, { provide: BundleDataService, useValue: {} }, { provide: HostWindowService, useValue: mockHostWindowService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MiradorViewerComponent, { + }).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService }, @@ -167,19 +167,19 @@ describe('MiradorViewerComponent with a single image', () => { viewerService.showEmbeddedViewer.and.returnValue(true); viewerService.getImageCount.and.returnValue(observableOf(1)); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), MiradorViewerComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), MiradorViewerComponent], + providers: [ { provide: BitstreamDataService, useValue: {} }, { provide: BundleDataService, useValue: {} }, { provide: HostWindowService, useValue: mockHostWindowService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MiradorViewerComponent, { + }).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService }, @@ -219,17 +219,17 @@ describe('MiradorViewerComponent in development mode', () => { viewerService.showEmbeddedViewer.and.returnValue(false); viewerService.getImageCount.and.returnValue(observableOf(1)); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), MiradorViewerComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), MiradorViewerComponent], + providers: [ { provide: BitstreamDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MiradorViewerComponent, { + }).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService }, diff --git a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts index f12abdbdf8..3d375492f5 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts @@ -1,16 +1,39 @@ -import { AsyncPipe, isPlatformBrowser, NgIf } from '@angular/common'; -import { ChangeDetectionStrategy, Component, Inject, Input, OnInit, PLATFORM_ID, } from '@angular/core'; -import { DomSanitizer, SafeResourceUrl, } from '@angular/platform-browser'; -import { Observable, of, } from 'rxjs'; -import { map, take, } from 'rxjs/operators'; +import { + AsyncPipe, + isPlatformBrowser, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, + Input, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + DomSanitizer, + SafeResourceUrl, +} from '@angular/platform-browser'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of, +} from 'rxjs'; +import { + map, + take, +} from 'rxjs/operators'; import { environment } from '../../../environments/environment'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { BundleDataService } from '../../core/data/bundle-data.service'; import { Item } from '../../core/shared/item.model'; -import { HostWindowService, WidthCategory, } from '../../shared/host-window.service'; +import { + HostWindowService, + WidthCategory, +} from '../../shared/host-window.service'; import { MiradorViewerService } from './mirador-viewer.service'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-mirador-viewer', @@ -21,9 +44,9 @@ import { TranslateModule } from '@ngx-translate/core'; imports: [ TranslateModule, AsyncPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MiradorViewerComponent implements OnInit { diff --git a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.spec.ts b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.spec.ts index 25b121cc1c..caaf3ff5ba 100644 --- a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.spec.ts @@ -9,6 +9,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; import { @@ -33,7 +34,6 @@ import { import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { OrcidAuthComponent } from './orcid-auth.component'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('OrcidAuthComponent test suite', () => { let comp: OrcidAuthComponent; @@ -137,25 +137,25 @@ describe('OrcidAuthComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule.withRoutes([]), OrcidAuthComponent, - NoopAnimationsModule - ], - providers: [ + NoopAnimationsModule, + ], + providers: [ { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: OrcidAuthService, useValue: orcidAuthService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrcidAuthComponent, { + }).overrideComponent(OrcidAuthComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/orcid-page/orcid-page.component.spec.ts b/src/app/item-page/orcid-page/orcid-page.component.spec.ts index 1cdf0c9081..fafb08ee3e 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-page.component.spec.ts @@ -1,35 +1,49 @@ -import { NO_ERRORS_SCHEMA, PLATFORM_ID, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + NO_ERRORS_SCHEMA, + PLATFORM_ID, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; -import { of, of as observableOf } from 'rxjs'; +import { + of as observableOf, + of, +} from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../../core/auth/auth.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { OrcidAuthService } from '../../core/orcid/orcid-auth.service'; +import { OrcidHistoryDataService } from '../../core/orcid/orcid-history-data.service'; +import { OrcidQueueDataService } from '../../core/orcid/orcid-queue-data.service'; +import { PaginationService } from '../../core/pagination/pagination.service'; import { ResearcherProfile } from '../../core/profile/model/researcher-profile.model'; +import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service'; import { Item } from '../../core/shared/item.model'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; +import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; import { createPaginatedList } from '../../shared/testing/utils.test'; import { OrcidPageComponent } from './orcid-page.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service'; -import { OrcidQueueDataService } from '../../core/orcid/orcid-queue-data.service'; -import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; -import { PaginationService } from '../../core/pagination/pagination.service'; -import { OrcidHistoryDataService } from '../../core/orcid/orcid-history-data.service'; describe('OrcidPageComponent test suite', () => { let comp: OrcidPageComponent; @@ -125,18 +139,18 @@ describe('OrcidPageComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule.withRoutes([]), OrcidPageComponent, NoopAnimationsModule, - ], - providers: [ + ], + providers: [ { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: ActivatedRoute, useValue: routeStub }, { provide: OrcidAuthService, useValue: orcidAuthService }, @@ -147,9 +161,9 @@ describe('OrcidPageComponent test suite', () => { { provide: PaginationService, useValue: new PaginationServiceStub() }, { provide: ItemDataService, useValue: itemDataService }, { provide: PLATFORM_ID, useValue: 'browser' }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(waitForAsync(() => { diff --git a/src/app/item-page/orcid-page/orcid-page.component.ts b/src/app/item-page/orcid-page/orcid-page.component.ts index d727640a60..1277d0d341 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.ts +++ b/src/app/item-page/orcid-page/orcid-page.component.ts @@ -1,26 +1,48 @@ -import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, ParamMap, Router, RouterLink } from '@angular/router'; -import { CommonModule, isPlatformBrowser } from '@angular/common'; -import { BehaviorSubject, combineLatest, } from 'rxjs'; -import { map, take, } from 'rxjs/operators'; +import { + CommonModule, + isPlatformBrowser, +} from '@angular/common'; +import { + Component, + Inject, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + ActivatedRoute, + ParamMap, + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, +} from 'rxjs'; +import { + map, + take, +} from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { OrcidAuthService } from '../../core/orcid/orcid-auth.service'; import { ResearcherProfile } from '../../core/profile/model/researcher-profile.model'; -import { LoadingComponent } from '../../shared/loading/loading.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { OrcidAuthComponent } from './orcid-auth/orcid-auth.component'; -import { OrcidSyncSettingsComponent } from './orcid-sync-settings/orcid-sync-settings.component'; -import { OrcidQueueComponent } from './orcid-queue/orcid-queue.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AlertType } from '../../shared/alert/alert-type'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; import { Item } from '../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../core/shared/operators'; +import { AlertComponent } from '../../shared/alert/alert.component'; +import { AlertType } from '../../shared/alert/alert-type'; import { isNotEmpty } from '../../shared/empty.util'; +import { LoadingComponent } from '../../shared/loading/loading.component'; import { getItemPageRoute } from '../item-page-routing-paths'; +import { OrcidAuthComponent } from './orcid-auth/orcid-auth.component'; +import { OrcidQueueComponent } from './orcid-queue/orcid-queue.component'; +import { OrcidSyncSettingsComponent } from './orcid-sync-settings/orcid-sync-settings.component'; /** * A component that represents the orcid settings page @@ -37,9 +59,9 @@ import { getItemPageRoute } from '../item-page-routing-paths'; OrcidSyncSettingsComponent, OrcidQueueComponent, TranslateModule, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) export class OrcidPageComponent implements OnInit { protected readonly AlertType = AlertType; diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts index e9e5706b3e..a32c7ef7a5 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts @@ -1,8 +1,18 @@ -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { OrcidQueue } from '../../../core/orcid/model/orcid-queue.model'; @@ -13,12 +23,12 @@ import { PaginationService } from '../../../core/pagination/pagination.service'; import { Item } from '../../../core/shared/item.model'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { OrcidQueueComponent } from './orcid-queue.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; describe('OrcidQueueComponent test suite', () => { let component: OrcidQueueComponent; @@ -110,31 +120,31 @@ describe('OrcidQueueComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule.withRoutes([]), - OrcidQueueComponent - ], - providers: [ + OrcidQueueComponent, + ], + providers: [ { provide: OrcidAuthService, useValue: orcidAuthService }, { provide: OrcidQueueDataService, useValue: orcidQueueServiceSpy }, { provide: OrcidHistoryDataService, useValue: {} }, { provide: PaginationService, useValue: new PaginationServiceStub() }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(OrcidQueueComponent, { - remove: { - imports: [PaginationComponent] - } -}) -.compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(OrcidQueueComponent, { + remove: { + imports: [PaginationComponent], + }, + }) + .compileComponents(); orcidQueueService = TestBed.inject(OrcidQueueDataService); })); diff --git a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts index 1c8ac8a71d..c783e592c6 100644 --- a/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts +++ b/src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts @@ -1,7 +1,28 @@ -import { Component, Input, OnDestroy, OnInit, SimpleChanges, } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, combineLatest, Observable, Subscription, } from 'rxjs'; -import { debounceTime, distinctUntilChanged, switchMap, tap, } from 'rxjs/operators'; +import { CommonModule } from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, + SimpleChanges, +} from '@angular/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, + Observable, + Subscription, +} from 'rxjs'; +import { + debounceTime, + distinctUntilChanged, + switchMap, + tap, +} from 'rxjs/operators'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; @@ -13,15 +34,13 @@ import { OrcidQueueDataService } from '../../../core/orcid/orcid-queue-data.serv import { PaginationService } from '../../../core/pagination/pagination.service'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; import { hasValue } from '../../../shared/empty.util'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { CommonModule } from '@angular/common'; import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; +import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; @Component({ selector: 'ds-orcid-queue', @@ -35,7 +54,7 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo AlertComponent, PaginationComponent, ], - standalone: true + standalone: true, }) export class OrcidQueueComponent implements OnInit, OnDestroy { diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts index 704c3da06b..a64feb0ae1 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts @@ -1,10 +1,26 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, + UntypedFormGroup, +} from '@angular/forms'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; import { getTestScheduler } from 'jasmine-marbles'; import { TestScheduler } from 'rxjs/testing'; @@ -14,11 +30,13 @@ import { ResearcherProfileDataService } from '../../../core/profile/researcher-p import { Item } from '../../../core/shared/item.model'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../shared/remote-data.utils'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { OrcidSyncSettingsComponent } from './orcid-sync-settings.component'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('OrcidSyncSettingsComponent test suite', () => { let comp: OrcidSyncSettingsComponent; @@ -134,26 +152,26 @@ describe('OrcidSyncSettingsComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, NgbAccordionModule, ReactiveFormsModule, NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule.withRoutes([]), - OrcidSyncSettingsComponent - ], - providers: [ + OrcidSyncSettingsComponent, + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: ResearcherProfileDataService, useValue: researcherProfileService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(OrcidSyncSettingsComponent, { + }).overrideComponent(OrcidSyncSettingsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts index b182cfec5a..424baf45fb 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts @@ -1,6 +1,19 @@ -import { Component, EventEmitter, Input, OnInit, Output, } from '@angular/core'; -import { FormsModule, UntypedFormGroup } from '@angular/forms'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { NgForOf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; +import { + FormsModule, + UntypedFormGroup, +} from '@angular/forms'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; import { of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -10,10 +23,9 @@ import { ResearcherProfile } from '../../../core/profile/model/researcher-profil import { ResearcherProfileDataService } from '../../../core/profile/researcher-profile-data.service'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; -import { NgForOf } from '@angular/common'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; @Component({ selector: 'ds-orcid-sync-setting', @@ -23,9 +35,9 @@ import { NgForOf } from '@angular/common'; AlertComponent, FormsModule, TranslateModule, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class OrcidSyncSettingsComponent implements OnInit { protected readonly AlertType = AlertType; diff --git a/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts b/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts index f9e330de41..08c2cbee71 100644 --- a/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts +++ b/src/app/item-page/simple/abstract-incremental-list/abstract-incremental-list.component.ts @@ -11,9 +11,9 @@ import { } from '../../../shared/empty.util'; @Component({ - selector: 'ds-abstract-incremental-list', - template: ``, - standalone: true + selector: 'ds-abstract-incremental-list', + template: ``, + standalone: true, }) /** * An abstract component for displaying an incremental list of objects diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts index 289fa632e7..91eb255afd 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts @@ -1,32 +1,40 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { ActivatedRoute } from '@angular/router'; +import { provideMockStore } from '@ngrx/store/testing'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { environment } from 'src/environments/environment'; +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, +} from '../../../../../config/app-config.interface'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { Bitstream } from '../../../../core/shared/bitstream.model'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { MockBitstreamFormat1 } from '../../../../shared/mocks/item.mock'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP } from '../../../../../config/app-config.interface'; import { createPaginatedList } from '../../../../shared/testing/utils.test'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { VarDirective } from '../../../../shared/utils/var.directive'; import { FileSectionComponent } from './file-section.component'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; -import { provideMockStore } from '@ngrx/store/testing'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; describe('FileSectionComponent', () => { let comp: FileSectionComponent; @@ -80,18 +88,18 @@ describe('FileSectionComponent', () => { { provide: APP_CONFIG, useValue: environment }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - provideMockStore() + provideMockStore(), ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) - .overrideComponent(FileSectionComponent, { - remove: { - imports: [ - MetadataFieldWrapperComponent - ] - } - }) - .compileComponents(); + .overrideComponent(FileSectionComponent, { + remove: { + imports: [ + MetadataFieldWrapperComponent, + ], + }, + }) + .compileComponents(); })); beforeEach(waitForAsync(() => { diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/app/item-page/simple/field-components/file-section/file-section.component.ts index fd36569fde..8a88989a05 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -1,7 +1,19 @@ -import { Component, Inject, Input, OnInit, } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; +import { + Component, + Inject, + Input, + OnInit, +} from '@angular/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; -import { APP_CONFIG, AppConfig, } from 'src/config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from 'src/config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; @@ -11,17 +23,12 @@ import { Bitstream } from '../../../../core/shared/bitstream.model'; import { Item } from '../../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { hasValue } from '../../../../shared/empty.util'; -import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../shared/file-download-link/themed-file-download-link.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { VarDirective } from '../../../../shared/utils/var.directive'; -import { CommonModule } from '@angular/common'; /** * This component renders the file section of the item @@ -39,7 +46,7 @@ import { CommonModule } from '@angular/common'; FileSizePipe, VarDirective, ], - standalone: true + standalone: true, }) export class FileSectionComponent implements OnInit { diff --git a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts index 54bef102eb..7a7229715d 100644 --- a/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts +++ b/src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts @@ -10,7 +10,7 @@ import { FileSectionComponent } from './file-section.component'; @Component({ selector: 'ds-themed-item-page-file-section', templateUrl: '../../../../shared/theme-support/themed.component.html', - standalone: true + standalone: true, }) export class ThemedFileSectionComponent extends ThemedComponent { diff --git a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts index d5f3e42b5d..979b79eafc 100644 --- a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts @@ -1,7 +1,18 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; + import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; import { BrowseDefinitionDataService } from '../../../../../core/browse/browse-definition-data.service'; @@ -15,21 +26,21 @@ let fixture: ComponentFixture; describe('ItemPageAbstractFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - ItemPageAbstractFieldComponent - ], - providers: [ + ItemPageAbstractFieldComponent, + ], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageAbstractFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageAbstractFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts index 4644f5553a..6a4ec85862 100644 --- a/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts @@ -1,12 +1,12 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; -import { ItemPageFieldComponent } from '../item-page-field.component'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; -import { AsyncPipe } from '@angular/common'; +import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ selector: 'ds-item-page-abstract-field', @@ -14,7 +14,7 @@ import { AsyncPipe } from '@angular/common'; standalone: true, imports: [ MetadataValuesComponent, - AsyncPipe + AsyncPipe, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts index 799e1df7a8..1f38317aca 100644 --- a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts @@ -7,6 +7,7 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -15,9 +16,8 @@ import { import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; import { BrowseDefinitionDataService } from '../../../../../core/browse/browse-definition-data.service'; -import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; -import { ActivatedRoute } from '@angular/router'; +import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; import { mockItemWithMetadataFieldsAndValue } from '../item-page-field.component.spec'; @@ -32,19 +32,19 @@ const mockValue = 'test value'; describe('ItemPageAuthorFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), ItemPageAuthorFieldComponent, MetadataValuesComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), ItemPageAuthorFieldComponent, MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageAuthorFieldComponent, { + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageAuthorFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts index f2e5002346..dfdb0ff389 100644 --- a/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts @@ -1,12 +1,12 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; -import { ItemPageFieldComponent } from '../item-page-field.component'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; -import { AsyncPipe } from '@angular/common'; +import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ selector: 'ds-item-page-author-field', @@ -14,7 +14,7 @@ import { AsyncPipe } from '@angular/common'; standalone: true, imports: [ MetadataValuesComponent, - AsyncPipe + AsyncPipe, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts index c0c1b0ce2d..23e4492602 100644 --- a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts @@ -7,6 +7,7 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -15,9 +16,8 @@ import { import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; import { BrowseDefinitionDataService } from '../../../../../core/browse/browse-definition-data.service'; -import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; import { mockItemWithMetadataFieldsAndValue } from '../item-page-field.component.spec'; diff --git a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts index 6dbbaa02d0..bdce65f085 100644 --- a/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts @@ -1,12 +1,12 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; -import { ItemPageFieldComponent } from '../item-page-field.component'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; -import { AsyncPipe } from '@angular/common'; +import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ selector: 'ds-item-page-date-field', @@ -14,7 +14,7 @@ import { AsyncPipe } from '@angular/common'; standalone: true, imports: [ MetadataValuesComponent, - AsyncPipe + AsyncPipe, ], }) /** diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts index 688a06b001..f46b8fb0f8 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts @@ -1,13 +1,23 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment'; import { BrowseDefinitionDataService } from '../../../../../core/browse/browse-definition-data.service'; -import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { BrowseDefinitionDataServiceStub } from '../../../../../shared/testing/browse-definition-data-service.stub'; import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; import { mockItemWithMetadataFieldsAndValue } from '../item-page-field.component.spec'; @@ -24,19 +34,19 @@ const mockFields = [mockField]; describe('GenericItemPageFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), GenericItemPageFieldComponent, MetadataValuesComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), GenericItemPageFieldComponent, MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(GenericItemPageFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(GenericItemPageFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts index 2e8881f565..52c07cca16 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts @@ -1,18 +1,18 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; -import { ItemPageFieldComponent } from '../item-page-field.component'; -import { AsyncPipe } from '@angular/common'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; +import { ItemPageFieldComponent } from '../item-page-field.component'; @Component({ - selector: 'ds-generic-item-page-field', - templateUrl: '../item-page-field.component.html', - standalone: true, - imports: [MetadataValuesComponent, AsyncPipe] + selector: 'ds-generic-item-page-field', + templateUrl: '../item-page-field.component.html', + standalone: true, + imports: [MetadataValuesComponent, AsyncPipe], }) /** * This component can be used to represent metadata on a simple item page. diff --git a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts index caaf0315d4..b9e690d278 100644 --- a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts @@ -40,18 +40,18 @@ describe('ItemPageImgFieldComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), GenericItemPageFieldComponent, MetadataValuesComponent, ItemPageImgFieldComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), GenericItemPageFieldComponent, MetadataValuesComponent, ItemPageImgFieldComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(GenericItemPageFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }) diff --git a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts index 1d3673050a..b578c3b23a 100644 --- a/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts @@ -1,9 +1,15 @@ -import { Component, Input } from '@angular/core'; -import { ImageField, ItemPageFieldComponent } from '../item-page-field.component'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; import { MetadataValuesComponent } from '../../../../field-components/metadata-values/metadata-values.component'; -import { AsyncPipe } from '@angular/common'; +import { + ImageField, + ItemPageFieldComponent, +} from '../item-page-field.component'; @Component({ selector: 'ds-item-page-img-field', @@ -11,8 +17,8 @@ import { AsyncPipe } from '@angular/common'; standalone: true, imports: [ MetadataValuesComponent, - AsyncPipe - ] + AsyncPipe, + ], }) /** * Component that renders an inline image for a given field. diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts index e331bc354b..3826539488 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts @@ -7,16 +7,28 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + By, + By, +} from '@angular/platform-browser'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment'; -import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; +import { + BrowseDefinitionDataService, + BrowseDefinitionDataService, +} from '../../../../core/browse/browse-definition-data.service'; import { Item } from '../../../../core/shared/item.model'; import { MetadataMap, @@ -24,15 +36,12 @@ import { } from '../../../../core/shared/metadata.models'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; -import { SharedModule } from '../../../../shared/shared.module'; -import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/browse-definition-data-service.stub'; +import { + BrowseDefinitionDataServiceStub, + BrowseDefinitionDataServiceStub, +} from '../../../../shared/testing/browse-definition-data-service.stub'; import { createPaginatedList } from '../../../../shared/testing/utils.test'; import { MarkdownPipe } from '../../../../shared/utils/markdown.pipe'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { By } from '@angular/platform-browser'; -import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; -import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/browse-definition-data-service.stub'; -import { RouterTestingModule } from '@angular/router/testing'; import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; import { ItemPageFieldComponent } from './item-page-field.component'; @@ -58,22 +67,22 @@ describe('ItemPageFieldComponent', () => { beforeEach(waitForAsync(() => { void TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - ItemPageFieldComponent, MetadataValuesComponent - ], - providers: [ + ItemPageFieldComponent, MetadataValuesComponent, + ], + providers: [ { provide: APP_CONFIG, useValue: appConfig }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); markdownSpy = spyOn(MarkdownPipe.prototype, 'transform'); diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index 867a3ec8ab..89d4be2459 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input, @@ -10,7 +11,6 @@ import { BrowseDefinition } from '../../../../core/shared/browse-definition.mode import { Item } from '../../../../core/shared/item.model'; import { getRemoteDataPayload } from '../../../../core/shared/operators'; import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; -import { AsyncPipe } from '@angular/common'; import { ImageField } from './image-field'; @@ -24,9 +24,9 @@ import { ImageField } from './image-field'; templateUrl: './item-page-field.component.html', imports: [ MetadataValuesComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class ItemPageFieldComponent { diff --git a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts index f0d7a52a84..d7953de28b 100644 --- a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts @@ -26,14 +26,14 @@ const mockValue = 'test value'; describe('ItemPageTitleFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), ItemPageTitleFieldComponent, MetadataValuesComponent], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageTitleFieldComponent, { + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), ItemPageTitleFieldComponent, MetadataValuesComponent], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageTitleFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts index 9d7dae4b6f..7923805462 100644 --- a/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts @@ -1,15 +1,18 @@ -import { Component, Input, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; import { Item } from '../../../../../core/shared/item.model'; @Component({ - selector: 'ds-item-page-title-field', - templateUrl: './item-page-title-field.component.html', - standalone: true, - imports: [NgIf, TranslateModule] + selector: 'ds-item-page-title-field', + templateUrl: './item-page-title-field.component.html', + standalone: true, + imports: [NgIf, TranslateModule], }) /** * This component is used for displaying the title (defined by the {@link DSONameService}) of an item diff --git a/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts index c6892d8ff9..8e4eb532fc 100644 --- a/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component.ts @@ -11,10 +11,10 @@ import { ItemPageTitleFieldComponent } from './item-page-title-field.component'; * Themed wrapper for {@link ItemPageTitleFieldComponent} */ @Component({ - selector: 'ds-themed-item-page-title-field', - styleUrls: [], - templateUrl: '../../../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-page-title-field', + styleUrls: [], + templateUrl: '../../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedItemPageTitleFieldComponent extends ThemedComponent { diff --git a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts index be3af72b9e..4b86504789 100644 --- a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts @@ -31,18 +31,18 @@ const mockLabel = 'test label'; describe('ItemPageUriFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), ItemPageUriFieldComponent, MetadataUriValuesComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), ItemPageUriFieldComponent, MetadataUriValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageUriFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageUriFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts index 7bbdfdbdc2..1385659baf 100644 --- a/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts @@ -4,18 +4,16 @@ import { } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; +import { MetadataUriValuesComponent } from '../../../../field-components/metadata-uri-values/metadata-uri-values.component'; import { ItemPageFieldComponent } from '../item-page-field.component'; -import { - MetadataUriValuesComponent -} from '../../../../field-components/metadata-uri-values/metadata-uri-values.component'; @Component({ selector: 'ds-item-page-uri-field', templateUrl: './item-page-uri-field.component.html', imports: [ - MetadataUriValuesComponent + MetadataUriValuesComponent, ], - standalone: true + standalone: true, }) /** * This component can be used to represent any uri on a simple item page. diff --git a/src/app/item-page/simple/item-page.component.spec.ts b/src/app/item-page/simple/item-page.component.spec.ts index 320c1c2df1..03b64d9549 100644 --- a/src/app/item-page/simple/item-page.component.spec.ts +++ b/src/app/item-page/simple/item-page.component.spec.ts @@ -1,9 +1,23 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, PLATFORM_ID, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, + PLATFORM_ID, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; @@ -13,10 +27,16 @@ import { ItemDataService } from '../../core/data/item-data.service'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { SignpostingLink } from '../../core/data/signposting-links.model'; import { MetadataService } from '../../core/metadata/metadata.service'; -import { LinkDefinition, LinkHeadService, } from '../../core/services/link-head.service'; +import { + LinkDefinition, + LinkHeadService, +} from '../../core/services/link-head.service'; import { ServerResponseService } from '../../core/services/server-response.service'; import { Item } from '../../core/shared/item.model'; +import { ErrorComponent } from '../../shared/error/error.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { createFailedRemoteDataObject$, createPendingRemoteDataObject$, @@ -25,16 +45,11 @@ import { } from '../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { createPaginatedList } from '../../shared/testing/utils.test'; -import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; -import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; -import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { ItemVersionsComponent } from '../versions/item-versions.component'; -import { ErrorComponent } from '../../shared/error/error.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { VarDirective } from '../../shared/utils/var.directive'; +import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; +import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; +import { ItemVersionsComponent } from '../versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; import { ItemPageComponent } from './item-page.component'; import { createRelationshipsObservable } from './item-types/shared/item.component.spec'; @@ -115,13 +130,13 @@ describe('ItemPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), BrowserAnimationsModule, ItemPageComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), BrowserAnimationsModule, ItemPageComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: mockRoute }, { provide: ItemDataService, useValue: {} }, { provide: MetadataService, useValue: mockMetadataService }, @@ -133,19 +148,19 @@ describe('ItemPageComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: NotifyInfoService, useValue: notifyInfoService }, { provide: PLATFORM_ID, useValue: 'server' }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemPageComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemPageComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ - ThemedItemAlertsComponent, - ItemVersionsNoticeComponent, - ViewTrackerComponent, - ListableObjectComponentLoaderComponent, - ItemVersionsComponent, - ErrorComponent, - ThemedLoadingComponent, - ]} + ThemedItemAlertsComponent, + ItemVersionsNoticeComponent, + ViewTrackerComponent, + ListableObjectComponentLoaderComponent, + ItemVersionsComponent, + ErrorComponent, + ThemedLoadingComponent, + ] }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/item-page.component.ts b/src/app/item-page/simple/item-page.component.ts index f609eca2fa..cb6da792a1 100644 --- a/src/app/item-page/simple/item-page.component.ts +++ b/src/app/item-page/simple/item-page.component.ts @@ -1,8 +1,31 @@ -import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AsyncPipe, isPlatformServer, NgIf } from '@angular/common'; -import { combineLatest, Observable, of, } from 'rxjs'; -import { map, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + isPlatformServer, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest, + Observable, + of, +} from 'rxjs'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { NotifyInfoService } from 'src/app/core/coar-notify/notify-info/notify-info.service'; import { AuthService } from '../../core/auth/auth.service'; @@ -12,7 +35,10 @@ import { ItemDataService } from '../../core/data/item-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { SignpostingLink } from '../../core/data/signposting-links.model'; -import { LinkDefinition, LinkHeadService, } from '../../core/services/link-head.service'; +import { + LinkDefinition, + LinkHeadService, +} from '../../core/services/link-head.service'; import { ServerResponseService } from '../../core/services/server-response.service'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; import { Item } from '../../core/shared/item.model'; @@ -20,21 +46,16 @@ import { getAllSucceededRemoteDataPayload } from '../../core/shared/operators'; import { ViewMode } from '../../core/shared/view-mode.model'; import { fadeInOut } from '../../shared/animations/fade'; import { isNotEmpty } from '../../shared/empty.util'; -import { getItemPageRoute } from '../item-page-routing-paths'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; -import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; -import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { ItemVersionsComponent } from '../versions/item-versions.component'; import { ErrorComponent } from '../../shared/error/error.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - NotifyRequestsStatusComponent -} from './notify-requests-status/notify-requests-status-component/notify-requests-status.component'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; +import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; +import { getItemPageRoute } from '../item-page-routing-paths'; +import { ItemVersionsComponent } from '../versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../versions/notice/item-versions-notice.component'; +import { NotifyRequestsStatusComponent } from './notify-requests-status/notify-requests-status-component/notify-requests-status.component'; import { QaEventNotificationComponent } from './qa-event-notification/qa-event-notification.component'; /** @@ -62,8 +83,8 @@ import { QaEventNotificationComponent } from './qa-event-notification/qa-event-n AsyncPipe, NgIf, NotifyRequestsStatusComponent, - QaEventNotificationComponent - ] + QaEventNotificationComponent, + ], }) export class ItemPageComponent implements OnInit, OnDestroy { diff --git a/src/app/item-page/simple/item-types/publication/publication.component.spec.ts b/src/app/item-page/simple/item-types/publication/publication.component.spec.ts index 74993694fb..22add3f10f 100644 --- a/src/app/item-page/simple/item-types/publication/publication.component.spec.ts +++ b/src/app/item-page/simple/item-types/publication/publication.component.spec.ts @@ -1,12 +1,29 @@ import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { Observable, of, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + Observable, + of, +} from 'rxjs'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment.test'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -27,6 +44,7 @@ import { MetadataMap } from '../../../../core/shared/metadata.models'; import { SearchService } from '../../../../core/shared/search/search.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; import { WorkspaceitemDataService } from '../../../../core/submission/workspaceitem-data.service'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; @@ -34,9 +52,7 @@ import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/brow import { createPaginatedList } from '../../../../shared/testing/utils.test'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; -import { - GenericItemPageFieldComponent -} from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; import { createRelationshipsObservable, getIIIFEnabled, @@ -44,9 +60,6 @@ import { mockRouteService, } from '../shared/item.component.spec'; import { PublicationComponent } from './publication.component'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment.test'; const noMetadata = new MetadataMap(); @@ -69,18 +82,18 @@ describe('PublicationComponent', () => { }, }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule, GenericItemPageFieldComponent, TruncatePipe, - PublicationComponent - ], - providers: [ + PublicationComponent, + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: RelationshipDataService, useValue: {} }, @@ -102,9 +115,9 @@ describe('PublicationComponent', () => { { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PublicationComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(PublicationComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }); })); diff --git a/src/app/item-page/simple/item-types/publication/publication.component.ts b/src/app/item-page/simple/item-types/publication/publication.component.ts index bc169fc476..2acb02377b 100644 --- a/src/app/item-page/simple/item-types/publication/publication.component.ts +++ b/src/app/item-page/simple/item-types/publication/publication.component.ts @@ -1,31 +1,32 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ItemComponent } from '../shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { CollectionsComponent } from '../../../field-components/collections/collections.component'; -import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; -import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; -import { RelatedItemsComponent } from '../../related-items/related-items-component'; -import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedMetadataRepresentationListComponent } from '../../metadata-representation-list/themed-metadata-representation-list.component'; -import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; -import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; -import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; -import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { NgIf, AsyncPipe } from '@angular/common'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { CollectionsComponent } from '../../../field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; +import { ThemedMetadataRepresentationListComponent } from '../../metadata-representation-list/themed-metadata-representation-list.component'; +import { RelatedItemsComponent } from '../../related-items/related-items-component'; +import { ItemComponent } from '../shared/item.component'; /** * Component that represents a publication Item page @@ -33,12 +34,12 @@ import { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('Publication', ViewMode.StandalonePage) @Component({ - selector: 'ds-publication', - styleUrls: ['./publication.component.scss'], - templateUrl: './publication.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-publication', + styleUrls: ['./publication.component.scss'], + templateUrl: './publication.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, RelatedItemsComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule], }) export class PublicationComponent extends ItemComponent { diff --git a/src/app/item-page/simple/item-types/shared/item.component.spec.ts b/src/app/item-page/simple/item-types/shared/item.component.spec.ts index 208b3920fd..0b60e2a1e6 100644 --- a/src/app/item-page/simple/item-types/shared/item.component.spec.ts +++ b/src/app/item-page/simple/item-types/shared/item.component.spec.ts @@ -1,13 +1,31 @@ +import { AsyncPipe } from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { provideMockStore } from '@ngrx/store/testing'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { AuthService } from '../../../../core/auth/auth.service'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -34,42 +52,30 @@ import { PageInfo } from '../../../../core/shared/page-info.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; import { WorkspaceitemDataService } from '../../../../core/submission/workspaceitem-data.service'; +import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { isNotEmpty } from '../../../../shared/empty.util'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; +import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { AuthServiceStub } from '../../../../shared/testing/auth-service.stub'; import { BrowseDefinitionDataServiceStub } from '../../../../shared/testing/browse-definition-data-service.stub'; +import { routeServiceStub } from '../../../../shared/testing/route-service.stub'; import { createPaginatedList } from '../../../../shared/testing/utils.test'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; -import { - GenericItemPageFieldComponent -} from '../../field-components/specific-field/generic/generic-item-page-field.component'; -import { ItemComponent } from './item.component'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { provideMockStore } from '@ngrx/store/testing'; -import { routeServiceStub } from '../../../../shared/testing/route-service.stub'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceStub } from '../../../../shared/testing/auth-service.stub'; -import { AsyncPipe } from '@angular/common'; -import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../shared/results-back-button/themed-results-back-button.component'; import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../field-components/specific-field/title/themed-item-page-field.component'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; +import { TabbedRelatedEntitiesSearchComponent } from '../../related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; import { RelatedItemsComponent } from '../../related-items/related-items-component'; - -import { compareArraysUsing, compareArraysUsingIds, } from './item-relationships-utils'; +import { ItemComponent } from './item.component'; +import { + compareArraysUsing, + compareArraysUsingIds, +} from './item-relationships-utils'; export function getIIIFSearchEnabled(enabled: boolean): MetadataValue { return Object.assign(new MetadataValue(), { @@ -100,7 +106,7 @@ export const mockRouteService = { }, getRouteParameterValue(): Observable { return observableOf(''); - } + }, }; /** @@ -132,56 +138,56 @@ export function getItemPageFieldsTest(mockItem: Item, component) { }); await TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot({ + imports: [ + TranslateModule.forRoot({ loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, + provide: TranslateLoader, + useClass: TranslateLoaderMock, }, - }), - RouterTestingModule, - GenericItemPageFieldComponent, - TruncatePipe, - AsyncPipe, - component - ], - providers: [ - { + }), + RouterTestingModule, + GenericItemPageFieldComponent, + TruncatePipe, + AsyncPipe, + component, + ], + providers: [ + { provide: APP_CONFIG, useValue: { - browseBy: { showThumbnails: true }, - markdown: { enabled: true }, + browseBy: { showThumbnails: true }, + markdown: { enabled: true }, }, - }, - provideMockStore(), - { provide: ItemDataService, useValue: {} }, - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: RelationshipDataService, useValue: relationshipService }, - { provide: ObjectCacheService, useValue: {} }, - { provide: UUIDService, useValue: {} }, - { provide: RemoteDataBuildService, useValue: {} }, - { provide: CommunityDataService, useValue: {} }, - { provide: HALEndpointService, useValue: {} }, - { provide: HttpClient, useValue: {} }, - { provide: DSOChangeAnalyzer, useValue: {} }, - { provide: VersionHistoryDataService, useValue: {} }, - { provide: VersionDataService, useValue: {} }, - { provide: NotificationsService, useValue: {} }, - { provide: DefaultChangeAnalyzer, useValue: {} }, - { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: WorkspaceitemDataService, useValue: {} }, - { provide: SearchService, useValue: {} }, - { provide: RouteService, useValue: routeServiceStub }, - { provide: AuthService, useValue: new AuthServiceStub() }, - { provide: AuthorizationDataService, useValue: authorizationService }, - { provide: ResearcherProfileDataService, useValue: {} }, - { + }, + provideMockStore(), + { provide: ItemDataService, useValue: {} }, + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: ObjectCacheService, useValue: {} }, + { provide: UUIDService, useValue: {} }, + { provide: RemoteDataBuildService, useValue: {} }, + { provide: CommunityDataService, useValue: {} }, + { provide: HALEndpointService, useValue: {} }, + { provide: HttpClient, useValue: {} }, + { provide: DSOChangeAnalyzer, useValue: {} }, + { provide: VersionHistoryDataService, useValue: {} }, + { provide: VersionDataService, useValue: {} }, + { provide: NotificationsService, useValue: {} }, + { provide: DefaultChangeAnalyzer, useValue: {} }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: WorkspaceitemDataService, useValue: {} }, + { provide: SearchService, useValue: {} }, + { provide: RouteService, useValue: routeServiceStub }, + { provide: AuthService, useValue: new AuthServiceStub() }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: ResearcherProfileDataService, useValue: {} }, + { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub, - }, - ], - schemas: [NO_ERRORS_SCHEMA] -}) + }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(component, { remove: { imports: [ @@ -191,7 +197,7 @@ export function getItemPageFieldsTest(mockItem: Item, component) { MetadataFieldWrapperComponent, ThemedThumbnailComponent, RelatedItemsComponent, - TabbedRelatedEntitiesSearchComponent + TabbedRelatedEntitiesSearchComponent, ], }, add: { changeDetection: ChangeDetectionStrategy.Default }, @@ -485,7 +491,7 @@ describe('ItemComponent', () => { }, }), RouterTestingModule, - ItemComponent, GenericItemPageFieldComponent, TruncatePipe + ItemComponent, GenericItemPageFieldComponent, TruncatePipe, ], providers: [ { provide: ItemDataService, useValue: {} }, diff --git a/src/app/item-page/simple/item-types/shared/item.component.ts b/src/app/item-page/simple/item-types/shared/item.component.ts index 760071ff7a..0d337b41df 100644 --- a/src/app/item-page/simple/item-types/shared/item.component.ts +++ b/src/app/item-page/simple/item-types/shared/item.component.ts @@ -21,9 +21,9 @@ import { } from './item-iiif-utils'; @Component({ - selector: 'ds-item', - template: '', - standalone: true + selector: 'ds-item', + template: '', + standalone: true, }) /** * A generic component for displaying metadata and relations of an item diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts index 650f4ea9b9..835cb0c8a1 100644 --- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts +++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts @@ -1,12 +1,29 @@ import { HttpClient } from '@angular/common/http'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; -import { Observable, of, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + Observable, + of, +} from 'rxjs'; +import { APP_CONFIG } from '../../../../../config/app-config.interface'; +import { environment } from '../../../../../environments/environment.test'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -27,6 +44,7 @@ import { MetadataMap } from '../../../../core/shared/metadata.models'; import { SearchService } from '../../../../core/shared/search/search.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; import { WorkspaceitemDataService } from '../../../../core/submission/workspaceitem-data.service'; +import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils'; @@ -35,9 +53,7 @@ import { createPaginatedList } from '../../../../shared/testing/utils.test'; import { TruncatableService } from '../../../../shared/truncatable/truncatable.service'; import { TruncatePipe } from '../../../../shared/utils/truncate.pipe'; import { ItemVersionsSharedService } from '../../../versions/item-versions-shared.service'; -import { - GenericItemPageFieldComponent -} from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; import { createRelationshipsObservable, getIIIFEnabled, @@ -45,9 +61,6 @@ import { mockRouteService, } from '../shared/item.component.spec'; import { UntypedItemComponent } from './untyped-item.component'; -import { mockTruncatableService } from '../../../../shared/mocks/mock-trucatable.service'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment.test'; const noMetadata = new MetadataMap(); @@ -70,18 +83,18 @@ describe('UntypedItemComponent', () => { }, }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule, GenericItemPageFieldComponent, TruncatePipe, - UntypedItemComponent - ], - providers: [ + UntypedItemComponent, + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: RelationshipDataService, useValue: {} }, @@ -105,9 +118,9 @@ describe('UntypedItemComponent', () => { { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(UntypedItemComponent, { + }).overrideComponent(UntypedItemComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }); })); diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index a5d9932776..74b4b50875 100644 --- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -1,31 +1,32 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ItemComponent } from '../shared/item.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { CollectionsComponent } from '../../../field-components/collections/collections.component'; -import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; -import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; -import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; -import { ThemedMetadataRepresentationListComponent } from '../../metadata-representation-list/themed-metadata-representation-list.component'; -import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; -import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; -import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { DsoEditMenuComponent } from '../../../../shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; -import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { MetadataFieldWrapperComponent } from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ThemedResultsBackButtonComponent } from '../../../../shared/results-back-button/themed-results-back-button.component'; -import { NgIf, AsyncPipe } from '@angular/common'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { CollectionsComponent } from '../../../field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; +import { ThemedMetadataRepresentationListComponent } from '../../metadata-representation-list/themed-metadata-representation-list.component'; +import { ItemComponent } from '../shared/item.component'; /** * Component that represents a publication Item page @@ -33,12 +34,12 @@ import { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent(Item, ViewMode.StandalonePage) @Component({ - selector: 'ds-untyped-item', - styleUrls: ['./untyped-item.component.scss'], - templateUrl: './untyped-item.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-untyped-item', + styleUrls: ['./untyped-item.component.scss'], + templateUrl: './untyped-item.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, ThemedResultsBackButtonComponent, MiradorViewerComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, ThemedMediaViewerComponent, ThemedFileSectionComponent, ItemPageDateFieldComponent, ThemedMetadataRepresentationListComponent, GenericItemPageFieldComponent, ItemPageAbstractFieldComponent, ItemPageUriFieldComponent, CollectionsComponent, RouterLink, AsyncPipe, TranslateModule], }) export class UntypedItemComponent extends ItemComponent { diff --git a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts index e9def51edc..4fa800c39d 100644 --- a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts +++ b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts @@ -1,5 +1,12 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -9,18 +16,12 @@ import { RelationshipDataService } from '../../../core/data/relationship-data.se import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Item } from '../../../core/shared/item.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; -import { - ItemMetadataRepresentation -} from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; -import { - MetadatumRepresentation -} from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; -import { BrowseDefinitionDataServiceStub } from '../../../shared/testing/browse-definition-data-service.stub'; -import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { - MetadataRepresentationLoaderComponent -} from '../../../shared/metadata-representation/metadata-representation-loader.component'; +import { ItemMetadataRepresentation } from '../../../core/shared/metadata-representation/item/item-metadata-representation.model'; +import { MetadatumRepresentation } from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { MetadataRepresentationLoaderComponent } from '../../../shared/metadata-representation/metadata-representation-loader.component'; +import { BrowseDefinitionDataServiceStub } from '../../../shared/testing/browse-definition-data-service.stub'; import { VarDirective } from '../../../shared/utils/var.directive'; import { MetadataRepresentationListComponent } from './metadata-representation-list.component'; @@ -113,15 +114,15 @@ describe('MetadataRepresentationListComponent', () => { }; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), MetadataRepresentationListComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), MetadataRepresentationListComponent, VarDirective], + providers: [ { provide: RelationshipDataService, useValue: relationshipService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MetadataRepresentationListComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, - remove: {imports: [MetadataFieldWrapperComponent, MetadataRepresentationLoaderComponent, ThemedLoadingComponent]} + }).overrideComponent(MetadataRepresentationListComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, + remove: { imports: [MetadataFieldWrapperComponent, MetadataRepresentationLoaderComponent, ThemedLoadingComponent] }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts index a42f3a3c71..1e268a1cc5 100644 --- a/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts +++ b/src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts @@ -1,32 +1,38 @@ -import { Component, Input, } from '@angular/core'; -import { Observable, zip as observableZip, } from 'rxjs'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + zip as observableZip, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { BrowseService } from '../../../core/browse/browse.service'; import { BrowseDefinitionDataService } from '../../../core/browse/browse-definition-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { - MetadataRepresentationLoaderComponent -} from '../../../shared/metadata-representation/metadata-representation-loader.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; -import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { Item } from '../../../core/shared/item.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { MetadataRepresentation } from '../../../core/shared/metadata-representation/metadata-representation.model'; -import { - MetadatumRepresentation -} from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; +import { MetadatumRepresentation } from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; import { getRemoteDataPayload } from '../../../core/shared/operators'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { MetadataRepresentationLoaderComponent } from '../../../shared/metadata-representation/metadata-representation-loader.component'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; @Component({ - selector: 'ds-metadata-representation-list', - templateUrl: './metadata-representation-list.component.html', - standalone: true, - imports: [MetadataFieldWrapperComponent, NgFor, VarDirective, MetadataRepresentationLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-metadata-representation-list', + templateUrl: './metadata-representation-list.component.html', + standalone: true, + imports: [MetadataFieldWrapperComponent, NgFor, VarDirective, MetadataRepresentationLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * This component is used for displaying metadata diff --git a/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts b/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts index 8587e5179b..d929a58f30 100644 --- a/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts +++ b/src/app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component.ts @@ -8,10 +8,10 @@ import { ThemedComponent } from '../../../shared/theme-support/themed.component' import { MetadataRepresentationListComponent } from './metadata-representation-list.component'; @Component({ - selector: 'ds-themed-metadata-representation-list', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-metadata-representation-list', + styleUrls: [], + templateUrl: '../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedMetadataRepresentationListComponent extends ThemedComponent { protected inAndOutputNames: (keyof MetadataRepresentationListComponent & keyof this)[] = ['parentItem', 'itemType', 'metadataFields', 'label', 'incrementBy']; diff --git a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.spec.ts b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.spec.ts index a0d76fcafa..e5c56b97af 100644 --- a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.spec.ts +++ b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.spec.ts @@ -27,11 +27,11 @@ describe('NotifyRequestsStatusComponent', () => { getNotifyRequestsStatus:() => createSuccessfulRemoteDataObject$(mock), }; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NotifyRequestsStatusComponent], - providers: [ + imports: [TranslateModule.forRoot(), NotifyRequestsStatusComponent], + providers: [ { provide: NotifyRequestsStatusDataService, useValue: notifyInfoServiceSpy }, ], -}); + }); }); beforeEach(() => { diff --git a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts index ab05c55342..305e3cf8f7 100644 --- a/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts +++ b/src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts @@ -1,13 +1,33 @@ -import { ChangeDetectionStrategy, Component, Input, OnInit, } from '@angular/core'; -import { filter, map, Observable, } from 'rxjs'; +import { + AsyncPipe, + KeyValuePipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Input, + OnInit, +} from '@angular/core'; +import { + filter, + map, + Observable, +} from 'rxjs'; import { NotifyRequestsStatusDataService } from '../../../../core/data/notify-services-status-data.service'; -import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getRemoteDataPayload, +} from '../../../../core/shared/operators'; import { hasValue } from '../../../../shared/empty.util'; -import { RequestStatusAlertBoxComponent } from '../request-status-alert-box/request-status-alert-box.component'; -import { AsyncPipe, KeyValuePipe, NgForOf, NgIf } from '@angular/common'; -import { NotifyRequestsStatus, NotifyStatuses, } from '../notify-requests-status.model'; +import { + NotifyRequestsStatus, + NotifyStatuses, +} from '../notify-requests-status.model'; import { RequestStatusEnum } from '../notify-status.enum'; +import { RequestStatusAlertBoxComponent } from '../request-status-alert-box/request-status-alert-box.component'; @Component({ selector: 'ds-notify-requests-status', @@ -20,8 +40,8 @@ import { RequestStatusEnum } from '../notify-status.enum'; AsyncPipe, KeyValuePipe, NgForOf, - NgIf - ] + NgIf, + ], }) /** diff --git a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.spec.ts b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.spec.ts index a610db6f82..7772d955be 100644 --- a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.spec.ts +++ b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.spec.ts @@ -30,8 +30,8 @@ describe('RequestStatusAlertBoxComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RequestStatusAlertBoxComponent] -}).compileComponents(); + imports: [TranslateModule.forRoot(), RequestStatusAlertBoxComponent], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts index 4c381dd2d5..eef3774d06 100644 --- a/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts +++ b/src/app/item-page/simple/notify-requests-status/request-status-alert-box/request-status-alert-box.component.ts @@ -1,16 +1,19 @@ +import { + NgClass, + NgForOf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, type OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../shared/truncatable/truncatable-part/truncatable-part.component'; import { NotifyStatuses } from '../notify-requests-status.model'; import { RequestStatusEnum } from '../notify-status.enum'; -import { TruncatablePartComponent } from '../../../../shared/truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; -import { NgClass, NgForOf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-request-status-alert-box', @@ -23,8 +26,8 @@ import { TranslateModule } from '@ngx-translate/core'; TruncatableComponent, NgForOf, TranslateModule, - NgClass - ] + NgClass, + ], }) /** * Represents a component that displays the status of a request. diff --git a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.spec.ts b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.spec.ts index 269bb69d92..555cfef19f 100644 --- a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.spec.ts +++ b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.spec.ts @@ -1,5 +1,8 @@ import { CommonModule } from '@angular/common'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -10,9 +13,7 @@ import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data import { ObjectCacheService } from '../../../core/cache/object-cache.service'; import { RequestService } from '../../../core/data/request.service'; import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; -import { - QualityAssuranceSourceDataService -} from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; +import { QualityAssuranceSourceDataService } from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; import { HALEndpointService } from '../../../core/shared/hal-endpoint.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; @@ -40,17 +41,17 @@ describe('QaEventNotificationComponent', () => { getSourcesByTarget: () => objPL, }; await TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), QaEventNotificationComponent, SplitPipe], - providers: [ + imports: [CommonModule, TranslateModule.forRoot(), QaEventNotificationComponent, SplitPipe], + providers: [ { provide: QualityAssuranceSourceDataService, useValue: qualityAssuranceSourceDataServiceStub }, { provide: RequestService, useValue: {} }, { provide: NotificationsService, useValue: {} }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('test') }, ObjectCacheService, RemoteDataBuildService, - provideMockStore({}) - ] -}) + provideMockStore({}), + ], + }) .compileComponents(); fixture = TestBed.createComponent(QaEventNotificationComponent); component = fixture.componentInstance; diff --git a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts index bc89d57d4b..a428f7feb4 100644 --- a/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts +++ b/src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts @@ -1,22 +1,33 @@ -import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges, } from '@angular/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Input, + OnChanges, + SimpleChanges, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { catchError, map, } from 'rxjs/operators'; +import { + catchError, + map, +} from 'rxjs/operators'; import { getNotificatioQualityAssuranceRoute } from '../../../admin/admin-routing-paths'; import { RequestParam } from '../../../core/cache/models/request-param.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { SplitPipe } from '../../../shared/utils/split.pipe'; import { RemoteData } from '../../../core/data/remote-data'; import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; -import { - QualityAssuranceSourceDataService -} from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; +import { QualityAssuranceSourceDataService } from '../../../core/notifications/qa/source/quality-assurance-source-data.service'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { SplitPipe } from '../../../shared/utils/split.pipe'; @Component({ selector: 'ds-qa-event-notification', @@ -30,9 +41,9 @@ import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; AsyncPipe, RouterLink, TranslateModule, - SplitPipe + SplitPipe, ], - standalone: true + standalone: true, }) /** * Component for displaying quality assurance event notifications for an item. diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts index a54b4a7d83..8f918c2916 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; @@ -22,12 +26,12 @@ describe('RelatedEntitiesSearchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, RelatedEntitiesSearchComponent], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(RelatedEntitiesSearchComponent, { remove: { - imports: [ConfigurationSearchPageComponent] - } + imports: [ConfigurationSearchPageComponent], + }, }) .compileComponents(); })); diff --git a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts index f337cde7a0..341d90f9c0 100644 --- a/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts @@ -1,15 +1,19 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; +import { ConfigurationSearchPageComponent } from '../../../../search-page/configuration-search-page.component'; import { isNotEmpty } from '../../../../shared/empty.util'; import { getFilterByRelation } from '../../../../shared/utils/relation-query.utils'; -import { ConfigurationSearchPageComponent } from '../../../../search-page/configuration-search-page.component'; @Component({ - selector: 'ds-related-entities-search', - templateUrl: './related-entities-search.component.html', - standalone: true, - imports: [ConfigurationSearchPageComponent] + selector: 'ds-related-entities-search', + templateUrl: './related-entities-search.component.html', + standalone: true, + imports: [ConfigurationSearchPageComponent], }) /** * A component to show related items as search results. diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts index 3356fb7cd9..66e5319020 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts @@ -12,11 +12,11 @@ import { import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { RelatedEntitiesSearchComponent } from '../related-entities-search/related-entities-search.component'; import { Item } from '../../../../core/shared/item.model'; import { RouterMock } from '../../../../shared/mocks/router.mock'; import { VarDirective } from '../../../../shared/utils/var.directive'; +import { RelatedEntitiesSearchComponent } from '../related-entities-search/related-entities-search.component'; import { TabbedRelatedEntitiesSearchComponent } from './tabbed-related-entities-search.component'; describe('TabbedRelatedEntitiesSearchComponent', () => { @@ -53,9 +53,9 @@ describe('TabbedRelatedEntitiesSearchComponent', () => { .overrideComponent(TabbedRelatedEntitiesSearchComponent, { remove: { imports: [ - RelatedEntitiesSearchComponent - ] - } + RelatedEntitiesSearchComponent, + ], + }, }) .compileComponents(); })); diff --git a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts index 07d9d72d1d..fc27a9a1e4 100644 --- a/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts +++ b/src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts @@ -1,20 +1,31 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { TranslateModule } from '@ngx-translate/core'; -import { VarDirective } from '../../../../shared/utils/var.directive'; -import { RelatedEntitiesSearchComponent } from '../related-entities-search/related-entities-search.component'; -import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Item } from '../../../../core/shared/item.model'; +import { VarDirective } from '../../../../shared/utils/var.directive'; +import { RelatedEntitiesSearchComponent } from '../related-entities-search/related-entities-search.component'; @Component({ - selector: 'ds-tabbed-related-entities-search', - templateUrl: './tabbed-related-entities-search.component.html', - standalone: true, - imports: [NgIf, NgbNavModule, NgFor, RelatedEntitiesSearchComponent, VarDirective, AsyncPipe, TranslateModule] + selector: 'ds-tabbed-related-entities-search', + templateUrl: './tabbed-related-entities-search.component.html', + standalone: true, + imports: [NgIf, NgbNavModule, NgFor, RelatedEntitiesSearchComponent, VarDirective, AsyncPipe, TranslateModule], }) /** * A component to show related items as search results, split into tabs by relationship-type diff --git a/src/app/item-page/simple/related-items/related-items-component.ts b/src/app/item-page/simple/related-items/related-items-component.ts index e4632fa5c8..b65f903a5d 100644 --- a/src/app/item-page/simple/related-items/related-items-component.ts +++ b/src/app/item-page/simple/related-items/related-items-component.ts @@ -1,30 +1,43 @@ -import { AsyncPipe, isPlatformBrowser, NgClass, NgFor, NgIf } from '@angular/common'; -import { Component, ElementRef, Inject, Input, PLATFORM_ID, } from '@angular/core'; +import { + AsyncPipe, + isPlatformBrowser, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + ElementRef, + Inject, + Input, + PLATFORM_ID, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { APP_CONFIG, AppConfig, } from '../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../config/app-config.interface'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; -import { setPlaceHolderAttributes } from '../../../shared/utils/object-list-utils'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { setPlaceHolderAttributes } from '../../../shared/utils/object-list-utils'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { AbstractIncrementalListComponent } from '../abstract-incremental-list/abstract-incremental-list.component'; @Component({ - selector: 'ds-related-items', - styleUrls: ['./related-items.component.scss'], - templateUrl: './related-items.component.html', - standalone: true, - imports: [MetadataFieldWrapperComponent, NgClass, NgFor, VarDirective, ListableObjectComponentLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-related-items', + styleUrls: ['./related-items.component.scss'], + templateUrl: './related-items.component.html', + standalone: true, + imports: [MetadataFieldWrapperComponent, NgClass, NgFor, VarDirective, ListableObjectComponentLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * This component is used for displaying relations between items diff --git a/src/app/item-page/simple/related-items/related-items.component.spec.ts b/src/app/item-page/simple/related-items/related-items.component.spec.ts index 3931ccc02e..3d8a314597 100644 --- a/src/app/item-page/simple/related-items/related-items.component.spec.ts +++ b/src/app/item-page/simple/related-items/related-items.component.spec.ts @@ -1,21 +1,26 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../config/app-config.interface'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { Item } from '../../../core/shared/item.model'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; +import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; import { VarDirective } from '../../../shared/utils/var.directive'; import { createRelationshipsObservable } from '../item-types/shared/item.component.spec'; import { RelatedItemsComponent } from './related-items-component'; @@ -63,22 +68,22 @@ describe('RelatedItemsComponent', () => { ); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], - providers: [ - {provide: RelationshipDataService, useValue: relationshipService}, - {provide: APP_CONFIG, useValue: environmentUseThumbs}, - {provide: ThemeService, useValue: getMockThemeService()} - ], + imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], + providers: [ + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: APP_CONFIG, useValue: environmentUseThumbs }, + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(RelatedItemsComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + }).overrideComponent(RelatedItemsComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ MetadataFieldWrapperComponent, ListableObjectComponentLoaderComponent, - ThemedLoadingComponent - ] - } + ThemedLoadingComponent, + ], + }, }).compileComponents(); })); @@ -143,22 +148,22 @@ describe('RelatedItemsComponent', () => { ); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], - providers: [ - {provide: RelationshipDataService, useValue: relationshipService}, - {provide: APP_CONFIG, useValue: enviromentNoThumbs}, - {provide: ThemeService, useValue: getMockThemeService()} - ], + imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], + providers: [ + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: APP_CONFIG, useValue: enviromentNoThumbs }, + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(RelatedItemsComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + }).overrideComponent(RelatedItemsComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ MetadataFieldWrapperComponent, ListableObjectComponentLoaderComponent, - ThemedLoadingComponent - ] - } + ThemedLoadingComponent, + ], + }, }).compileComponents(); })); diff --git a/src/app/item-page/simple/themed-item-page.component.ts b/src/app/item-page/simple/themed-item-page.component.ts index 4d89cf1108..9eca619774 100644 --- a/src/app/item-page/simple/themed-item-page.component.ts +++ b/src/app/item-page/simple/themed-item-page.component.ts @@ -7,10 +7,10 @@ import { ItemPageComponent } from './item-page.component'; * Themed wrapper for ItemPageComponent */ @Component({ - selector: 'ds-themed-item-page', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-page', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedItemPageComponent extends ThemedComponent { diff --git a/src/app/item-page/version-page/version-page/version-page.component.spec.ts b/src/app/item-page/version-page/version-page/version-page.component.spec.ts index e9af9c300a..07325bc6cb 100644 --- a/src/app/item-page/version-page/version-page/version-page.component.spec.ts +++ b/src/app/item-page/version-page/version-page/version-page.component.spec.ts @@ -34,8 +34,8 @@ const mockVersion: Version = Object.assign(new Version(), { }); @Component({ - template: '', - standalone: true + template: '', + standalone: true, }) class DummyComponent { } @@ -55,13 +55,13 @@ describe('VersionPageComponent', () => { setRedirectUrl: {}, }); TestBed.configureTestingModule({ - imports: [RouterTestingModule.withRoutes([{ path: 'items/item-uuid', component: DummyComponent, pathMatch: 'full' }]), VersionPageComponent, DummyComponent], - providers: [ + imports: [RouterTestingModule.withRoutes([{ path: 'items/item-uuid', component: DummyComponent, pathMatch: 'full' }]), VersionPageComponent, DummyComponent], + providers: [ { provide: ActivatedRoute, useValue: mockRoute }, { provide: VersionDataService, useValue: {} }, { provide: AuthService, useValue: authService }, - ] -}).compileComponents(); + ], + }).compileComponents(); })); diff --git a/src/app/item-page/version-page/version-page/version-page.component.ts b/src/app/item-page/version-page/version-page/version-page.component.ts index f51abba562..17193edffe 100644 --- a/src/app/item-page/version-page/version-page/version-page.component.ts +++ b/src/app/item-page/version-page/version-page/version-page.component.ts @@ -1,7 +1,16 @@ -import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { Observable } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { getPageNotFoundRoute } from '../../../app-routing-paths'; import { AuthService } from '../../../core/auth/auth.service'; @@ -9,15 +18,18 @@ import { RemoteData } from '../../../core/data/remote-data'; import { VersionDataService } from '../../../core/data/version-data.service'; import { redirectOn4xx } from '../../../core/shared/authorized.operators'; import { Item } from '../../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; import { Version } from '../../../core/shared/version.model'; import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ - selector: 'ds-version-page', - templateUrl: './version-page.component.html', - styleUrls: ['./version-page.component.scss'], - standalone: true + selector: 'ds-version-page', + templateUrl: './version-page.component.html', + styleUrls: ['./version-page.component.scss'], + standalone: true, }) export class VersionPageComponent implements OnInit { diff --git a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.spec.ts b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.spec.ts index bf6838bec9..b48ab934b3 100644 --- a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.spec.ts +++ b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.spec.ts @@ -14,11 +14,11 @@ describe('ItemVersionsDeleteModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionsDeleteModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionsDeleteModalComponent], + providers: [ { provide: NgbActiveModal }, ], -}).compileComponents(); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts index 2f3ef2b420..e3fb8dbf91 100644 --- a/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts +++ b/src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts @@ -7,11 +7,11 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-item-versions-delete-modal', - templateUrl: './item-versions-delete-modal.component.html', - styleUrls: ['./item-versions-delete-modal.component.scss'], - standalone: true, - imports: [TranslateModule] + selector: 'ds-item-versions-delete-modal', + templateUrl: './item-versions-delete-modal.component.html', + styleUrls: ['./item-versions-delete-modal.component.scss'], + standalone: true, + imports: [TranslateModule], }) export class ItemVersionsDeleteModalComponent { /** diff --git a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.spec.ts b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.spec.ts index 4cd812c031..352e111a32 100644 --- a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.spec.ts +++ b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.spec.ts @@ -14,11 +14,11 @@ describe('ItemVersionsSummaryModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionsSummaryModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionsSummaryModalComponent], + providers: [ { provide: NgbActiveModal }, ], -}).compileComponents(); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts index 0eee5c18d2..9cc141a31b 100644 --- a/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts +++ b/src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts @@ -1,24 +1,27 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, OnInit, Output, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { ModalBeforeDismiss } from '../../../shared/interfaces/modal-before-dismiss.interface'; -import { TranslateModule } from '@ngx-translate/core'; import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { FormsModule } from '@angular/forms'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-item-versions-summary-modal', - templateUrl: './item-versions-summary-modal.component.html', - styleUrls: ['./item-versions-summary-modal.component.scss'], - standalone: true, - imports: [NgIf, FormsModule, LoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-item-versions-summary-modal', + templateUrl: './item-versions-summary-modal.component.html', + styleUrls: ['./item-versions-summary-modal.component.scss'], + standalone: true, + imports: [NgIf, FormsModule, LoadingComponent, AsyncPipe, TranslateModule], }) export class ItemVersionsSummaryModalComponent implements OnInit, ModalBeforeDismiss { diff --git a/src/app/item-page/versions/item-versions.component.spec.ts b/src/app/item-page/versions/item-versions.component.spec.ts index d9d810ae92..44b9af05e7 100644 --- a/src/app/item-page/versions/item-versions.component.spec.ts +++ b/src/app/item-page/versions/item-versions.component.spec.ts @@ -1,11 +1,32 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, RouterModule } from '@angular/router'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + RouterModule, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { EMPTY, of, of as observableOf, } from 'rxjs'; +import { + EMPTY, + of as observableOf, + of, +} from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; @@ -18,18 +39,18 @@ import { PaginationService } from '../../core/pagination/pagination.service'; import { Item } from '../../core/shared/item.model'; import { Version } from '../../core/shared/version.model'; import { VersionHistory } from '../../core/shared/version-history.model'; -import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { createPaginatedList } from '../../shared/testing/utils.test'; -import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; +import { AlertComponent } from '../../shared/alert/alert.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../shared/pagination/pagination.component'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; +import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub'; +import { createPaginatedList } from '../../shared/testing/utils.test'; import { VarDirective } from '../../shared/utils/var.directive'; import { ItemSharedModule } from '../item-shared.module'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; import { ItemVersionsComponent } from './item-versions.component'; describe('ItemVersionsComponent', () => { @@ -138,25 +159,25 @@ describe('ItemVersionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterModule.forRoot([]), CommonModule, FormsModule, ReactiveFormsModule, BrowserModule, ItemSharedModule, ItemVersionsComponent, VarDirective], - providers: [ - {provide: PaginationService, useValue: new PaginationServiceStub() }, - {provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, - {provide: NotificationsService, useValue: new NotificationsServiceStub()}, - {provide: AuthService, useValue: authenticationServiceSpy}, - {provide: AuthorizationDataService, useValue: authorizationServiceSpy}, - {provide: VersionHistoryDataService, useValue: versionHistoryServiceSpy}, - {provide: ItemDataService, useValue: itemDataServiceSpy}, - {provide: VersionDataService, useValue: versionServiceSpy}, - {provide: WorkspaceitemDataService, useValue: workspaceItemDataServiceSpy}, - {provide: WorkflowItemDataService, useValue: workflowItemDataServiceSpy}, - {provide: ConfigurationDataService, useValue: configurationServiceSpy}, - {provide: ActivatedRoute, useValue: new ActivatedRouteStub()}, - ], + imports: [TranslateModule.forRoot(), RouterModule.forRoot([]), CommonModule, FormsModule, ReactiveFormsModule, BrowserModule, ItemSharedModule, ItemVersionsComponent, VarDirective], + providers: [ + { provide: PaginationService, useValue: new PaginationServiceStub() }, + { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, + { provide: NotificationsService, useValue: new NotificationsServiceStub() }, + { provide: AuthService, useValue: authenticationServiceSpy }, + { provide: AuthorizationDataService, useValue: authorizationServiceSpy }, + { provide: VersionHistoryDataService, useValue: versionHistoryServiceSpy }, + { provide: ItemDataService, useValue: itemDataServiceSpy }, + { provide: VersionDataService, useValue: versionServiceSpy }, + { provide: WorkspaceitemDataService, useValue: workspaceItemDataServiceSpy }, + { provide: WorkflowItemDataService, useValue: workflowItemDataServiceSpy }, + { provide: ConfigurationDataService, useValue: configurationServiceSpy }, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(ItemVersionsComponent, { - remove: {imports: [AlertComponent, PaginationComponent]} + remove: { imports: [AlertComponent, PaginationComponent] }, }) .compileComponents(); diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts index 049f01bf1a..a73c42d8f4 100644 --- a/src/app/item-page/versions/item-versions.component.ts +++ b/src/app/item-page/versions/item-versions.component.ts @@ -1,13 +1,35 @@ +import { + AsyncPipe, + DatePipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; -import { Router } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + FormsModule, + UntypedFormBuilder, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + Router, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -25,12 +47,24 @@ import { } from 'rxjs/operators'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; -import { ItemDataService } from '../../core/data/item-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; +import { + FeatureID, + FeatureID, +} from '../../core/data/feature-authorization/feature-id'; +import { + ItemDataService, + ItemDataService, +} from '../../core/data/item-data.service'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; -import { VersionDataService } from '../../core/data/version-data.service'; +import { + VersionDataService, + VersionDataService, +} from '../../core/data/version-data.service'; import { VersionHistoryDataService } from '../../core/data/version-history-data.service'; import { PaginationService } from '../../core/pagination/pagination.service'; import { Item } from '../../core/shared/item.model'; @@ -47,44 +81,39 @@ import { VersionHistory } from '../../core/shared/version-history.model'; import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; +import { AlertComponent } from '../../shared/alert/alert.component'; import { AlertType } from '../../shared/alert/alert-type'; import { hasValue, hasValueOperator, } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; import { followLink } from '../../shared/utils/follow-link-config.model'; +import { VarDirective } from '../../shared/utils/var.directive'; import { getItemEditVersionhistoryRoute, getItemPageRoute, getItemVersionRoute, } from '../item-page-routing-paths'; -import { UntypedFormBuilder, FormsModule } from '@angular/forms'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { ItemVersionsSummaryModalComponent } from './item-versions-summary-modal/item-versions-summary-modal.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { ItemVersionsDeleteModalComponent } from './item-versions-delete-modal/item-versions-delete-modal.component'; -import { VersionDataService } from '../../core/data/version-data.service'; -import { ItemDataService } from '../../core/data/item-data.service'; -import { Router, RouterLink } from '@angular/router'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../core/data/feature-authorization/feature-id'; import { ItemVersionsSharedService } from './item-versions-shared.service'; -import { ItemVersionsSummaryModalComponent } from './item-versions-summary-modal/item-versions-summary-modal.component'; -import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { NgIf, NgFor, NgClass, AsyncPipe, DatePipe } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; +import { + ItemVersionsSummaryModalComponent, + ItemVersionsSummaryModalComponent, +} from './item-versions-summary-modal/item-versions-summary-modal.component'; @Component({ - selector: 'ds-item-versions', - templateUrl: './item-versions.component.html', - styleUrls: ['./item-versions.component.scss'], - standalone: true, - imports: [VarDirective, NgIf, AlertComponent, PaginationComponent, NgFor, RouterLink, NgClass, FormsModule, AsyncPipe, DatePipe, TranslateModule] + selector: 'ds-item-versions', + templateUrl: './item-versions.component.html', + styleUrls: ['./item-versions.component.scss'], + standalone: true, + imports: [VarDirective, NgIf, AlertComponent, PaginationComponent, NgFor, RouterLink, NgClass, FormsModule, AsyncPipe, DatePipe, TranslateModule], }) /** diff --git a/src/app/item-page/versions/item-versions.module.ts b/src/app/item-page/versions/item-versions.module.ts index fef871c2eb..59517c4369 100644 --- a/src/app/item-page/versions/item-versions.module.ts +++ b/src/app/item-page/versions/item-versions.module.ts @@ -7,6 +7,7 @@ */ import { NgModule } from '@angular/core'; + import { ItemVersionsComponent } from './item-versions.component'; import { ItemVersionsNoticeComponent } from './notice/item-versions-notice.component'; @@ -16,12 +17,12 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - ...DECLARATIONS - ], - exports: [ - ...DECLARATIONS, - ] + imports: [ + ...DECLARATIONS, + ], + exports: [ + ...DECLARATIONS, + ], }) export class ItemVersionsModule { diff --git a/src/app/item-page/versions/notice/item-versions-notice.component.spec.ts b/src/app/item-page/versions/notice/item-versions-notice.component.spec.ts index 649a36bb68..fd3c509635 100644 --- a/src/app/item-page/versions/notice/item-versions-notice.component.spec.ts +++ b/src/app/item-page/versions/notice/item-versions-notice.component.spec.ts @@ -5,6 +5,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; @@ -17,7 +18,6 @@ import { VersionHistory } from '../../../core/shared/version-history.model'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../shared/testing/utils.test'; import { ItemVersionsNoticeComponent } from './item-versions-notice.component'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('ItemVersionsNoticeComponent', () => { let component: ItemVersionsNoticeComponent; @@ -65,17 +65,17 @@ describe('ItemVersionsNoticeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ItemVersionsNoticeComponent, - NoopAnimationsModule - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ItemVersionsNoticeComponent, + NoopAnimationsModule, + ], + providers: [ { provide: VersionHistoryDataService, useValue: versionHistoryServiceSpy }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); versionHistoryService = TestBed.inject(VersionHistoryDataService); diff --git a/src/app/item-page/versions/notice/item-versions-notice.component.ts b/src/app/item-page/versions/notice/item-versions-notice.component.ts index a9c670a6f0..184d97c959 100644 --- a/src/app/item-page/versions/notice/item-versions-notice.component.ts +++ b/src/app/item-page/versions/notice/item-versions-notice.component.ts @@ -1,8 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map, @@ -20,21 +25,19 @@ import { } from '../../../core/shared/operators'; import { Version } from '../../../core/shared/version.model'; import { VersionHistory } from '../../../core/shared/version-history.model'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; import { hasValue, hasValueOperator, } from '../../../shared/empty.util'; import { getItemPageRoute } from '../../item-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-item-versions-notice', - templateUrl: './item-versions-notice.component.html', - standalone: true, - imports: [NgIf, AlertComponent, AsyncPipe, TranslateModule] + selector: 'ds-item-versions-notice', + templateUrl: './item-versions-notice.component.html', + standalone: true, + imports: [NgIf, AlertComponent, AsyncPipe, TranslateModule], }) /** * Component for displaying a warning notice when the item is not the latest version within its version history diff --git a/src/app/login-page/login-page-routes.ts b/src/app/login-page/login-page-routes.ts index 22400e2ace..c0463e1834 100644 --- a/src/app/login-page/login-page-routes.ts +++ b/src/app/login-page/login-page-routes.ts @@ -1,4 +1,5 @@ import { Route } from '@angular/router'; + import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; import { ThemedLoginPageComponent } from './themed-login-page.component'; @@ -9,11 +10,11 @@ export const ROUTES: Route[] = [ pathMatch: 'full', providers: [ I18nBreadcrumbResolver, - I18nBreadcrumbsService + I18nBreadcrumbsService, ], component: ThemedLoginPageComponent, - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {breadcrumbKey: 'login', title: 'login.title'} - } + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { breadcrumbKey: 'login', title: 'login.title' }, + }, ]; diff --git a/src/app/login-page/login-page.component.spec.ts b/src/app/login-page/login-page.component.spec.ts index 09ec9a1491..74aeddfe0c 100644 --- a/src/app/login-page/login-page.component.spec.ts +++ b/src/app/login-page/login-page.component.spec.ts @@ -1,16 +1,20 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; +import { Store } from '@ngrx/store'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; +import { APP_DATA_SERVICES_MAP } from '../../config/app-config.interface'; import { AuthService } from '../core/auth/auth.service'; import { AuthServiceMock } from '../shared/mocks/auth.service.mock'; -import { provideMockStore } from '@ngrx/store/testing'; -import { APP_DATA_SERVICES_MAP } from '../../config/app-config.interface'; +import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; import { LoginPageComponent } from './login-page.component'; -import { Store } from '@ngrx/store'; describe('LoginPageComponent', () => { let comp: LoginPageComponent; @@ -30,13 +34,13 @@ describe('LoginPageComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - LoginPageComponent + LoginPageComponent, ], providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - provideMockStore({}) + provideMockStore({}), ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/src/app/login-page/login-page.component.ts b/src/app/login-page/login-page.component.ts index 3f554c788a..286de60424 100644 --- a/src/app/login-page/login-page.component.ts +++ b/src/app/login-page/login-page.component.ts @@ -1,8 +1,19 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; -import { combineLatest as observableCombineLatest, Subscription, } from 'rxjs'; -import { filter, take, } from 'rxjs/operators'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, + Subscription, +} from 'rxjs'; +import { + filter, + take, +} from 'rxjs/operators'; import { AppState } from '../app.reducer'; import { @@ -13,20 +24,22 @@ import { } from '../core/auth/auth.actions'; import { AuthTokenInfo } from '../core/auth/models/auth-token-info.model'; import { isAuthenticated } from '../core/auth/selectors'; -import { TranslateModule } from '@ngx-translate/core'; +import { + hasValue, + isNotEmpty, +} from '../shared/empty.util'; import { LogInComponent } from '../shared/log-in/log-in.component'; import { ThemedLogInComponent } from '../shared/log-in/themed-log-in.component'; -import { hasValue, isNotEmpty, } from '../shared/empty.util'; /** * This component represents the login page */ @Component({ - selector: 'ds-login-page', - styleUrls: ['./login-page.component.scss'], - templateUrl: './login-page.component.html', - standalone: true, - imports: [LogInComponent, ThemedLogInComponent, TranslateModule] + selector: 'ds-login-page', + styleUrls: ['./login-page.component.scss'], + templateUrl: './login-page.component.html', + standalone: true, + imports: [LogInComponent, ThemedLogInComponent, TranslateModule], }) export class LoginPageComponent implements OnDestroy, OnInit { diff --git a/src/app/login-page/themed-login-page.component.ts b/src/app/login-page/themed-login-page.component.ts index b9d56fc0f3..a9956751b4 100644 --- a/src/app/login-page/themed-login-page.component.ts +++ b/src/app/login-page/themed-login-page.component.ts @@ -7,10 +7,10 @@ import { LoginPageComponent } from './login-page.component'; * Themed wrapper for LoginPageComponent */ @Component({ - selector: 'ds-themed-login-page', - styleUrls: [], - templateUrl: './../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-login-page', + styleUrls: [], + templateUrl: './../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedLoginPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/logout-page/logout-page-routes.ts b/src/app/logout-page/logout-page-routes.ts index 21085e1215..5a697f52a0 100644 --- a/src/app/logout-page/logout-page-routes.ts +++ b/src/app/logout-page/logout-page-routes.ts @@ -1,4 +1,5 @@ import { Route } from '@angular/router'; + import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { ThemedLogoutPageComponent } from './themed-logout-page.component'; @@ -7,6 +8,6 @@ export const ROUTES: Route[] = [ canActivate: [AuthenticatedGuard], path: '', component: ThemedLogoutPageComponent, - data: {title: 'logout.title'} - } + data: { title: 'logout.title' }, + }, ]; diff --git a/src/app/logout-page/logout-page.component.spec.ts b/src/app/logout-page/logout-page.component.spec.ts index 61de166af8..9d07af2bdc 100644 --- a/src/app/logout-page/logout-page.component.spec.ts +++ b/src/app/logout-page/logout-page.component.spec.ts @@ -4,10 +4,10 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { LogoutPageComponent } from './logout-page.component'; -import { provideMockStore } from '@ngrx/store/testing'; describe('LogoutPageComponent', () => { let comp: LogoutPageComponent; @@ -17,12 +17,12 @@ describe('LogoutPageComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - LogoutPageComponent + LogoutPageComponent, ], providers: [ - provideMockStore() + provideMockStore(), ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) .compileComponents(); })); diff --git a/src/app/logout-page/logout-page.component.ts b/src/app/logout-page/logout-page.component.ts index bdf7159345..b4623ee215 100644 --- a/src/app/logout-page/logout-page.component.ts +++ b/src/app/logout-page/logout-page.component.ts @@ -1,13 +1,14 @@ import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + import { LogOutComponent } from '../shared/log-out/log-out.component'; @Component({ - selector: 'ds-logout-page', - styleUrls: ['./logout-page.component.scss'], - templateUrl: './logout-page.component.html', - standalone: true, - imports: [LogOutComponent, TranslateModule] + selector: 'ds-logout-page', + styleUrls: ['./logout-page.component.scss'], + templateUrl: './logout-page.component.html', + standalone: true, + imports: [LogOutComponent, TranslateModule], }) export class LogoutPageComponent { diff --git a/src/app/logout-page/themed-logout-page.component.ts b/src/app/logout-page/themed-logout-page.component.ts index c7a4e0e42d..3c89cb0165 100644 --- a/src/app/logout-page/themed-logout-page.component.ts +++ b/src/app/logout-page/themed-logout-page.component.ts @@ -7,10 +7,10 @@ import { LogoutPageComponent } from './logout-page.component'; * Themed wrapper for LogoutPageComponent */ @Component({ - selector: 'ds-themed-logout-page', - styleUrls: [], - templateUrl: './../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-logout-page', + styleUrls: [], + templateUrl: './../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedLogoutPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/lookup-by-id/lookup-by-id-routes.ts b/src/app/lookup-by-id/lookup-by-id-routes.ts index e1200b0795..8f2135def0 100644 --- a/src/app/lookup-by-id/lookup-by-id-routes.ts +++ b/src/app/lookup-by-id/lookup-by-id-routes.ts @@ -1,4 +1,8 @@ -import { Route, UrlSegment, } from '@angular/router'; +import { + Route, + UrlSegment, +} from '@angular/router'; + import { isNotEmpty } from '../shared/empty.util'; import { LookupGuard } from './lookup-guard'; import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component'; @@ -7,11 +11,11 @@ export const ROUTES: Route[] = [ { matcher: urlMatcher, providers: [ - LookupGuard + LookupGuard, ], canActivate: [LookupGuard], - component: ThemedObjectNotFoundComponent - } + component: ThemedObjectNotFoundComponent, + }, ]; diff --git a/src/app/lookup-by-id/lookup-by-id.module.ts b/src/app/lookup-by-id/lookup-by-id.module.ts index 3abd42d600..df1d76abf4 100644 --- a/src/app/lookup-by-id/lookup-by-id.module.ts +++ b/src/app/lookup-by-id/lookup-by-id.module.ts @@ -6,13 +6,13 @@ import { ObjectNotFoundComponent } from './objectnotfound/objectnotfound.compone import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component'; @NgModule({ - imports: [ - CommonModule, - ObjectNotFoundComponent, + imports: [ + CommonModule, + ObjectNotFoundComponent, ThemedObjectNotFoundComponent, - ], - providers: [ - DsoRedirectService, + ], + providers: [ + DsoRedirectService, ], }) export class LookupIdModule { diff --git a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts index cb1bcf7a3a..c19f9c427d 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts @@ -27,14 +27,14 @@ describe('ObjectNotFoundComponent', () => { describe('uuid request', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - ObjectNotFoundComponent - ], providers: [ + imports: [ + TranslateModule.forRoot(), + ObjectNotFoundComponent, + ], providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { @@ -57,14 +57,14 @@ describe('ObjectNotFoundComponent', () => { describe( 'legacy handle request', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - ObjectNotFoundComponent - ], providers: [ + imports: [ + TranslateModule.forRoot(), + ObjectNotFoundComponent, + ], providers: [ { provide: ActivatedRoute, useValue: activatedRouteStubHandle }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts index c956bab5d0..cd54fa39b6 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts @@ -4,19 +4,22 @@ import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, RouterLink } from '@angular/router'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; /** * This component representing the `PageNotFound` DSpace page. */ @Component({ - selector: 'ds-objnotfound', - styleUrls: ['./objectnotfound.component.scss'], - templateUrl: './objectnotfound.component.html', - changeDetection: ChangeDetectionStrategy.Default, - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-objnotfound', + styleUrls: ['./objectnotfound.component.scss'], + templateUrl: './objectnotfound.component.html', + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [RouterLink, TranslateModule], }) export class ObjectNotFoundComponent implements OnInit { diff --git a/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts index 1087802b5a..4474a9724f 100644 --- a/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts @@ -7,10 +7,10 @@ import { ObjectNotFoundComponent } from './objectnotfound.component'; * Themed wrapper for ObjectNotFoundComponent */ @Component({ - selector: 'ds-themed-objnotfound', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-objnotfound', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedObjectNotFoundComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/menu.resolver.spec.ts b/src/app/menu.resolver.spec.ts index 007823fd1d..0a1a050637 100644 --- a/src/app/menu.resolver.spec.ts +++ b/src/app/menu.resolver.spec.ts @@ -1,8 +1,14 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; @@ -13,13 +19,13 @@ import { ConfigurationDataService } from './core/data/configuration-data.service import { AuthorizationDataService } from './core/data/feature-authorization/authorization-data.service'; import { FeatureID } from './core/data/feature-authorization/feature-id'; import { ScriptDataService } from './core/data/processes/script-data.service'; -import { MenuServiceStub } from './shared/testing/menu-service.stub'; import { MenuResolver } from './menu.resolver'; import { MenuService } from './shared/menu/menu.service'; import { MenuID } from './shared/menu/menu-id.model'; import { createSuccessfulRemoteDataObject$ } from './shared/remote-data.utils'; -import { createPaginatedList } from './shared/testing/utils.test'; import { ConfigurationDataServiceStub } from './shared/testing/configuration-data.service.stub'; +import { MenuServiceStub } from './shared/testing/menu-service.stub'; +import { createPaginatedList } from './shared/testing/utils.test'; import createSpy = jasmine.createSpy; const BOOLEAN = { t: true, f: false }; @@ -58,26 +64,26 @@ describe('MenuResolver', () => { }); mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({})} as NgbModalRef - ) + { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + ), }; configurationDataService = new ConfigurationDataServiceStub(); spyOn(configurationDataService, 'findByPropertyName').and.returnValue(observableOf(true)); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], + providers: [ { provide: MenuService, useValue: menuService }, { provide: BrowseService, useValue: browseService }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: ScriptDataService, useValue: scriptService }, - {provide: ConfigurationDataService, useValue: configurationDataService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, { - provide: NgbModal, useValue: mockNgbModal } - ], + provide: NgbModal, useValue: mockNgbModal }, + ], schemas: [NO_ERRORS_SCHEMA], -}); + }); resolver = TestBed.inject(MenuResolver); })); diff --git a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts index c2e6f69363..f7ff5744a5 100644 --- a/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts +++ b/src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts @@ -1,9 +1,11 @@ /* eslint-disable max-classes-per-file */ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { createPaginatedList } from '../../shared/testing/utils.test'; - +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + ElementRef, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ChangeDetectorRef, ElementRef, @@ -11,11 +13,16 @@ import { } from '@angular/core'; import { ComponentFixture, + ComponentFixture, + TestBed, TestBed, waitForAsync, + waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { ActivatedRoute } from '@angular/router'; +import { + ActivatedRoute, + ActivatedRoute, +} from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateLoader, @@ -41,7 +48,10 @@ import { createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; import { MockElementRef } from '../../shared/testing/element-ref.mock'; -import { createPaginatedList } from '../../shared/testing/utils.test'; +import { + createPaginatedList, + createPaginatedList, +} from '../../shared/testing/utils.test'; import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { CollectionSelectorComponent } from './collection-selector.component'; @@ -129,8 +139,8 @@ describe('CollectionSelectorComponent', () => { TranslateModule.forRoot({ loader: { provide: TranslateLoader, - useClass: TranslateLoaderMock - } + useClass: TranslateLoaderMock, + }, }), CollectionSelectorComponent, // CollectionDropdownComponent, @@ -147,8 +157,8 @@ describe('CollectionSelectorComponent', () => { }) .overrideComponent(CollectionSelectorComponent, { set: { - changeDetection: ChangeDetectionStrategy.Default - } + changeDetection: ChangeDetectionStrategy.Default, + }, }) .compileComponents(); })); @@ -174,7 +184,7 @@ describe('CollectionSelectorComponent', () => { scheduler.flush(); fixture.detectChanges(); - component.selectObject({collection: {name: 'test', id: 'test', uuid: 'test'}, communities: []}); + component.selectObject({ collection: { name: 'test', id: 'test', uuid: 'test' }, communities: [] }); expect(component.selectObject).toHaveBeenCalled(); }); @@ -193,7 +203,7 @@ describe('CollectionSelectorComponent', () => { class="dropdown-item collection-item" title="test" > `, - standalone: true + standalone: true, }) export class CollectionDropdownStubComponent { test() { diff --git a/src/app/my-dspace-page/collection-selector/collection-selector.component.ts b/src/app/my-dspace-page/collection-selector/collection-selector.component.ts index 748170b649..ca9064e721 100644 --- a/src/app/my-dspace-page/collection-selector/collection-selector.component.ts +++ b/src/app/my-dspace-page/collection-selector/collection-selector.component.ts @@ -1,11 +1,9 @@ import { Component } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { CollectionListEntry } from '../../shared/collection-dropdown/collection-dropdown.component'; -import { - ThemedCollectionDropdownComponent -} from '../../shared/collection-dropdown/themed-collection-dropdown.component'; -import { TranslateModule } from '@ngx-translate/core'; +import { ThemedCollectionDropdownComponent } from '../../shared/collection-dropdown/themed-collection-dropdown.component'; /** * This component displays the dialog that shows the list of selectable collections @@ -17,9 +15,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./collection-selector.component.scss'], imports: [ ThemedCollectionDropdownComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class CollectionSelectorComponent { diff --git a/src/app/my-dspace-page/my-dspace-configuration.service.ts b/src/app/my-dspace-page/my-dspace-configuration.service.ts index 18c94c374d..2a324d7e13 100644 --- a/src/app/my-dspace-page/my-dspace-configuration.service.ts +++ b/src/app/my-dspace-page/my-dspace-configuration.service.ts @@ -1,23 +1,33 @@ -import { Injectable, InjectionToken } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { combineLatest, Observable, } from 'rxjs'; -import { first, map, } from 'rxjs/operators'; - -import { MyDSpaceConfigurationValueType } from './my-dspace-configuration-value-type'; -import { RoleService } from '../core/roles/role.service'; import { - SearchConfigurationOption -} from '../shared/search/search-switch-configuration/search-configuration-option.model'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; -import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../core/cache/models/sort-options.model'; -import { RouteService } from '../core/services/route.service'; -import { PaginationService } from '../core/pagination/pagination.service'; + Injectable, + InjectionToken, +} from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { + combineLatest, + Observable, +} from 'rxjs'; +import { + first, + map, +} from 'rxjs/operators'; + import { LinkService } from '../core/cache/builders/link.service'; import { RemoteDataBuildService } from '../core/cache/builders/remote-data-build.service'; +import { + SortDirection, + SortOptions, +} from '../core/cache/models/sort-options.model'; import { RequestService } from '../core/data/request.service'; +import { PaginationService } from '../core/pagination/pagination.service'; +import { RoleService } from '../core/roles/role.service'; +import { RouteService } from '../core/services/route.service'; import { Context } from '../core/shared/context.model'; import { HALEndpointService } from '../core/shared/hal-endpoint.service'; +import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; +import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; +import { SearchConfigurationOption } from '../shared/search/search-switch-configuration/search-configuration-option.model'; +import { MyDSpaceConfigurationValueType } from './my-dspace-configuration-value-type'; export const MyDSpaceConfigurationToContextMap = new Map([ [MyDSpaceConfigurationValueType.Workspace, Context.Workspace], @@ -30,7 +40,7 @@ export const SEARCH_CONFIG_SERVICE: InjectionToken = /** * Service that performs all actions that have to do with the current mydspace configuration */ -@Injectable({providedIn: 'root' }) +@Injectable({ providedIn: 'root' }) export class MyDSpaceConfigurationService extends SearchConfigurationService { /** * Default pagination settings diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts index b15cabfb99..e9787e8645 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts @@ -1,6 +1,15 @@ import { CommonModule } from '@angular/common'; -import { Component, DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -12,7 +21,10 @@ import { PageInfo } from '../../../core/shared/page-info.model'; import { ResourceType } from '../../../core/shared/resource-type'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { RouterStub } from '../../../shared/testing/router.stub'; -import { createPaginatedList, createTestComponent, } from '../../../shared/testing/utils.test'; +import { + createPaginatedList, + createTestComponent, +} from '../../../shared/testing/utils.test'; import { MyDSpaceNewExternalDropdownComponent } from './my-dspace-new-external-dropdown.component'; export function getMockEntityTypeService(): EntityTypeDataService { @@ -78,19 +90,19 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { describe('With only one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - MyDSpaceNewExternalDropdownComponent, - TestComponent - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, - { provide: Router, useValue: new RouterStub() }, + imports: [ + CommonModule, + TranslateModule.forRoot(), MyDSpaceNewExternalDropdownComponent, - ], + TestComponent, + ], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, + { provide: Router, useValue: new RouterStub() }, + MyDSpaceNewExternalDropdownComponent, + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); const html = ``; @@ -127,19 +139,19 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { describe('With more than one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - MyDSpaceNewExternalDropdownComponent, - TestComponent - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - { provide: Router, useValue: new RouterStub() }, + imports: [ + CommonModule, + TranslateModule.forRoot(), MyDSpaceNewExternalDropdownComponent, - ], + TestComponent, + ], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, + { provide: Router, useValue: new RouterStub() }, + MyDSpaceNewExternalDropdownComponent, + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); const html = ``; @@ -176,10 +188,10 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { reload = (event) => { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts index 3dbf1cea53..54830f4198 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts @@ -1,7 +1,25 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; import { Router } from '@angular/router'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; -import { map, mergeMap, take, } from 'rxjs/operators'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + map, + mergeMap, + take, +} from 'rxjs/operators'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; import { FindListOptions } from '../../../core/data/find-list-options.model'; @@ -10,9 +28,6 @@ import { RemoteData } from '../../../core/data/remote-data'; import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; import { hasValue } from '../../../shared/empty.util'; import { EntityDropdownComponent } from '../../../shared/entity-dropdown/entity-dropdown.component'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; /** @@ -28,9 +43,9 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; AsyncPipe, TranslateModule, BrowserOnlyPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MyDSpaceNewExternalDropdownComponent implements OnInit, OnDestroy { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts index 34cd7bd682..9e50556fe3 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts @@ -1,6 +1,15 @@ import { CommonModule } from '@angular/common'; -import { Component, DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; @@ -11,7 +20,10 @@ import { ItemType } from '../../../core/shared/item-relationships/item-type.mode import { PageInfo } from '../../../core/shared/page-info.model'; import { ResourceType } from '../../../core/shared/resource-type'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; -import { createPaginatedList, createTestComponent, } from '../../../shared/testing/utils.test'; +import { + createPaginatedList, + createTestComponent, +} from '../../../shared/testing/utils.test'; import { MyDSpaceNewSubmissionDropdownComponent } from './my-dspace-new-submission-dropdown.component'; export function getMockEntityTypeService(): EntityTypeDataService { @@ -82,19 +94,19 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { describe('With only one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - MyDSpaceNewSubmissionDropdownComponent, - TestComponent - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, - { provide: NgbModal, useValue: modalStub }, + imports: [ + CommonModule, + TranslateModule.forRoot(), MyDSpaceNewSubmissionDropdownComponent, - ], + TestComponent, + ], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, + { provide: NgbModal, useValue: modalStub }, + MyDSpaceNewSubmissionDropdownComponent, + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); const html = ``; @@ -131,19 +143,19 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { describe('With more than one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - MyDSpaceNewSubmissionDropdownComponent, - TestComponent - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - { provide: NgbModal, useValue: modalStub }, + imports: [ + CommonModule, + TranslateModule.forRoot(), MyDSpaceNewSubmissionDropdownComponent, - ], + TestComponent, + ], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, + { provide: NgbModal, useValue: modalStub }, + MyDSpaceNewSubmissionDropdownComponent, + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); const html = ``; @@ -181,10 +193,10 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { reload = (event) => { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts index 4b3518515e..c816a3aa2c 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts @@ -1,21 +1,36 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; - -import { Observable, of as observableOf, Subscription } from 'rxjs'; -import { map, mergeMap, take } from 'rxjs/operators'; -import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + NgbDropdownModule, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + map, + mergeMap, + take, +} from 'rxjs/operators'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; -import { - CreateItemParentSelectorComponent -} from '../../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; +import { CreateItemParentSelectorComponent } from '../../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; import { hasValue } from '../../../shared/empty.util'; import { EntityDropdownComponent } from '../../../shared/entity-dropdown/entity-dropdown.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; /** @@ -31,9 +46,9 @@ import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; AsyncPipe, TranslateModule, BrowserOnlyPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MyDSpaceNewSubmissionDropdownComponent implements OnInit, OnDestroy { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts index 08d5754a0f..ad2ef073d8 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts @@ -51,10 +51,10 @@ describe('MyDSpaceNewSubmissionComponent test', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), @@ -62,8 +62,8 @@ describe('MyDSpaceNewSubmissionComponent test', () => { RouterTestingModule, MyDSpaceNewSubmissionComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -76,9 +76,9 @@ describe('MyDSpaceNewSubmissionComponent test', () => { { provide: CookieService, useValue: new CookieServiceMock() }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -129,11 +129,11 @@ describe('MyDSpaceNewSubmissionComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [NgbModule, - RouterTestingModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [NgbModule, + RouterTestingModule], }) class TestComponent { diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts index a2c95d99a6..8b4ddf10f6 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -23,13 +24,8 @@ import { UploaderComponent } from '../../shared/upload/uploader/uploader.compone import { UploaderError } from '../../shared/upload/uploader/uploader-error.model'; import { UploaderOptions } from '../../shared/upload/uploader/uploader-options.model'; import { CollectionSelectorComponent } from '../collection-selector/collection-selector.component'; -import { - MyDSpaceNewExternalDropdownComponent -} from './my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component'; -import { - MyDSpaceNewSubmissionDropdownComponent -} from './my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component'; -import { NgIf } from '@angular/common'; +import { MyDSpaceNewExternalDropdownComponent } from './my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component'; +import { MyDSpaceNewSubmissionDropdownComponent } from './my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component'; /** * This component represents the whole mydspace page header @@ -42,9 +38,9 @@ import { NgIf } from '@angular/common'; MyDSpaceNewExternalDropdownComponent, MyDSpaceNewSubmissionDropdownComponent, UploaderComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { /** diff --git a/src/app/my-dspace-page/my-dspace-page-routes.ts b/src/app/my-dspace-page/my-dspace-page-routes.ts index 45c23e5cd8..20260a1601 100644 --- a/src/app/my-dspace-page/my-dspace-page-routes.ts +++ b/src/app/my-dspace-page/my-dspace-page-routes.ts @@ -1,20 +1,21 @@ +import { Route } from '@angular/router'; + +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; import { MyDSpaceGuard } from './my-dspace.guard'; import { ThemedMyDSpacePageComponent } from './themed-my-dspace-page.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { Route } from '@angular/router'; -import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; export const ROUTES: Route[] = [ { path: '', component: ThemedMyDSpacePageComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, providers: [provideSuggestionNotifications()], - data: {title: 'mydspace.title', breadcrumbKey: 'mydspace'}, + data: { title: 'mydspace.title', breadcrumbKey: 'mydspace' }, canActivate: [ - MyDSpaceGuard - ] - } + MyDSpaceGuard, + ], + }, ]; diff --git a/src/app/my-dspace-page/my-dspace-page.component.spec.ts b/src/app/my-dspace-page/my-dspace-page.component.spec.ts index a6a444cee0..645c3f129d 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-page.component.spec.ts @@ -1,23 +1,32 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + fakeAsync, + flush, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterTestingModule } from '@angular/router/testing'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { MyDSpacePageComponent, SEARCH_CONFIG_SERVICE, } from './my-dspace-page.component'; +import { RoleService } from '../core/roles/role.service'; import { Context } from '../core/shared/context.model'; import { SearchService } from '../core/shared/search/search.service'; +import { getMockThemeService } from '../shared/mocks/theme-service.mock'; +import { RoleDirective } from '../shared/roles/role.directive'; +import { ThemedSearchComponent } from '../shared/search/themed-search.component'; +import { ThemeService } from '../shared/theme-support/theme.service'; import { MyDSpaceConfigurationService } from './my-dspace-configuration.service'; import { MyDSpaceConfigurationValueType } from './my-dspace-configuration-value-type'; -import { RoleService } from '../core/roles/role.service'; import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component'; -import { RoleDirective } from '../shared/roles/role.directive'; -import { ThemeService } from '../shared/theme-support/theme.service'; -import { getMockThemeService } from '../shared/mocks/theme-service.mock'; -import { ThemedSearchComponent } from '../shared/search/themed-search.component'; +import { + MyDSpacePageComponent, + SEARCH_CONFIG_SERVICE, +} from './my-dspace-page.component'; import SpyObj = jasmine.SpyObj; describe('MyDSpacePageComponent', () => { @@ -29,13 +38,13 @@ describe('MyDSpacePageComponent', () => { 'SearchService', { setServiceOptions: jasmine.createSpy('setServiceOptions'), - } + }, ); const myDSpaceConfigurationServiceStub: SpyObj = jasmine.createSpyObj('MyDSpaceConfigurationService', { getAvailableConfigurationOptions: jasmine.createSpy( - 'getAvailableConfigurationOptions' + 'getAvailableConfigurationOptions', ), }); @@ -54,7 +63,7 @@ describe('MyDSpacePageComponent', () => { beforeEach(waitForAsync(() => { roleService = jasmine.createSpyObj('roleService', { - checkRole: ()=> observableOf(true) + checkRole: ()=> observableOf(true), }); TestBed.configureTestingModule({ imports: [ @@ -63,7 +72,7 @@ describe('MyDSpacePageComponent', () => { NoopAnimationsModule, NgbCollapseModule, MyDSpacePageComponent, - RoleDirective + RoleDirective, ], providers: [ { provide: SearchService, useValue: searchServiceStub }, @@ -98,7 +107,7 @@ describe('MyDSpacePageComponent', () => { fixture = TestBed.createComponent(MyDSpacePageComponent); comp = fixture.componentInstance; // SearchPageComponent test instance myDSpaceConfigurationServiceStub.getAvailableConfigurationOptions.and.returnValue( - observableOf(configurationList) + observableOf(configurationList), ); fixture.detectChanges(); @@ -112,7 +121,7 @@ describe('MyDSpacePageComponent', () => { expect(comp.configurationList$).toBeObservable( cold('(a|)', { a: configurationList, - }) + }), ); flush(); diff --git a/src/app/my-dspace-page/my-dspace-page.component.ts b/src/app/my-dspace-page/my-dspace-page.component.ts index bb78e7804a..dceb1c31d3 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.ts +++ b/src/app/my-dspace-page/my-dspace-page.component.ts @@ -1,27 +1,32 @@ -import { ChangeDetectionStrategy, Component, Inject, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, + OnInit, +} from '@angular/core'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; import { MyDSpaceResponseParsingService } from '../core/data/mydspace-response-parsing.service'; -import { - SearchConfigurationOption -} from '../shared/search/search-switch-configuration/search-configuration-option.model'; -import { MyDSpaceConfigurationService, SEARCH_CONFIG_SERVICE } from './my-dspace-configuration.service'; -import { ViewMode } from '../core/shared/view-mode.model'; import { MyDSpaceRequest } from '../core/data/request.models'; import { RoleType } from '../core/roles/role-types'; import { Context } from '../core/shared/context.model'; import { SearchService } from '../core/shared/search/search.service'; -import { ThemedSearchComponent } from '../shared/search/themed-search.component'; -import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { ViewMode } from '../core/shared/view-mode.model'; +import { SuggestionsNotificationComponent } from '../notifications/suggestions-notification/suggestions-notification.component'; import { RoleDirective } from '../shared/roles/role.directive'; +import { SearchConfigurationOption } from '../shared/search/search-switch-configuration/search-configuration-option.model'; +import { ThemedSearchComponent } from '../shared/search/themed-search.component'; import { - SuggestionsNotificationComponent -} from '../notifications/suggestions-notification/suggestions-notification.component'; -import { - MyDspaceQaEventsNotificationsComponent -} from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; + MyDSpaceConfigurationService, + SEARCH_CONFIG_SERVICE, +} from './my-dspace-configuration.service'; +import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component'; +import { MyDspaceQaEventsNotificationsComponent } from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; export const MYDSPACE_ROUTE = '/mydspace'; @@ -36,8 +41,8 @@ export const MYDSPACE_ROUTE = '/mydspace'; providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: MyDSpaceConfigurationService - } + useClass: MyDSpaceConfigurationService, + }, ], imports: [ ThemedSearchComponent, @@ -46,9 +51,9 @@ export const MYDSPACE_ROUTE = '/mydspace'; RoleDirective, NgIf, SuggestionsNotificationComponent, - MyDspaceQaEventsNotificationsComponent + MyDspaceQaEventsNotificationsComponent, ], - standalone: true + standalone: true, }) export class MyDSpacePageComponent implements OnInit { diff --git a/src/app/my-dspace-page/my-dspace-page.module.ts b/src/app/my-dspace-page/my-dspace-page.module.ts index 946c55927b..b51e5348ff 100644 --- a/src/app/my-dspace-page/my-dspace-page.module.ts +++ b/src/app/my-dspace-page/my-dspace-page.module.ts @@ -1,21 +1,16 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MyDSpacePageComponent } from './my-dspace-page.component'; -import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component'; + import { SearchModule } from '../shared/search/search.module'; import { UploadModule } from '../shared/upload/upload.module'; import { CollectionSelectorComponent } from './collection-selector/collection-selector.component'; import { MyDSpaceGuard } from './my-dspace.guard'; import { MyDSpaceConfigurationService } from './my-dspace-configuration.service'; -import { - MyDSpaceNewSubmissionDropdownComponent -} from './my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component'; -import { - MyDSpaceNewExternalDropdownComponent -} from './my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component'; -import { - MyDspaceQaEventsNotificationsComponent -} from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; +import { MyDSpaceNewExternalDropdownComponent } from './my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component'; +import { MyDSpaceNewSubmissionComponent } from './my-dspace-new-submission/my-dspace-new-submission.component'; +import { MyDSpaceNewSubmissionDropdownComponent } from './my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component'; +import { MyDSpacePageComponent } from './my-dspace-page.component'; +import { MyDspaceQaEventsNotificationsComponent } from './my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; import { ThemedMyDSpacePageComponent } from './themed-my-dspace-page.component'; const DECLARATIONS = [ @@ -29,17 +24,17 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SearchModule, - UploadModule, - ...DECLARATIONS - ], - providers: [ - MyDSpaceGuard, + imports: [ + CommonModule, + SearchModule, + UploadModule, + ...DECLARATIONS, + ], + providers: [ + MyDSpaceGuard, MyDSpaceConfigurationService, - ], - exports: DECLARATIONS + ], + exports: DECLARATIONS, }) /** diff --git a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.spec.ts b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.spec.ts index 71c4f75b1c..c709e6ff0b 100644 --- a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.spec.ts +++ b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.spec.ts @@ -21,12 +21,12 @@ describe('MyDspaceQaEventsNotificationsComponent', () => { getSources: () => obj, }; await TestBed.configureTestingModule({ - imports: [MyDspaceQaEventsNotificationsComponent], - providers: [ + imports: [MyDspaceQaEventsNotificationsComponent], + providers: [ { provide: QualityAssuranceSourceDataService, useValue: qualityAssuranceSourceDataServiceStub }, ], -}) - .compileComponents(); + }) + .compileComponents(); fixture = TestBed.createComponent(MyDspaceQaEventsNotificationsComponent); component = fixture.componentInstance; diff --git a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts index ea3aacec03..9da65fb2e6 100644 --- a/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts +++ b/src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts @@ -1,17 +1,21 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, OnInit, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, of, tap, } from 'rxjs'; import { QualityAssuranceSourceObject } from 'src/app/core/notifications/qa/models/quality-assurance-source.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; import { getNotificatioQualityAssuranceRoute } from '../../admin/admin-routing-paths'; import { QualityAssuranceSourceDataService } from '../../core/notifications/qa/source/quality-assurance-source-data.service'; @@ -31,9 +35,9 @@ import { NgForOf, TranslateModule, RouterLink, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class MyDspaceQaEventsNotificationsComponent implements OnInit { diff --git a/src/app/my-dspace-page/themed-my-dspace-page.component.ts b/src/app/my-dspace-page/themed-my-dspace-page.component.ts index 18577983e3..1198360fbd 100644 --- a/src/app/my-dspace-page/themed-my-dspace-page.component.ts +++ b/src/app/my-dspace-page/themed-my-dspace-page.component.ts @@ -7,10 +7,10 @@ import { MyDSpacePageComponent } from './my-dspace-page.component'; * Themed wrapper for MyDSpacePageComponent */ @Component({ - selector: 'ds-themed-my-dspace-page', - styleUrls: [], - templateUrl: './../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-my-dspace-page', + styleUrls: [], + templateUrl: './../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedMyDSpacePageComponent extends ThemedComponent { diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts index d596068919..6d0d72f0f5 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts @@ -23,13 +23,13 @@ describe('ExpandableNavbarSectionComponent', () => { describe('on larger screens', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], - providers: [ - { provide: 'sectionDataProvider', useValue: {} }, - { provide: MenuService, useValue: menuService }, + imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], + providers: [ + { provide: 'sectionDataProvider', useValue: {} }, + { provide: MenuService, useValue: menuService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, ], -}).overrideComponent(ExpandableNavbarSectionComponent, { + }).overrideComponent(ExpandableNavbarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -189,13 +189,13 @@ describe('ExpandableNavbarSectionComponent', () => { describe('on smaller, mobile screens', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], - providers: [ - { provide: 'sectionDataProvider', useValue: {} }, - { provide: MenuService, useValue: menuService }, + imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], + providers: [ + { provide: 'sectionDataProvider', useValue: {} }, + { provide: MenuService, useValue: menuService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(300) }, ], -}).overrideComponent(ExpandableNavbarSectionComponent, { + }).overrideComponent(ExpandableNavbarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -262,9 +262,9 @@ describe('ExpandableNavbarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { } diff --git a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts index afd3b4ab90..1ddc519869 100644 --- a/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts +++ b/src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component, HostListener, @@ -5,6 +11,7 @@ import { Injector, OnInit, } from '@angular/core'; +import { RouterLinkActive } from '@angular/router'; import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; @@ -12,8 +19,6 @@ import { slide } from '../../shared/animations/slide'; import { HostWindowService } from '../../shared/host-window.service'; import { MenuService } from '../../shared/menu/menu.service'; import { MenuID } from '../../shared/menu/menu-id.model'; -import { NgComponentOutlet, NgIf, NgFor, AsyncPipe } from '@angular/common'; -import { RouterLinkActive } from '@angular/router'; import { VarDirective } from '../../shared/utils/var.directive'; import { NavbarSectionComponent } from '../navbar-section/navbar-section.component'; @@ -21,12 +26,12 @@ import { NavbarSectionComponent } from '../navbar-section/navbar-section.compone * Represents an expandable section in the navbar */ @Component({ - selector: 'ds-expandable-navbar-section', - templateUrl: './expandable-navbar-section.component.html', - styleUrls: ['./expandable-navbar-section.component.scss'], - animations: [slide], - standalone: true, - imports: [VarDirective, RouterLinkActive, NgComponentOutlet, NgIf, NgFor, AsyncPipe] + selector: 'ds-expandable-navbar-section', + templateUrl: './expandable-navbar-section.component.html', + styleUrls: ['./expandable-navbar-section.component.scss'], + animations: [slide], + standalone: true, + imports: [VarDirective, RouterLinkActive, NgComponentOutlet, NgIf, NgFor, AsyncPipe], }) export class ExpandableNavbarSectionComponent extends NavbarSectionComponent implements OnInit { /** diff --git a/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts index 054fd9d52c..2345ef7ab3 100644 --- a/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts +++ b/src/app/navbar/expandable-navbar-section/themed-expandable-navbar-section.component.ts @@ -1,7 +1,5 @@ import { Component } from '@angular/core'; -import { MenuID } from '../../shared/menu/menu-id.model'; -import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator'; import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { ExpandableNavbarSectionComponent } from './expandable-navbar-section.component'; @@ -12,7 +10,7 @@ import { ExpandableNavbarSectionComponent } from './expandable-navbar-section.co selector: 'ds-themed-expandable-navbar-section', styleUrls: [], templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + standalone: true, }) export class ThemedExpandableNavbarSectionComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/navbar/navbar-section/navbar-section.component.spec.ts b/src/app/navbar/navbar-section/navbar-section.component.spec.ts index 99d2e05040..f0765e1070 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.spec.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.spec.ts @@ -20,13 +20,13 @@ describe('NavbarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, NavbarSectionComponent, TestComponent], - providers: [ + imports: [NoopAnimationsModule, NavbarSectionComponent, TestComponent], + providers: [ { provide: 'sectionDataProvider', useValue: {} }, { provide: MenuService, useValue: menuService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, ], -}).overrideComponent(NavbarSectionComponent, { + }).overrideComponent(NavbarSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -50,9 +50,9 @@ describe('NavbarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { } diff --git a/src/app/navbar/navbar-section/navbar-section.component.ts b/src/app/navbar/navbar-section/navbar-section.component.ts index 07cafbe3c9..d231ff570e 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.ts @@ -1,8 +1,16 @@ -import { Component, Inject, Injector, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgComponentOutlet, +} from '@angular/common'; +import { + Component, + Inject, + Injector, + OnInit, +} from '@angular/core'; import { MenuService } from '../../shared/menu/menu.service'; import { MenuID } from '../../shared/menu/menu-id.model'; -import { AsyncPipe, NgComponentOutlet } from '@angular/common'; import { MenuSectionComponent } from '../../shared/menu/menu-section/menu-section.component'; /** @@ -13,7 +21,7 @@ import { MenuSectionComponent } from '../../shared/menu/menu-section/menu-sectio templateUrl: './navbar-section.component.html', styleUrls: ['./navbar-section.component.scss'], standalone: true, - imports: [NgComponentOutlet, AsyncPipe] + imports: [NgComponentOutlet, AsyncPipe], }) export class NavbarSectionComponent extends MenuSectionComponent implements OnInit { /** diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/navbar/navbar.component.spec.ts index 29c7013f80..5ab784f4f5 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/navbar/navbar.component.spec.ts @@ -23,7 +23,10 @@ import { AppState, storeModuleConfig, } from '../app.reducer'; -import { BrowseByDataType } from '../browse-by/browse-by-switcher/browse-by-data-type'; +import { + BrowseByDataType, + BrowseByDataType, +} from '../browse-by/browse-by-switcher/browse-by-data-type'; import { authReducer } from '../core/auth/auth.reducer'; import { AuthTokenInfo } from '../core/auth/models/auth-token-info.model'; import { BrowseService } from '../core/browse/browse.service'; @@ -45,7 +48,6 @@ import { HostWindowServiceStub } from '../shared/testing/host-window-service.stu import { MenuServiceStub } from '../shared/testing/menu-service.stub'; import { ThemeService } from '../shared/theme-support/theme.service'; import { NavbarComponent } from './navbar.component'; -import { BrowseByDataType } from '../browse-by/browse-by-switcher/browse-by-data-type'; let comp: NavbarComponent; let fixture: ComponentFixture; @@ -129,15 +131,15 @@ describe('NavbarComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), NoopAnimationsModule, ReactiveFormsModule, RouterTestingModule, - NavbarComponent - ], - providers: [ + NavbarComponent, + ], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, { provide: MenuService, useValue: menuService }, @@ -146,9 +148,9 @@ describe('NavbarComponent', () => { { provide: BrowseService, useValue: { getBrowseDefinitions: createSuccessfulRemoteDataObject$(buildPaginatedList(undefined, browseDefinitions)) } }, { provide: AuthorizationDataService, useValue: authorizationService }, provideMockStore({ initialState }), - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); // compile template and css })); diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index a20a248954..5e4dbe2ed2 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -1,6 +1,22 @@ -import { Component, Injector, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { select, Store, } from '@ngrx/store'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { + select, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { AppState } from '../app.reducer'; @@ -8,27 +24,27 @@ import { isAuthenticated } from '../core/auth/selectors'; import { BrowseService } from '../core/browse/browse.service'; import { AuthorizationDataService } from '../core/data/feature-authorization/authorization-data.service'; import { slideMobileNav } from '../shared/animations/slide'; -import { HostWindowService, WidthCategory, } from '../shared/host-window.service'; +import { ThemedUserMenuComponent } from '../shared/auth-nav-menu/user-menu/themed-user-menu.component'; +import { UserMenuComponent } from '../shared/auth-nav-menu/user-menu/user-menu.component'; +import { + HostWindowService, + WidthCategory, +} from '../shared/host-window.service'; import { MenuComponent } from '../shared/menu/menu.component'; import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; import { ThemeService } from '../shared/theme-support/theme.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { UserMenuComponent } from '../shared/auth-nav-menu/user-menu/user-menu.component'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/common'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedUserMenuComponent } from '../shared/auth-nav-menu/user-menu/themed-user-menu.component'; /** * Component representing the public navbar */ @Component({ - selector: 'ds-navbar', - styleUrls: ['./navbar.component.scss'], - templateUrl: './navbar.component.html', - animations: [slideMobileNav], - standalone: true, - imports: [NgbDropdownModule, NgClass, NgIf, UserMenuComponent, ThemedUserMenuComponent, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule] + selector: 'ds-navbar', + styleUrls: ['./navbar.component.scss'], + templateUrl: './navbar.component.html', + animations: [slideMobileNav], + standalone: true, + imports: [NgbDropdownModule, NgClass, NgIf, UserMenuComponent, ThemedUserMenuComponent, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule], }) export class NavbarComponent extends MenuComponent implements OnInit { /** diff --git a/src/app/navbar/navbar.module.ts b/src/app/navbar/navbar.module.ts index 0ce89eed98..d86d29891b 100644 --- a/src/app/navbar/navbar.module.ts +++ b/src/app/navbar/navbar.module.ts @@ -5,9 +5,7 @@ import { EffectsModule } from '@ngrx/effects'; import { MenuModule } from '../shared/menu/menu.module'; import { ExpandableNavbarSectionComponent } from './expandable-navbar-section/expandable-navbar-section.component'; -import { - ThemedExpandableNavbarSectionComponent -} from './expandable-navbar-section/themed-expandable-navbar-section.component'; +import { ThemedExpandableNavbarSectionComponent } from './expandable-navbar-section/themed-expandable-navbar-section.component'; import { NavbarComponent } from './navbar.component'; import { NavbarEffects } from './navbar.effects'; import { NavbarSectionComponent } from './navbar-section/navbar-section.component'; @@ -25,19 +23,19 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - MenuModule, - FormsModule, - EffectsModule.forFeature(effects), - ...ENTRY_COMPONENTS, - NavbarComponent, - ThemedNavbarComponent - ], - providers: [], - exports: [ - ThemedNavbarComponent, - NavbarSectionComponent, + imports: [ + CommonModule, + MenuModule, + FormsModule, + EffectsModule.forFeature(effects), + ...ENTRY_COMPONENTS, + NavbarComponent, + ThemedNavbarComponent, + ], + providers: [], + exports: [ + ThemedNavbarComponent, + NavbarSectionComponent, ThemedExpandableNavbarSectionComponent, ], }) diff --git a/src/app/navbar/themed-navbar.component.ts b/src/app/navbar/themed-navbar.component.ts index 9c06c96d28..1d125cf7e6 100644 --- a/src/app/navbar/themed-navbar.component.ts +++ b/src/app/navbar/themed-navbar.component.ts @@ -7,10 +7,10 @@ import { NavbarComponent } from './navbar.component'; * Themed wrapper for NavbarComponent */ @Component({ - selector: 'ds-themed-navbar', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-navbar', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedNavbarComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/notifications/notifications-state.service.ts b/src/app/notifications/notifications-state.service.ts index 2de9720548..d140e4e80a 100644 --- a/src/app/notifications/notifications-state.service.ts +++ b/src/app/notifications/notifications-state.service.ts @@ -29,7 +29,7 @@ import { /** * The service handling the Notifications State. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class NotificationsStateService { /** diff --git a/src/app/notifications/provide-suggestion-notifications.ts b/src/app/notifications/provide-suggestion-notifications.ts index 64c77440dd..80cfebbc4b 100644 --- a/src/app/notifications/provide-suggestion-notifications.ts +++ b/src/app/notifications/provide-suggestion-notifications.ts @@ -1,8 +1,19 @@ -import { importProvidersFrom, makeEnvironmentProviders } from '@angular/core'; +import { + importProvidersFrom, + makeEnvironmentProviders, +} from '@angular/core'; import { EffectsModule } from '@ngrx/effects'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; + import { storeModuleConfig } from '../app.reducer'; -import { suggestionNotificationsReducers, SuggestionNotificationsState } from './notifications.reducer'; +import { + suggestionNotificationsReducers, + SuggestionNotificationsState, +} from './notifications.reducer'; import { notificationsEffects } from './notifications-effects'; export const provideSuggestionNotifications = () => { diff --git a/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.spec.ts b/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.spec.ts index b2edbb9850..ab441be4a0 100644 --- a/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.spec.ts +++ b/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.spec.ts @@ -17,13 +17,13 @@ describe('EPersonDataComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [EPersonDataComponent], - providers: [{ - provide: EPersonDataService, + imports: [EPersonDataComponent], + providers: [{ + provide: EPersonDataService, useValue: ePersonDataService, } ], -}) - .compileComponents(); + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.ts b/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.ts index b550b518b6..8e7667911a 100644 --- a/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.ts +++ b/src/app/notifications/qa/events/ePerson-data/ePerson-data.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -10,7 +14,6 @@ import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../../core/shared/operators'; -import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-eperson-data', @@ -18,7 +21,7 @@ import { AsyncPipe, NgIf } from '@angular/common'; standalone: true, imports: [ NgIf, - AsyncPipe + AsyncPipe, ], styleUrls: ['./ePerson-data.component.scss'], }) diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts index 69f6b42e16..0d96e7e065 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.spec.ts @@ -1,29 +1,44 @@ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthorizationDataService } from 'src/app/core/data/feature-authorization/authorization-data.service'; import { ItemDataService } from 'src/app/core/data/item-data.service'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; -import { - QualityAssuranceEventDataService -} from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; +import { QualityAssuranceEventDataService } from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; import { QualityAssuranceEventObject } from '../../../core/notifications/qa/models/quality-assurance-event.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { PageInfo } from '../../../core/shared/page-info.model'; import { getMockQualityAssuranceEventRestService, - ItemMockPid10, ItemMockPid8, ItemMockPid9, + ItemMockPid10, NotificationsMockDspaceObject, qualityAssuranceEventObjectMissingProjectFound, qualityAssuranceEventObjectMissingProjectNotFound, @@ -104,13 +119,13 @@ describe('QualityAssuranceEventsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), QualityAssuranceEventsComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub(activatedRouteParamsMap, activatedRouteParams) }, { provide: QualityAssuranceEventDataService, useValue: qualityAssuranceEventRestServiceStub }, { provide: NgbModal, useValue: modalStub }, @@ -120,9 +135,9 @@ describe('QualityAssuranceEventsComponent test suite', () => { { provide: ItemDataService, useValue: {} }, { provide: AuthorizationDataService, useValue: {} }, QualityAssuranceEventsComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); scheduler = getTestScheduler(); })); @@ -333,10 +348,10 @@ describe('QualityAssuranceEventsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index d387479add..4a60e6d55c 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -1,21 +1,56 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { ActivatedRoute, RouterLink } from '@angular/router'; -import { NgbModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, combineLatest, from, Observable, of, Subscription, } from 'rxjs'; -import { distinctUntilChanged, last, map, mergeMap, scan, switchMap, take, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, + from, + Observable, + of, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + last, + map, + mergeMap, + scan, + switchMap, + take, + tap, +} from 'rxjs/operators'; import { environment } from '../../../../environments/environment'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { ItemDataService } from '../../../core/data/item-data.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; -import { - QualityAssuranceEventDataService -} from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; +import { QualityAssuranceEventDataService } from '../../../core/notifications/qa/events/quality-assurance-event-data.service'; import { QualityAssuranceEventObject, SourceQualityAssuranceEventMessageObject, @@ -24,32 +59,34 @@ import { PaginationService } from '../../../core/pagination/pagination.service'; import { Item } from '../../../core/shared/item.model'; import { Metadata } from '../../../core/shared/metadata.utils'; import { NoContent } from '../../../core/shared/NoContent.model'; -import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getRemoteDataPayload, +} from '../../../core/shared/operators'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { hasValue } from '../../../shared/empty.util'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemSearchResult } from '../../../shared/object-collection/shared/item-search-result.model'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { followLink } from '../../../shared/utils/follow-link-config.model'; import { ProjectEntryImportModalComponent, QualityAssuranceEventData, } from '../project-entry-import-modal/project-entry-import-modal.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; -import { AlertComponent } from '../../../shared/alert/alert.component'; import { EPersonDataComponent } from './ePerson-data/ePerson-data.component'; /** * Component to display the Quality Assurance event list. */ @Component({ - selector: 'ds-quality-assurance-events', - templateUrl: './quality-assurance-events.component.html', - styleUrls: ['./quality-assurance-events.component.scss'], - standalone: true, - imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule, EPersonDataComponent] + selector: 'ds-quality-assurance-events', + templateUrl: './quality-assurance-events.component.html', + styleUrls: ['./quality-assurance-events.component.scss'], + standalone: true, + imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule, EPersonDataComponent], }) export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { /** diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts index 7b47e49289..8b098a89ee 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts @@ -1,6 +1,15 @@ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { async, ComponentFixture, inject, TestBed, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + async, + ComponentFixture, + inject, + TestBed, +} from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -9,23 +18,25 @@ import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { Item } from '../../../core/shared/item.model'; import { PageInfo } from '../../../core/shared/page-info.model'; import { SearchService } from '../../../core/shared/search/search.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; import { ItemMockPid10, NotificationsMockDspaceObject, qualityAssuranceEventObjectMissingProjectFound, } from '../../../shared/mocks/notifications.mock'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { ThemedSearchResultsComponent } from '../../../shared/search/search-results/themed-search-results.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { getMockSearchService } from '../../../shared/mocks/search-service.mock'; import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; +import { ThemedSearchResultsComponent } from '../../../shared/search/search-results/themed-search-results.component'; +import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; -import { ImportType, ProjectEntryImportModalComponent, } from './project-entry-import-modal.component'; +import { + ImportType, + ProjectEntryImportModalComponent, +} from './project-entry-import-modal.component'; const eventData = { event: qualityAssuranceEventObjectMissingProjectFound, @@ -77,29 +88,29 @@ describe('ProjectEntryImportModalComponent test suite', () => { beforeEach(async (() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), ProjectEntryImportModalComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: SearchService, useValue: searchServiceStub }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub()}, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: SelectableListService, useValue: jasmine.createSpyObj('selectableListService', ['deselect', 'select', 'deselectAll']) }, ProjectEntryImportModalComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ProjectEntryImportModalComponent, { remove: { imports: [ LoadingComponent, ThemedSearchResultsComponent, - AlertComponent - ] - } + AlertComponent, + ], + }, }) .compileComponents().then(); })); @@ -217,10 +228,10 @@ describe('ProjectEntryImportModalComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { eventData = eventData; diff --git a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts index f1604f036a..08e89fec05 100644 --- a/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts +++ b/src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts @@ -1,6 +1,22 @@ -import { Component, EventEmitter, Input, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterLink } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; @@ -11,21 +27,20 @@ import { import { Context } from '../../../core/shared/context.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Item } from '../../../core/shared/item.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { ThemedSearchResultsComponent } from '../../../shared/search/search-results/themed-search-results.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; import { SearchService } from '../../../core/shared/search/search.service'; -import { hasValue, isNotEmpty, } from '../../../shared/empty.util'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; import { CollectionElementLinkType } from '../../../shared/object-collection/collection-element-link.type'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../../../shared/search/models/paginated-search-options.model'; import { SearchResult } from '../../../shared/search/models/search-result.model'; +import { ThemedSearchResultsComponent } from '../../../shared/search/search-results/themed-search-results.component'; /** * The possible types of import for the external entry @@ -85,11 +100,11 @@ export interface QualityAssuranceEventData { } @Component({ - selector: 'ds-project-entry-import-modal', - styleUrls: ['./project-entry-import-modal.component.scss'], - templateUrl: './project-entry-import-modal.component.html', - standalone: true, - imports: [RouterLink, NgIf, FormsModule, LoadingComponent, ThemedSearchResultsComponent, AlertComponent, AsyncPipe, TranslateModule] + selector: 'ds-project-entry-import-modal', + styleUrls: ['./project-entry-import-modal.component.scss'], + templateUrl: './project-entry-import-modal.component.html', + standalone: true, + imports: [RouterLink, NgIf, FormsModule, LoadingComponent, ThemedSearchResultsComponent, AlertComponent, AsyncPipe, TranslateModule], }) /** * Component to display a modal window for linking a project to an Quality Assurance event diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts index 9a3ebd162d..220bf3f74a 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.spec.ts @@ -1,21 +1,29 @@ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; import { getMockNotificationsStateService, qualityAssuranceSourceObjectMoreAbstract, qualityAssuranceSourceObjectMorePid, } from '../../../shared/mocks/notifications.mock'; -import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; import { PaginationComponent } from '../../../shared/pagination/pagination.component'; +import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; import { NotificationsStateService } from '../../notifications-state.service'; import { QualityAssuranceSourceComponent } from './quality-assurance-source.component'; @@ -35,41 +43,41 @@ describe('QualityAssuranceSourceComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), QualityAssuranceSourceComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: NotificationsStateService, useValue: mockNotificationsStateService }, { provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), params: observableOf({}) } }, { provide: PaginationService, useValue: paginationService }, QualityAssuranceSourceComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(QualityAssuranceSourceComponent, { remove: { imports: [ AlertComponent, LoadingComponent, - PaginationComponent - ] - } + PaginationComponent, + ], + }, }) .compileComponents().then(() => { - mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(observableOf([ - qualityAssuranceSourceObjectMorePid, - qualityAssuranceSourceObjectMoreAbstract, - ])); - mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(observableOf(1)); - mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(observableOf(0)); - mockNotificationsStateService.getQualityAssuranceSourceTotals.and.returnValue(observableOf(2)); - mockNotificationsStateService.isQualityAssuranceSourceLoaded.and.returnValue(observableOf(true)); - mockNotificationsStateService.isQualityAssuranceSourceLoading.and.returnValue(observableOf(false)); - mockNotificationsStateService.isQualityAssuranceSourceProcessing.and.returnValue(observableOf(false)); - }); + mockNotificationsStateService.getQualityAssuranceSource.and.returnValue(observableOf([ + qualityAssuranceSourceObjectMorePid, + qualityAssuranceSourceObjectMoreAbstract, + ])); + mockNotificationsStateService.getQualityAssuranceSourceTotalPages.and.returnValue(observableOf(1)); + mockNotificationsStateService.getQualityAssuranceSourceCurrentPage.and.returnValue(observableOf(0)); + mockNotificationsStateService.getQualityAssuranceSourceTotals.and.returnValue(observableOf(2)); + mockNotificationsStateService.isQualityAssuranceSourceLoaded.and.returnValue(observableOf(true)); + mockNotificationsStateService.isQualityAssuranceSourceLoading.and.returnValue(observableOf(false)); + mockNotificationsStateService.isQualityAssuranceSourceProcessing.and.returnValue(observableOf(false)); + }); })); // First test to check the correct component creation @@ -156,10 +164,10 @@ describe('QualityAssuranceSourceComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { diff --git a/src/app/notifications/qa/source/quality-assurance-source.component.ts b/src/app/notifications/qa/source/quality-assurance-source.component.ts index bc602c9754..b43fd597d5 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.component.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.component.ts @@ -1,22 +1,34 @@ -import { Component, OnInit, } from '@angular/core'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, take, } from 'rxjs/operators'; +import { + AsyncPipe, + DatePipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + take, +} from 'rxjs/operators'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { QualityAssuranceSourceObject } from '../../../core/notifications/qa/models/quality-assurance-source.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; -import { - QualityAssuranceSourcePageParams -} from '../../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; +import { QualityAssuranceSourcePageParams } from '../../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { hasValue } from '../../../shared/empty.util'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { NotificationsStateService } from '../../notifications-state.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { AsyncPipe, DatePipe, NgFor, NgIf } from '@angular/common'; -import { AlertComponent } from '../../../shared/alert/alert.component'; /** * Component to display the Quality Assurance source list. @@ -26,7 +38,7 @@ import { AlertComponent } from '../../../shared/alert/alert.component'; templateUrl: './quality-assurance-source.component.html', styleUrls: ['./quality-assurance-source.component.scss'], standalone: true, - imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, AsyncPipe, TranslateModule, DatePipe] + imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, AsyncPipe, TranslateModule, DatePipe], }) export class QualityAssuranceSourceComponent implements OnInit { diff --git a/src/app/notifications/qa/source/quality-assurance-source.service.ts b/src/app/notifications/qa/source/quality-assurance-source.service.ts index 8a9bb46131..d8686bcee2 100644 --- a/src/app/notifications/qa/source/quality-assurance-source.service.ts +++ b/src/app/notifications/qa/source/quality-assurance-source.service.ts @@ -16,7 +16,7 @@ import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; /** * The service handling all Quality Assurance source requests to the REST service. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class QualityAssuranceSourceService { /** diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts index f0b3c1be84..a08e970a29 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts @@ -1,7 +1,15 @@ /* eslint-disable no-empty, @typescript-eslint/no-empty-function */ import { CommonModule } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; @@ -9,18 +17,18 @@ import { of as observableOf } from 'rxjs'; import { ItemDataService } from 'src/app/core/data/item-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; import { getMockNotificationsStateService, qualityAssuranceTopicObjectMoreAbstract, qualityAssuranceTopicObjectMorePid, } from '../../../shared/mocks/notifications.mock'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; import { NotificationsStateService } from '../../notifications-state.service'; import { QualityAssuranceTopicsComponent } from './quality-assurance-topics.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; describe('QualityAssuranceTopicsComponent test suite', () => { let fixture: ComponentFixture; @@ -37,47 +45,47 @@ describe('QualityAssuranceTopicsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), QualityAssuranceTopicsComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: NotificationsStateService, useValue: mockNotificationsStateService }, { provide: ActivatedRoute, useValue: { data: observableOf(activatedRouteParams), snapshot: { params: { sourceId: 'openaire', targetId: null, - }, - } } }, + }, + } } }, { provide: PaginationService, useValue: paginationService }, { provide: ItemDataService, useValue: {} }, QualityAssuranceTopicsComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(QualityAssuranceTopicsComponent, { remove: { imports: [ AlertComponent, LoadingComponent, - PaginationComponent - ] - } + PaginationComponent, + ], + }, }) .compileComponents().then(() => { - mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([ - qualityAssuranceTopicObjectMorePid, - qualityAssuranceTopicObjectMoreAbstract, - ])); - mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1)); - mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0)); - mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2)); - mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true)); - mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false)); - mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false)); - }); + mockNotificationsStateService.getQualityAssuranceTopics.and.returnValue(observableOf([ + qualityAssuranceTopicObjectMorePid, + qualityAssuranceTopicObjectMoreAbstract, + ])); + mockNotificationsStateService.getQualityAssuranceTopicsTotalPages.and.returnValue(observableOf(1)); + mockNotificationsStateService.getQualityAssuranceTopicsCurrentPage.and.returnValue(observableOf(0)); + mockNotificationsStateService.getQualityAssuranceTopicsTotals.and.returnValue(observableOf(2)); + mockNotificationsStateService.isQualityAssuranceTopicsLoaded.and.returnValue(observableOf(true)); + mockNotificationsStateService.isQualityAssuranceTopicsLoading.and.returnValue(observableOf(false)); + mockNotificationsStateService.isQualityAssuranceTopicsProcessing.and.returnValue(observableOf(false)); + }); })); // First test to check the correct component creation @@ -164,10 +172,10 @@ describe('QualityAssuranceTopicsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts index 30d5ea82ef..dbf2e47201 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.component.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.component.ts @@ -1,7 +1,31 @@ -import { AfterViewInit, Component, OnDestroy, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink, } from '@angular/router'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, map, take, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + DatePipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + AfterViewInit, + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + map, + take, + tap, +} from 'rxjs/operators'; import { getNotificatioQualityAssuranceRoute } from '../../../admin/admin-routing-paths'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; @@ -9,29 +33,28 @@ import { ItemDataService } from '../../../core/data/item-data.service'; import { QualityAssuranceTopicObject } from '../../../core/notifications/qa/models/quality-assurance-topic.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { Item } from '../../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; -import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; import { - QualityAssuranceTopicsPageParams -} from '../../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; + getFirstCompletedRemoteData, + getRemoteDataPayload, +} from '../../../core/shared/operators'; +import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; +import { QualityAssuranceTopicsPageParams } from '../../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { hasValue } from '../../../shared/empty.util'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { NotificationsStateService } from '../../notifications-state.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { AsyncPipe, DatePipe, NgFor, NgIf } from '@angular/common'; -import { AlertComponent } from '../../../shared/alert/alert.component'; /** * Component to display the Quality Assurance topic list. */ @Component({ - selector: 'ds-quality-assurance-topic', - templateUrl: './quality-assurance-topics.component.html', - styleUrls: ['./quality-assurance-topics.component.scss'], - standalone: true, - imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, AsyncPipe, TranslateModule, DatePipe] + selector: 'ds-quality-assurance-topic', + templateUrl: './quality-assurance-topics.component.html', + styleUrls: ['./quality-assurance-topics.component.scss'], + standalone: true, + imports: [AlertComponent, NgIf, LoadingComponent, PaginationComponent, NgFor, RouterLink, AsyncPipe, TranslateModule, DatePipe], }) export class QualityAssuranceTopicsComponent implements OnInit, OnDestroy, AfterViewInit { /** diff --git a/src/app/notifications/qa/topics/quality-assurance-topics.service.ts b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts index de07625a58..f7f7103746 100644 --- a/src/app/notifications/qa/topics/quality-assurance-topics.service.ts +++ b/src/app/notifications/qa/topics/quality-assurance-topics.service.ts @@ -18,7 +18,7 @@ import { hasValue } from '../../../shared/empty.util'; /** * The service handling all Quality Assurance topic requests to the REST service. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class QualityAssuranceTopicsService { /** diff --git a/src/app/notifications/suggestion-actions/suggestion-actions.component.ts b/src/app/notifications/suggestion-actions/suggestion-actions.component.ts index 100af73637..666d22d57f 100644 --- a/src/app/notifications/suggestion-actions/suggestion-actions.component.ts +++ b/src/app/notifications/suggestion-actions/suggestion-actions.component.ts @@ -1,17 +1,23 @@ -import { Component, EventEmitter, Input, Output, } from '@angular/core'; -import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + Output, +} from '@angular/core'; +import { + NgbDropdownModule, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { take } from 'rxjs/operators'; import { Suggestion } from '../../core/notifications/models/suggestion.model'; -import { EntityDropdownComponent } from '../../shared/entity-dropdown/entity-dropdown.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; -import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-approve-and-import'; import { Collection } from '../../core/shared/collection.model'; import { ItemType } from '../../core/shared/item-relationships/item-type.model'; -import { - CreateItemParentSelectorComponent -} from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; +import { CreateItemParentSelectorComponent } from '../../shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; +import { EntityDropdownComponent } from '../../shared/entity-dropdown/entity-dropdown.component'; +import { SuggestionApproveAndImport } from '../suggestion-list-element/suggestion-approve-and-import'; /** * Show and trigger the actions to submit for a suggestion @@ -24,9 +30,9 @@ import { EntityDropdownComponent, TranslateModule, NgIf, - NgbDropdownModule + NgbDropdownModule, ], - standalone: true + standalone: true, }) export class SuggestionActionsComponent { diff --git a/src/app/notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component.ts b/src/app/notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component.ts index ce2b7e22d5..265ab1d5a2 100644 --- a/src/app/notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component.ts +++ b/src/app/notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component.ts @@ -1,14 +1,13 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { SuggestionEvidences } from '../../../core/notifications/models/suggestion.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; -import { ObjectKeysPipe } from '../../../shared/utils/object-keys-pipe'; - import { fadeIn } from '../../../shared/animations/fade'; +import { ObjectKeysPipe } from '../../../shared/utils/object-keys-pipe'; /** * Show suggestion evidences such as score (authorScore, dateScore) @@ -21,9 +20,9 @@ import { fadeIn } from '../../../shared/animations/fade'; imports: [ TranslateModule, NgIf, - ObjectKeysPipe + ObjectKeysPipe, ], - standalone: true + standalone: true, }) export class SuggestionEvidencesComponent { diff --git a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.spec.ts b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.spec.ts index cf54c0e2d2..ce52e016ff 100644 --- a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.spec.ts +++ b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.spec.ts @@ -21,15 +21,15 @@ describe('SuggestionListElementComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - SuggestionListElementComponent - ], - providers: [ + SuggestionListElementComponent, + ], + providers: [ NgbModal, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); beforeEach(() => { diff --git a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts index ac67701fbe..67b7254f91 100644 --- a/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts +++ b/src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts @@ -6,18 +6,16 @@ import { Output, } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Suggestion } from 'src/app/core/notifications/models/suggestion.model'; +import { ItemSearchResultListElementComponent } from '../../../themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { Item } from '../../core/shared/item.model'; import { fadeIn } from '../../shared/animations/fade'; import { isNotEmpty } from '../../shared/empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ItemSearchResultListElementComponent -} from '../../../themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { SuggestionActionsComponent } from '../suggestion-actions/suggestion-actions.component'; -import { SuggestionEvidencesComponent } from './suggestion-evidences/suggestion-evidences.component'; import { SuggestionApproveAndImport } from './suggestion-approve-and-import'; +import { SuggestionEvidencesComponent } from './suggestion-evidences/suggestion-evidences.component'; /** * Show all the suggestions by researcher @@ -31,9 +29,9 @@ import { SuggestionApproveAndImport } from './suggestion-approve-and-import'; TranslateModule, ItemSearchResultListElementComponent, SuggestionActionsComponent, - SuggestionEvidencesComponent + SuggestionEvidencesComponent, ], - standalone: true + standalone: true, }) export class SuggestionListElementComponent implements OnInit { diff --git a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts index 9161459f3a..700aa9631a 100644 --- a/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts +++ b/src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts @@ -1,19 +1,35 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + take, +} from 'rxjs/operators'; import { SuggestionTarget } from '../../../core/notifications/models/suggestion-target.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { hasValue } from '../../../shared/empty.util'; +import { LoadingComponent } from '../../../shared/loading/loading.component'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; import { getSuggestionPageRoute } from '../../../suggestions-page/suggestions-page-routing-paths'; import { SuggestionsService } from '../../suggestions.service'; import { SuggestionTargetsStateService } from '../suggestion-targets.state.service'; -import { LoadingComponent } from '../../../shared/loading/loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; /** * Component to display the Suggestion Target list. @@ -28,9 +44,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo TranslateModule, PaginationComponent, NgIf, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) export class PublicationClaimComponent implements OnInit { diff --git a/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts b/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts index a7ca4c6b63..d011bbe34d 100644 --- a/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts +++ b/src/app/notifications/suggestion-targets/suggestion-targets.state.service.ts @@ -27,7 +27,7 @@ import { /** * The service handling the Suggestion targets State. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SuggestionTargetsStateService { /** diff --git a/src/app/notifications/suggestions-notification/suggestions-notification.component.ts b/src/app/notifications/suggestions-notification/suggestions-notification.component.ts index 190b29075f..11fbf2ea4c 100644 --- a/src/app/notifications/suggestions-notification/suggestions-notification.component.ts +++ b/src/app/notifications/suggestions-notification/suggestions-notification.component.ts @@ -1,10 +1,17 @@ -import { Component, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { SuggestionTarget } from '../../core/notifications/models/suggestion-target.model'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service'; import { SuggestionsService } from '../suggestions.service'; @@ -20,7 +27,7 @@ import { SuggestionsService } from '../suggestions.service'; TranslateModule, AsyncPipe, NgIf, - NgForOf + NgForOf, ], styleUrls: ['./suggestions-notification.component.scss'], }) diff --git a/src/app/notifications/suggestions-popup/suggestions-popup.component.spec.ts b/src/app/notifications/suggestions-popup/suggestions-popup.component.spec.ts index 70f6b68f61..e4263e7f46 100644 --- a/src/app/notifications/suggestions-popup/suggestions-popup.component.spec.ts +++ b/src/app/notifications/suggestions-popup/suggestions-popup.component.spec.ts @@ -31,14 +31,14 @@ describe('SuggestionsPopupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SuggestionsPopupComponent], - providers: [ + imports: [TranslateModule.forRoot(), SuggestionsPopupComponent], + providers: [ { provide: SuggestionTargetsStateService, useValue: suggestionStateService }, { provide: SuggestionsService, useValue: suggestionService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .compileComponents(); })); describe('should create', () => { diff --git a/src/app/notifications/suggestions-popup/suggestions-popup.component.ts b/src/app/notifications/suggestions-popup/suggestions-popup.component.ts index 9e8be2a43b..2b2f67c58c 100644 --- a/src/app/notifications/suggestions-popup/suggestions-popup.component.ts +++ b/src/app/notifications/suggestions-popup/suggestions-popup.component.ts @@ -1,12 +1,28 @@ import { trigger } from '@angular/animations'; -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { combineLatest, Observable, of, Subject, } from 'rxjs'; -import { take, takeUntil, } from 'rxjs/operators'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest, + Observable, + of, + Subject, +} from 'rxjs'; +import { + take, + takeUntil, +} from 'rxjs/operators'; import { SuggestionTarget } from '../../core/notifications/models/suggestion-target.model'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; import { fromTopEnter } from '../../shared/animations/fromTop'; import { isNotEmpty } from '../../shared/empty.util'; import { SuggestionTargetsStateService } from '../suggestion-targets/suggestion-targets.state.service'; @@ -29,9 +45,9 @@ import { SuggestionsService } from '../suggestions.service'; TranslateModule, RouterLink, NgIf, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class SuggestionsPopupComponent implements OnInit, OnDestroy { diff --git a/src/app/notifications/suggestions.service.ts b/src/app/notifications/suggestions.service.ts index 0e9a6706f9..bb999259ad 100644 --- a/src/app/notifications/suggestions.service.ts +++ b/src/app/notifications/suggestions.service.ts @@ -54,7 +54,7 @@ export interface SuggestionBulkResult { /** * The service handling all Suggestion Target requests to the REST service. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SuggestionsService { /** diff --git a/src/app/page-error/page-error.component.spec.ts b/src/app/page-error/page-error.component.spec.ts index 5294e7947f..47ce42c950 100644 --- a/src/app/page-error/page-error.component.spec.ts +++ b/src/app/page-error/page-error.component.spec.ts @@ -1,7 +1,14 @@ -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; @@ -19,19 +26,19 @@ describe('PageErrorComponent', () => { }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - PageErrorComponent - ], - providers: [ + PageErrorComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, ], -}).compileComponents(); + }).compileComponents(); fixture = TestBed.createComponent(PageErrorComponent); component = fixture.componentInstance; diff --git a/src/app/page-error/page-error.component.ts b/src/app/page-error/page-error.component.ts index 69f1846747..f53e4ed2b4 100644 --- a/src/app/page-error/page-error.component.ts +++ b/src/app/page-error/page-error.component.ts @@ -1,4 +1,7 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; @@ -6,12 +9,12 @@ import { TranslateModule } from '@ngx-translate/core'; * This component representing the `PageError` DSpace page. */ @Component({ - selector: 'ds-page-error', - styleUrls: ['./page-error.component.scss'], - templateUrl: './page-error.component.html', - changeDetection: ChangeDetectionStrategy.Default, - standalone: true, - imports: [TranslateModule] + selector: 'ds-page-error', + styleUrls: ['./page-error.component.scss'], + templateUrl: './page-error.component.html', + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [TranslateModule], }) export class PageErrorComponent { status: number; diff --git a/src/app/page-error/themed-page-error.component.ts b/src/app/page-error/themed-page-error.component.ts index 7323288433..2e0e94d898 100644 --- a/src/app/page-error/themed-page-error.component.ts +++ b/src/app/page-error/themed-page-error.component.ts @@ -7,10 +7,10 @@ import { PageErrorComponent } from './page-error.component'; * Themed wrapper for PageErrorComponent */ @Component({ - selector: 'ds-themed-page-error', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-page-error', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedPageErrorComponent extends ThemedComponent { diff --git a/src/app/page-internal-server-error/page-internal-server-error.component.ts b/src/app/page-internal-server-error/page-internal-server-error.component.ts index fa75450aa0..72d424fd20 100644 --- a/src/app/page-internal-server-error/page-internal-server-error.component.ts +++ b/src/app/page-internal-server-error/page-internal-server-error.component.ts @@ -1,18 +1,21 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { ServerResponseService } from '../core/services/server-response.service'; -import { TranslateModule } from '@ngx-translate/core'; /** * This component representing the `PageInternalServer` DSpace page. */ @Component({ - selector: 'ds-page-internal-server-error', - styleUrls: ['./page-internal-server-error.component.scss'], - templateUrl: './page-internal-server-error.component.html', - changeDetection: ChangeDetectionStrategy.Default, - standalone: true, - imports: [TranslateModule] + selector: 'ds-page-internal-server-error', + styleUrls: ['./page-internal-server-error.component.scss'], + templateUrl: './page-internal-server-error.component.html', + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [TranslateModule], }) export class PageInternalServerErrorComponent { diff --git a/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts b/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts index 56f830b10d..41be907e19 100644 --- a/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts +++ b/src/app/page-internal-server-error/themed-page-internal-server-error.component.ts @@ -7,10 +7,10 @@ import { PageInternalServerErrorComponent } from './page-internal-server-error.c * Themed wrapper for PageInternalServerErrorComponent */ @Component({ - selector: 'ds-themed-page-internal-server-error', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-page-internal-server-error', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedPageInternalServerErrorComponent extends ThemedComponent { diff --git a/src/app/pagenotfound/pagenotfound.component.ts b/src/app/pagenotfound/pagenotfound.component.ts index 3f58c41493..e28f7992b2 100644 --- a/src/app/pagenotfound/pagenotfound.component.ts +++ b/src/app/pagenotfound/pagenotfound.component.ts @@ -1,20 +1,24 @@ -import { ChangeDetectionStrategy, Component, OnInit, } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { AuthService } from '../core/auth/auth.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; import { ServerResponseService } from '../core/services/server-response.service'; /** * This component representing the `PageNotFound` DSpace page. */ @Component({ - selector: 'ds-pagenotfound', - styleUrls: ['./pagenotfound.component.scss'], - templateUrl: './pagenotfound.component.html', - changeDetection: ChangeDetectionStrategy.Default, - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-pagenotfound', + styleUrls: ['./pagenotfound.component.scss'], + templateUrl: './pagenotfound.component.html', + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [RouterLink, TranslateModule], }) export class PageNotFoundComponent implements OnInit { diff --git a/src/app/pagenotfound/themed-pagenotfound.component.ts b/src/app/pagenotfound/themed-pagenotfound.component.ts index 5d3e7aece6..114ad27f81 100644 --- a/src/app/pagenotfound/themed-pagenotfound.component.ts +++ b/src/app/pagenotfound/themed-pagenotfound.component.ts @@ -7,10 +7,10 @@ import { PageNotFoundComponent } from './pagenotfound.component'; * Themed wrapper for PageNotFoundComponent */ @Component({ - selector: 'ds-themed-pagenotfound', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-pagenotfound', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedPageNotFoundComponent extends ThemedComponent { diff --git a/src/app/process-page/detail/process-detail-field/process-detail-field.component.spec.ts b/src/app/process-page/detail/process-detail-field/process-detail-field.component.spec.ts index 28e19d0b9b..f531cce09a 100644 --- a/src/app/process-page/detail/process-detail-field/process-detail-field.component.spec.ts +++ b/src/app/process-page/detail/process-detail-field/process-detail-field.component.spec.ts @@ -1,5 +1,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -17,10 +21,10 @@ describe('ProcessDetailFieldComponent', () => { title = 'fake.title.message'; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProcessDetailFieldComponent, VarDirective], - providers: [], - schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProcessDetailFieldComponent, VarDirective], + providers: [], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts b/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts index 07e11eae57..3a3926340d 100644 --- a/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts +++ b/src/app/process-page/detail/process-detail-field/process-detail-field.component.ts @@ -1,11 +1,14 @@ -import { Component, Input, } from '@angular/core'; +import { + Component, + Input, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-process-detail-field', - templateUrl: './process-detail-field.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-process-detail-field', + templateUrl: './process-detail-field.component.html', + standalone: true, + imports: [TranslateModule], }) /** * A component displaying a single detail about a DSpace Process diff --git a/src/app/process-page/detail/process-detail.component.spec.ts b/src/app/process-page/detail/process-detail.component.spec.ts index 1f5c19f142..6f3cd96dc3 100644 --- a/src/app/process-page/detail/process-detail.component.spec.ts +++ b/src/app/process-page/detail/process-detail.component.spec.ts @@ -11,12 +11,15 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, RouterLink, RouterModule, } from '@angular/router'; +import { + ActivatedRoute, + Router, + RouterLink, + RouterModule, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { ProcessDetailFieldComponent } from './process-detail-field/process-detail-field.component'; -import { Process } from '../processes/process.model'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; @@ -25,20 +28,25 @@ import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { ProcessDataService } from '../../core/data/processes/process-data.service'; import { Bitstream } from '../../core/shared/bitstream.model'; -import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { getProcessListRoute } from '../process-page-routing.paths'; import { ThemedFileDownloadLinkComponent } from '../../shared/file-download-link/themed-file-download-link.component'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { AuthServiceMock } from '../../shared/mocks/auth.service.mock'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../shared/remote-data.utils'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../shared/testing/router.stub'; import { createPaginatedList } from '../../shared/testing/utils.test'; import { FileSizePipe } from '../../shared/utils/file-size-pipe'; import { HasNoValuePipe } from '../../shared/utils/has-no-value.pipe'; import { VarDirective } from '../../shared/utils/var.directive'; +import { getProcessListRoute } from '../process-page-routing.paths'; +import { Process } from '../processes/process.model'; import { ProcessDetailComponent } from './process-detail.component'; +import { ProcessDetailFieldComponent } from './process-detail-field/process-detail-field.component'; describe('ProcessDetailComponent', () => { let component: ProcessDetailComponent; @@ -144,14 +152,14 @@ describe('ProcessDetailComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - RouterTestingModule, - RouterModule.forRoot([]), - ProcessDetailComponent, ProcessDetailFieldComponent, - VarDirective, FileSizePipe, - HasNoValuePipe,], - providers: [ + imports: [ + TranslateModule.forRoot(), + RouterTestingModule, + RouterModule.forRoot([]), + ProcessDetailComponent, ProcessDetailFieldComponent, + VarDirective, FileSizePipe, + HasNoValuePipe], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: ProcessDataService, useValue: processService }, { provide: BitstreamDataService, useValue: bitstreamDataService }, @@ -161,16 +169,16 @@ describe('ProcessDetailComponent', () => { { provide: NgbModal, useValue: modalService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Router, useValue: router }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .overrideComponent(ProcessDetailComponent, { remove: { imports: [ - ProcessDetailFieldComponent, - ThemedFileDownloadLinkComponent, - ThemedLoadingComponent, - RouterLink - ]} + ProcessDetailFieldComponent, + ThemedFileDownloadLinkComponent, + ThemedLoadingComponent, + RouterLink, + ] }, }) .compileComponents(); })); diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index 83bbaa3c42..b0f841b4e0 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -1,11 +1,46 @@ -import { AsyncPipe, DatePipe, isPlatformBrowser, NgFor, NgIf } from '@angular/common'; +import { + AsyncPipe, + DatePipe, + isPlatformBrowser, + NgFor, + NgIf, +} from '@angular/common'; import { HttpClient } from '@angular/common/http'; -import { Component, Inject, NgZone, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { filter, finalize, find, map, startWith, switchMap, take, tap } from 'rxjs/operators'; -import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + Inject, + NgZone, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; +import { + filter, + finalize, + find, + map, + startWith, + switchMap, + take, + tap, +} from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -25,22 +60,22 @@ import { import { URLCombiner } from '../../core/url-combiner/url-combiner'; import { AlertType } from '../../shared/alert/alert-type'; import { hasValue } from '../../shared/empty.util'; +import { ThemedFileDownloadLinkComponent } from '../../shared/file-download-link/themed-file-download-link.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { FileSizePipe } from '../../shared/utils/file-size-pipe'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedFileDownloadLinkComponent } from '../../shared/file-download-link/themed-file-download-link.component'; import { VarDirective } from '../../shared/utils/var.directive'; -import { ProcessDetailFieldComponent } from './process-detail-field/process-detail-field.component'; import { PROCESS_PAGE_FOLLOW_LINKS } from '../process-page.resolver'; import { getProcessListRoute } from '../process-page-routing.paths'; import { Process } from '../processes/process.model'; import { ProcessStatus } from '../processes/process-status.model'; +import { ProcessDetailFieldComponent } from './process-detail-field/process-detail-field.component'; @Component({ - selector: 'ds-process-detail', - templateUrl: './process-detail.component.html', - standalone: true, - imports: [NgIf, ProcessDetailFieldComponent, NgFor, VarDirective, ThemedFileDownloadLinkComponent, ThemedLoadingComponent, RouterLink, AsyncPipe, DatePipe, FileSizePipe, TranslateModule] + selector: 'ds-process-detail', + templateUrl: './process-detail.component.html', + standalone: true, + imports: [NgIf, ProcessDetailFieldComponent, NgFor, VarDirective, ThemedFileDownloadLinkComponent, ThemedLoadingComponent, RouterLink, AsyncPipe, DatePipe, FileSizePipe, TranslateModule], }) /** * A component displaying detailed information about a DSpace Process diff --git a/src/app/process-page/form/process-form.component.spec.ts b/src/app/process-page/form/process-form.component.spec.ts index 1b5d510b91..c8f49b514c 100644 --- a/src/app/process-page/form/process-form.component.spec.ts +++ b/src/app/process-page/form/process-form.component.spec.ts @@ -1,22 +1,32 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { ScriptDataService } from '../../core/data/processes/script-data.service'; import { RequestService } from '../../core/data/request.service'; +import { RouterMock } from '../../shared/mocks/router.mock'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { ScriptsSelectComponent } from './scripts-select/scripts-select.component'; -import { RouterMock } from '../../shared/mocks/router.mock'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { ProcessParameter } from '../processes/process-parameter.model'; import { Script } from '../scripts/script.model'; import { ScriptParameter } from '../scripts/script-parameter.model'; import { ProcessFormComponent } from './process-form.component'; +import { ScriptsSelectComponent } from './scripts-select/scripts-select.component'; describe('ProcessFormComponent', () => { let component: ProcessFormComponent; @@ -62,7 +72,7 @@ describe('ProcessFormComponent', () => { useClass: TranslateLoaderMock, }, }), - ProcessFormComponent + ProcessFormComponent, ], providers: [ { provide: ScriptDataService, useValue: scriptService }, @@ -76,9 +86,9 @@ describe('ProcessFormComponent', () => { .overrideComponent(ProcessFormComponent, { remove: { imports: [ - ScriptsSelectComponent - ] - } + ScriptsSelectComponent, + ], + }, }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-form.component.ts b/src/app/process-page/form/process-form.component.ts index 7fc66750cd..d361926bc7 100644 --- a/src/app/process-page/form/process-form.component.ts +++ b/src/app/process-page/form/process-form.component.ts @@ -1,31 +1,49 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Script } from '../scripts/script.model'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + FormsModule, + NgForm, +} from '@angular/forms'; +import { + NavigationExtras, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; + +import { ScriptDataService } from '../../core/data/processes/script-data.service'; +import { RemoteData } from '../../core/data/remote-data'; +import { getFirstCompletedRemoteData } from '../../core/shared/operators'; +import { isEmpty } from '../../shared/empty.util'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { getProcessListRoute } from '../process-page-routing.paths'; import { Process } from '../processes/process.model'; import { ProcessParameter } from '../processes/process-parameter.model'; -import { ScriptDataService } from '../../core/data/processes/script-data.service'; -import { FormsModule, NgForm } from '@angular/forms'; +import { Script } from '../scripts/script.model'; import { ScriptParameter } from '../scripts/script-parameter.model'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NavigationExtras, Router, RouterLink } from '@angular/router'; -import { getFirstCompletedRemoteData } from '../../core/shared/operators'; -import { RemoteData } from '../../core/data/remote-data'; -import { isEmpty } from '../../shared/empty.util'; -import { NgFor, NgIf } from '@angular/common'; -import { ScriptHelpComponent } from './script-help/script-help.component'; import { ProcessParametersComponent } from './process-parameters/process-parameters.component'; +import { ScriptHelpComponent } from './script-help/script-help.component'; import { ScriptsSelectComponent } from './scripts-select/scripts-select.component'; -import { getProcessListRoute } from '../process-page-routing.paths'; /** * Component to create a new script */ @Component({ - selector: 'ds-process-form', - templateUrl: './process-form.component.html', - styleUrls: ['./process-form.component.scss'], - standalone: true, - imports: [FormsModule, ScriptsSelectComponent, ProcessParametersComponent, RouterLink, ScriptHelpComponent, NgIf, NgFor, TranslateModule] + selector: 'ds-process-form', + templateUrl: './process-form.component.html', + styleUrls: ['./process-form.component.scss'], + standalone: true, + imports: [FormsModule, ScriptsSelectComponent, ProcessParametersComponent, RouterLink, ScriptHelpComponent, NgIf, NgFor, TranslateModule], }) export class ProcessFormComponent implements OnInit { /** diff --git a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts index 149ee773d3..09bb0adece 100644 --- a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts @@ -1,13 +1,21 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ParameterSelectComponent } from './parameter-select.component'; -import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + Pipe, + PipeTransform, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; +import { of as observableOf } from 'rxjs'; import { ScriptParameter } from '../../../scripts/script-parameter.model'; import { ScriptParameterType } from '../../../scripts/script-parameter-type.model'; import { ParameterValueInputComponent } from '../parameter-value-input/parameter-value-input.component'; -import { of as observableOf } from 'rxjs'; +import { ParameterSelectComponent } from './parameter-select.component'; describe('ParameterSelectComponent', () => { let component: ParameterSelectComponent; @@ -15,7 +23,7 @@ describe('ParameterSelectComponent', () => { let scriptParams: ScriptParameter[]; const translateServiceStub = { - get: () => observableOf('---') + get: () => observableOf('---'), }; function init() { @@ -39,16 +47,16 @@ describe('ParameterSelectComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [FormsModule, ParameterSelectComponent], - schemas: [NO_ERRORS_SCHEMA], -}) + imports: [FormsModule, ParameterSelectComponent], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ParameterSelectComponent, { remove: { - imports: [ParameterValueInputComponent] + imports: [ParameterValueInputComponent], }, add: { - imports: [MockTranslatePipe] - } + imports: [MockTranslatePipe], + }, }) .compileComponents(); })); @@ -86,7 +94,7 @@ describe('ParameterSelectComponent', () => { @Pipe({ // eslint-disable-next-line @angular-eslint/pipe-prefix name: 'translate', - standalone: true + standalone: true, }) class MockTranslatePipe implements PipeTransform { transform(value: string): string { diff --git a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts index ecc0080e89..170274c536 100644 --- a/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts @@ -1,27 +1,40 @@ -import { Component, EventEmitter, Input, Optional, Output, } from '@angular/core'; -import { ControlContainer, FormsModule, NgForm, } from '@angular/forms'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + Optional, + Output, +} from '@angular/core'; +import { + ControlContainer, + FormsModule, + NgForm, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { ProcessParameter } from '../../../processes/process-parameter.model'; import { ScriptParameter } from '../../../scripts/script-parameter.model'; -import { ParameterValueInputComponent } from '../parameter-value-input/parameter-value-input.component'; -import { NgFor, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { controlContainerFactory } from '../../process-form.component'; +import { ParameterValueInputComponent } from '../parameter-value-input/parameter-value-input.component'; /** * Component to select a single parameter for a process */ @Component({ - selector: 'ds-parameter-select', - templateUrl: './parameter-select.component.html', - styleUrls: ['./parameter-select.component.scss'], - viewProviders: [{ - provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] - }], - standalone: true, - imports: [FormsModule, NgFor, ParameterValueInputComponent, NgIf, TranslateModule] + selector: 'ds-parameter-select', + templateUrl: './parameter-select.component.html', + styleUrls: ['./parameter-select.component.scss'], + viewProviders: [{ + provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]], + }], + standalone: true, + imports: [FormsModule, NgFor, ParameterValueInputComponent, NgIf, TranslateModule], }) export class ParameterSelectComponent { @Input() index: number; diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.spec.ts index 3a3fcfd15d..18a22760c0 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.spec.ts @@ -13,8 +13,8 @@ describe('BooleanValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [BooleanValueInputComponent, TranslateModule.forRoot()], -}) + imports: [BooleanValueInputComponent, TranslateModule.forRoot()], + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts index 9c7ad2fd67..1c3289f4e8 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts @@ -7,8 +7,8 @@ import { ControlContainer, NgForm, } from '@angular/forms'; - import { TranslateModule } from '@ngx-translate/core'; + import { controlContainerFactory } from '../../../process-form-factory'; import { ValueInputComponent } from '../value-input.component'; @@ -16,14 +16,14 @@ import { ValueInputComponent } from '../value-input.component'; * Represents the value of a boolean parameter */ @Component({ - selector: 'ds-boolean-value-input', - templateUrl: './boolean-value-input.component.html', - styleUrls: ['./boolean-value-input.component.scss'], - imports: [TranslateModule], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true + selector: 'ds-boolean-value-input', + templateUrl: './boolean-value-input.component.html', + styleUrls: ['./boolean-value-input.component.scss'], + imports: [TranslateModule], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, }) export class BooleanValueInputComponent extends ValueInputComponent implements OnInit { ngOnInit() { diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.spec.ts index 4995ff4f74..9909ddf41f 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.spec.ts @@ -21,17 +21,17 @@ describe('DateValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - DateValueInputComponent - ], -}) + DateValueInputComponent, + ], + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts index 3ff2d95d59..1c8edfbb34 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts @@ -1,34 +1,40 @@ -import { Component, Input, Optional } from '@angular/core'; -import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; -import { TranslateModule } from '@ngx-translate/core'; import { NgIf } from '@angular/common'; -import { controlContainerFactory } from '../../../process-form-factory'; import { + Component, Component, Input, + Input, + Optional, Optional, } from '@angular/core'; import { ControlContainer, + ControlContainer, + FormsModule, + NgForm, NgForm, } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { controlContainerFactory } from '../../../process-form.component'; -import { ValueInputComponent } from '../value-input.component'; +import { controlContainerFactory } from '../../../process-form-factory'; +import { + ValueInputComponent, + ValueInputComponent, +} from '../value-input.component'; /** * Represents the user inputted value of a date parameter */ @Component({ - selector: 'ds-date-value-input', - templateUrl: './date-value-input.component.html', - styleUrls: ['./date-value-input.component.scss'], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true, - imports: [FormsModule, NgIf, TranslateModule] + selector: 'ds-date-value-input', + templateUrl: './date-value-input.component.html', + styleUrls: ['./date-value-input.component.scss'], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, + imports: [FormsModule, NgIf, TranslateModule], }) export class DateValueInputComponent extends ValueInputComponent { /** diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.spec.ts index 1b75c26cb2..a8ad1bbf09 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.spec.ts @@ -22,18 +22,18 @@ describe('FileValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - FileValueInputComponent, FileValueAccessorDirective, FileValidator - ], - schemas: [NO_ERRORS_SCHEMA], -}) + FileValueInputComponent, FileValueAccessorDirective, FileValidator, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts index fcc141d697..b096144ce0 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts @@ -1,25 +1,32 @@ -import { Component, Optional } from '@angular/core'; -import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, FormsModule, NgForm } from '@angular/forms'; -import { TranslateModule } from '@ngx-translate/core'; import { NgIf } from '@angular/common'; -import { FileValidator } from '../../../../../shared/utils/require-file.validator'; -import { FileValueAccessorDirective } from '../../../../../shared/utils/file-value-accessor.directive'; +import { + Component, + Optional, +} from '@angular/core'; +import { + ControlContainer, + FormsModule, + NgForm, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; +import { FileValueAccessorDirective } from '../../../../../shared/utils/file-value-accessor.directive'; +import { FileValidator } from '../../../../../shared/utils/require-file.validator'; import { controlContainerFactory } from '../../../process-form.component'; +import { ValueInputComponent } from '../value-input.component'; /** * Represents the user inputted value of a file parameter */ @Component({ - selector: 'ds-file-value-input', - templateUrl: './file-value-input.component.html', - styleUrls: ['./file-value-input.component.scss'], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true, - imports: [FileValueAccessorDirective, FormsModule, FileValidator, NgIf, TranslateModule] + selector: 'ds-file-value-input', + templateUrl: './file-value-input.component.html', + styleUrls: ['./file-value-input.component.scss'], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, + imports: [FileValueAccessorDirective, FormsModule, FileValidator, NgIf, TranslateModule], }) export class FileValueInputComponent extends ValueInputComponent { /** diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.spec.ts index 2f041d4413..cb8231a9ed 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.spec.ts @@ -1,8 +1,15 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; import { FileValueAccessorDirective } from '../../../../shared/utils/file-value-accessor.directive'; @@ -35,13 +42,13 @@ describe('ParameterValueInputComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), ParameterValueInputComponent, BooleanValueInputComponent, @@ -50,9 +57,9 @@ describe('ParameterValueInputComponent', () => { DateValueInputComponent, FileValueAccessorDirective, FileValidator, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts index 11bf256ee6..0a65011105 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts @@ -1,27 +1,39 @@ -import { Component, EventEmitter, Input, Optional, Output, } from '@angular/core'; -import { ControlContainer, NgForm, } from '@angular/forms'; +import { + NgSwitch, + NgSwitchCase, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + Optional, + Output, +} from '@angular/core'; +import { + ControlContainer, + NgForm, +} from '@angular/forms'; import { ScriptParameter } from '../../../scripts/script-parameter.model'; import { ScriptParameterType } from '../../../scripts/script-parameter-type.model'; -import { BooleanValueInputComponent } from './boolean-value-input/boolean-value-input.component'; -import { FileValueInputComponent } from './file-value-input/file-value-input.component'; -import { DateValueInputComponent } from './date-value-input/date-value-input.component'; -import { StringValueInputComponent } from './string-value-input/string-value-input.component'; -import { NgSwitch, NgSwitchCase } from '@angular/common'; import { controlContainerFactory } from '../../process-form-factory'; +import { BooleanValueInputComponent } from './boolean-value-input/boolean-value-input.component'; +import { DateValueInputComponent } from './date-value-input/date-value-input.component'; +import { FileValueInputComponent } from './file-value-input/file-value-input.component'; +import { StringValueInputComponent } from './string-value-input/string-value-input.component'; /** * Component that renders the correct parameter value input based the script parameter's type */ @Component({ - selector: 'ds-parameter-value-input', - templateUrl: './parameter-value-input.component.html', - styleUrls: ['./parameter-value-input.component.scss'], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true, - imports: [NgSwitch, NgSwitchCase, StringValueInputComponent, DateValueInputComponent, FileValueInputComponent, BooleanValueInputComponent] + selector: 'ds-parameter-value-input', + templateUrl: './parameter-value-input.component.html', + styleUrls: ['./parameter-value-input.component.scss'], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, + imports: [NgSwitch, NgSwitchCase, StringValueInputComponent, DateValueInputComponent, FileValueInputComponent, BooleanValueInputComponent], }) export class ParameterValueInputComponent { @Input() index: number; diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.spec.ts b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.spec.ts index 267ccaed8b..9a216a3c63 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.spec.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.spec.ts @@ -21,18 +21,18 @@ describe('StringValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - StringValueInputComponent - ], - providers: [], -}) + StringValueInputComponent, + ], + providers: [], + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts index 0c6484cb26..540c822ffe 100644 --- a/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts +++ b/src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts @@ -1,23 +1,31 @@ -import { Component, Input, Optional } from '@angular/core'; -import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, FormsModule, NgForm } from '@angular/forms'; -import { TranslateModule } from '@ngx-translate/core'; import { NgIf } from '@angular/common'; +import { + Component, + Input, + Optional, +} from '@angular/core'; +import { + ControlContainer, + FormsModule, + NgForm, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { controlContainerFactory } from '../../../process-form.component'; +import { ValueInputComponent } from '../value-input.component'; /** * Represents the user inputted value of a string parameter */ @Component({ - selector: 'ds-string-value-input', - templateUrl: './string-value-input.component.html', - styleUrls: ['./string-value-input.component.scss'], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true, - imports: [FormsModule, NgIf, TranslateModule] + selector: 'ds-string-value-input', + templateUrl: './string-value-input.component.html', + styleUrls: ['./string-value-input.component.scss'], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, + imports: [FormsModule, NgIf, TranslateModule], }) export class StringValueInputComponent extends ValueInputComponent { /** diff --git a/src/app/process-page/form/process-parameters/process-parameters.component.spec.ts b/src/app/process-page/form/process-parameters/process-parameters.component.spec.ts index c41943694b..42933cc5a9 100644 --- a/src/app/process-page/form/process-parameters/process-parameters.component.spec.ts +++ b/src/app/process-page/form/process-parameters/process-parameters.component.spec.ts @@ -1,8 +1,15 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { ProcessParameter } from '../../processes/process-parameter.model'; @@ -30,18 +37,18 @@ describe('ProcessParametersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ProcessParametersComponent, ParameterSelectComponent - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ProcessParametersComponent, ParameterSelectComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }) .compileComponents(); })); diff --git a/src/app/process-page/form/process-parameters/process-parameters.component.ts b/src/app/process-page/form/process-parameters/process-parameters.component.ts index 9d12bb9511..0b72b086c1 100644 --- a/src/app/process-page/form/process-parameters/process-parameters.component.ts +++ b/src/app/process-page/form/process-parameters/process-parameters.component.ts @@ -1,29 +1,43 @@ -import { Component, EventEmitter, Input, OnChanges, Optional, Output, SimpleChanges, } from '@angular/core'; -import { ControlContainer, NgForm, } from '@angular/forms'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnChanges, + Optional, + Output, + SimpleChanges, +} from '@angular/core'; +import { + ControlContainer, + NgForm, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { hasValue } from '../../../shared/empty.util'; import { ProcessParameter } from '../../processes/process-parameter.model'; import { Script } from '../../scripts/script.model'; import { ScriptParameter } from '../../scripts/script-parameter.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ParameterSelectComponent } from './parameter-select/parameter-select.component'; -import { NgFor, NgIf } from '@angular/common'; import { controlContainerFactory } from '../process-form-factory'; +import { ParameterSelectComponent } from './parameter-select/parameter-select.component'; /** * Component that represents the selected list of parameters for a script */ @Component({ - selector: 'ds-process-parameters', - templateUrl: './process-parameters.component.html', - styleUrls: ['./process-parameters.component.scss'], - viewProviders: [{ - provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] - }], - standalone: true, - imports: [NgIf, NgFor, ParameterSelectComponent, TranslateModule] + selector: 'ds-process-parameters', + templateUrl: './process-parameters.component.html', + styleUrls: ['./process-parameters.component.scss'], + viewProviders: [{ + provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]], + }], + standalone: true, + imports: [NgIf, NgFor, ParameterSelectComponent, TranslateModule], }) export class ProcessParametersComponent implements OnChanges { /** diff --git a/src/app/process-page/form/script-help/script-help.component.spec.ts b/src/app/process-page/form/script-help/script-help.component.spec.ts index bcec66125c..d52c96f84d 100644 --- a/src/app/process-page/form/script-help/script-help.component.spec.ts +++ b/src/app/process-page/form/script-help/script-help.component.spec.ts @@ -1,8 +1,15 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { Script } from '../../scripts/script.model'; @@ -29,19 +36,19 @@ describe('ScriptHelpComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ScriptHelpComponent - ], - schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + ScriptHelpComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/form/script-help/script-help.component.ts b/src/app/process-page/form/script-help/script-help.component.ts index 37422fbc33..d06bf13f32 100644 --- a/src/app/process-page/form/script-help/script-help.component.ts +++ b/src/app/process-page/form/script-help/script-help.component.ts @@ -1,19 +1,27 @@ -import { Component, Input, } from '@angular/core'; +import { + NgFor, + NgSwitch, + NgSwitchCase, + NgTemplateOutlet, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Script } from '../../scripts/script.model'; import { ScriptParameterType } from '../../scripts/script-parameter-type.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgFor, NgSwitch, NgSwitchCase, NgTemplateOutlet } from '@angular/common'; /** * Components that represents a help section for the script use and parameters */ @Component({ - selector: 'ds-script-help', - templateUrl: './script-help.component.html', - styleUrls: ['./script-help.component.scss'], - standalone: true, - imports: [NgFor, NgTemplateOutlet, NgSwitch, NgSwitchCase, TranslateModule] + selector: 'ds-script-help', + templateUrl: './script-help.component.html', + styleUrls: ['./script-help.component.scss'], + standalone: true, + imports: [NgFor, NgTemplateOutlet, NgSwitch, NgSwitchCase, TranslateModule], }) export class ScriptHelpComponent { /** diff --git a/src/app/process-page/form/scripts-select/scripts-select.component.spec.ts b/src/app/process-page/form/scripts-select/scripts-select.component.spec.ts index f1c3c1cf07..6b8c39eb8f 100644 --- a/src/app/process-page/form/scripts-select/scripts-select.component.spec.ts +++ b/src/app/process-page/form/scripts-select/scripts-select.component.spec.ts @@ -1,9 +1,21 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; @@ -34,23 +46,23 @@ describe('ScriptsSelectComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ScriptsSelectComponent - ], - providers: [ + ScriptsSelectComponent, + ], + providers: [ { provide: ScriptDataService, useValue: scriptService }, { provide: Router, useClass: RouterStub }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/process-page/form/scripts-select/scripts-select.component.ts b/src/app/process-page/form/scripts-select/scripts-select.component.ts index d77b3c551b..40a969499e 100644 --- a/src/app/process-page/form/scripts-select/scripts-select.component.ts +++ b/src/app/process-page/form/scripts-select/scripts-select.component.ts @@ -1,16 +1,51 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, } from '@angular/core'; -import { ControlContainer, FormsModule, NgForm, } from '@angular/forms'; -import { ActivatedRoute, Params, Router, } from '@angular/router'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, map, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnDestroy, + OnInit, + Optional, + Output, +} from '@angular/core'; +import { + ControlContainer, + FormsModule, + NgForm, +} from '@angular/forms'; +import { + ActivatedRoute, + Params, + Router, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + map, + switchMap, + take, +} from 'rxjs/operators'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { ScriptDataService } from '../../../core/data/processes/script-data.service'; -import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; -import { hasNoValue, hasValue, } from '../../../shared/empty.util'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../../../core/shared/operators'; +import { + hasNoValue, + hasValue, +} from '../../../shared/empty.util'; import { Script } from '../../scripts/script.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { controlContainerFactory } from '../process-form.component'; const SCRIPT_QUERY_PARAMETER = 'script'; @@ -19,14 +54,14 @@ const SCRIPT_QUERY_PARAMETER = 'script'; * Component used to select a script */ @Component({ - selector: 'ds-scripts-select', - templateUrl: './scripts-select.component.html', - styleUrls: ['./scripts-select.component.scss'], - viewProviders: [{ provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] }], - standalone: true, - imports: [NgIf, FormsModule, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-scripts-select', + templateUrl: './scripts-select.component.html', + styleUrls: ['./scripts-select.component.scss'], + viewProviders: [{ provide: ControlContainer, + useFactory: controlContainerFactory, + deps: [[new Optional(), NgForm]] }], + standalone: true, + imports: [NgIf, FormsModule, NgFor, AsyncPipe, TranslateModule], }) export class ScriptsSelectComponent implements OnInit, OnDestroy { /** diff --git a/src/app/process-page/new/new-process.component.spec.ts b/src/app/process-page/new/new-process.component.spec.ts index c6d31e7e9d..b6782dcf26 100644 --- a/src/app/process-page/new/new-process.component.spec.ts +++ b/src/app/process-page/new/new-process.component.spec.ts @@ -18,15 +18,15 @@ import { ScriptDataService } from '../../core/data/processes/script-data.service import { RequestService } from '../../core/data/request.service'; import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { HasValuePipe } from '../../shared/utils/has-value.pipe'; import { VarDirective } from '../../shared/utils/var.directive'; +import { ProcessFormComponent } from '../form/process-form.component'; import { ProcessParameter } from '../processes/process-parameter.model'; import { Script } from '../scripts/script.model'; import { ScriptParameter } from '../scripts/script-parameter.model'; import { NewProcessComponent } from './new-process.component'; -import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { ProcessFormComponent } from '../form/process-form.component'; describe('NewProcessComponent', () => { let component: NewProcessComponent; @@ -70,7 +70,7 @@ describe('NewProcessComponent', () => { }, }), NewProcessComponent, VarDirective - , + , HasValuePipe, ], providers: [ @@ -85,8 +85,8 @@ describe('NewProcessComponent', () => { }) .overrideComponent(NewProcessComponent, { remove: { - imports: [ProcessFormComponent] - } + imports: [ProcessFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/process-page/new/new-process.component.ts b/src/app/process-page/new/new-process.component.ts index 39382d8d4b..add94307c2 100644 --- a/src/app/process-page/new/new-process.component.ts +++ b/src/app/process-page/new/new-process.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -13,21 +17,20 @@ import { LinkService } from '../../core/cache/builders/link.service'; import { ProcessDataService } from '../../core/data/processes/process-data.service'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { followLink } from '../../shared/utils/follow-link-config.model'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { ProcessFormComponent } from '../form/process-form.component'; import { Process } from '../processes/process.model'; import { Script } from '../scripts/script.model'; -import { ProcessFormComponent } from '../form/process-form.component'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { NgIf, AsyncPipe } from '@angular/common'; /** * Component to create a new script */ @Component({ - selector: 'ds-new-process', - templateUrl: './new-process.component.html', - styleUrls: ['./new-process.component.scss'], - standalone: true, - imports: [NgIf, VarDirective, ProcessFormComponent, AsyncPipe] + selector: 'ds-new-process', + templateUrl: './new-process.component.html', + styleUrls: ['./new-process.component.scss'], + standalone: true, + imports: [NgIf, VarDirective, ProcessFormComponent, AsyncPipe], }) export class NewProcessComponent implements OnInit { /** diff --git a/src/app/process-page/overview/process-overview.component.spec.ts b/src/app/process-page/overview/process-overview.component.spec.ts index 6e0b161bed..b7021a0273 100644 --- a/src/app/process-page/overview/process-overview.component.spec.ts +++ b/src/app/process-page/overview/process-overview.component.spec.ts @@ -1,5 +1,12 @@ -import { NO_ERRORS_SCHEMA, TemplateRef, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + NO_ERRORS_SCHEMA, + TemplateRef, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; @@ -7,10 +14,10 @@ import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { ProcessDataService } from '../../core/data/processes/process-data.service'; +import { PaginationComponent } from '../../shared/pagination/pagination.component'; import { VarDirective } from '../../shared/utils/var.directive'; import { ProcessBulkDeleteService } from './process-bulk-delete.service'; import { ProcessOverviewComponent } from './process-overview.component'; -import { PaginationComponent } from '../../shared/pagination/pagination.component'; import { ProcessOverviewService } from './process-overview.service'; describe('ProcessOverviewComponent', () => { @@ -50,16 +57,16 @@ describe('ProcessOverviewComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProcessOverviewComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProcessOverviewComponent, VarDirective], + providers: [ { provide: ProcessOverviewService, useValue: processService }, { provide: ProcessBulkDeleteService, useValue: processBulkDeleteService }, { provide: NgbModal, useValue: modalService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ProcessOverviewComponent, { - remove: {imports: [PaginationComponent]} + remove: { imports: [PaginationComponent] }, }) .compileComponents(); })); diff --git a/src/app/process-page/overview/process-overview.component.ts b/src/app/process-page/overview/process-overview.component.ts index 41c65a9037..1d10a87b64 100644 --- a/src/app/process-page/overview/process-overview.component.ts +++ b/src/app/process-page/overview/process-overview.component.ts @@ -1,23 +1,37 @@ -import { Component, OnDestroy, OnInit, TemplateRef, } from '@angular/core'; +import { + AsyncPipe, + DatePipe, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, + TemplateRef, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { hasValue } from '../../shared/empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { VarDirective } from '../../shared/utils/var.directive'; import { PaginationComponent } from '../../shared/pagination/pagination.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, DatePipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; -import { ProcessOverviewService, ProcessSortField } from './process-overview.service'; +import { VarDirective } from '../../shared/utils/var.directive'; import { ProcessStatus } from '../processes/process-status.model'; -import { ProcessOverviewTableComponent } from './table/process-overview-table.component'; import { ProcessBulkDeleteService } from './process-bulk-delete.service'; +import { + ProcessOverviewService, + ProcessSortField, +} from './process-overview.service'; +import { ProcessOverviewTableComponent } from './table/process-overview-table.component'; @Component({ selector: 'ds-process-overview', templateUrl: './process-overview.component.html', standalone: true, - imports: [NgIf, RouterLink, PaginationComponent, NgFor, VarDirective, AsyncPipe, DatePipe, TranslateModule, NgTemplateOutlet, ProcessOverviewTableComponent] + imports: [NgIf, RouterLink, PaginationComponent, NgFor, VarDirective, AsyncPipe, DatePipe, TranslateModule, NgTemplateOutlet, ProcessOverviewTableComponent], }) /** * Component displaying a list of all processes in a paginated table diff --git a/src/app/process-page/overview/table/process-overview-table.component.spec.ts b/src/app/process-page/overview/table/process-overview-table.component.spec.ts index 9cec00a8b4..f161b77ead 100644 --- a/src/app/process-page/overview/table/process-overview-table.component.spec.ts +++ b/src/app/process-page/overview/table/process-overview-table.component.spec.ts @@ -131,9 +131,9 @@ describe('ProcessOverviewTableComponent', () => { init(); void TestBed.configureTestingModule({ - declarations: [NgbCollapse], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), VarDirective, ProcessOverviewTableComponent], - providers: [ + declarations: [NgbCollapse], + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), VarDirective, ProcessOverviewTableComponent], + providers: [ { provide: ProcessOverviewService, useValue: processOverviewService }, { provide: ProcessDataService, useValue: processService }, { provide: EPersonDataService, useValue: ePersonService }, @@ -142,8 +142,8 @@ describe('ProcessOverviewTableComponent', () => { { provide: NgbModal, useValue: modalService }, { provide: AuthService, useValue: authService }, { provide: RouteService, useValue: routeService }, - ] -}).compileComponents(); + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/overview/table/process-overview-table.component.ts b/src/app/process-page/overview/table/process-overview-table.component.ts index 47c405a06a..4df95e8780 100644 --- a/src/app/process-page/overview/table/process-overview-table.component.ts +++ b/src/app/process-page/overview/table/process-overview-table.component.ts @@ -1,8 +1,38 @@ -import { AsyncPipe, isPlatformBrowser, NgClass, NgForOf, NgIf } from '@angular/common'; -import { Component, Inject, Input, OnDestroy, OnInit, PLATFORM_ID, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { BehaviorSubject, from as observableFrom, mergeMap, Observable, Subscription, } from 'rxjs'; -import { filter, map, switchMap, take, toArray, } from 'rxjs/operators'; +import { + AsyncPipe, + isPlatformBrowser, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + from as observableFrom, + mergeMap, + Observable, + Subscription, +} from 'rxjs'; +import { + filter, + map, + switchMap, + take, + toArray, +} from 'rxjs/operators'; import { PaginationService } from 'src/app/core/pagination/pagination.service'; import { AuthService } from '../../../core/auth/auth.service'; @@ -14,18 +44,22 @@ import { EPersonDataService } from '../../../core/eperson/eperson-data.service'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { RouteService } from '../../../core/services/route.service'; import { redirectOn4xx } from '../../../core/shared/authorized.operators'; -import { getAllCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getAllCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; import { hasValue } from '../../../shared/empty.util'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; -import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { Process } from '../../processes/process.model'; import { ProcessStatus } from '../../processes/process-status.model'; import { ProcessBulkDeleteService } from '../process-bulk-delete.service'; -import { ProcessOverviewService, ProcessSortField, } from '../process-overview.service'; +import { + ProcessOverviewService, + ProcessSortField, +} from '../process-overview.service'; const NEW_PROCESS_PARAM = 'new_process_id'; @@ -54,8 +88,8 @@ export interface ProcessOverviewTableEntry { NgForOf, NgIf, ThemedLoadingComponent, - VarDirective - ] + VarDirective, + ], }) export class ProcessOverviewTableComponent implements OnInit, OnDestroy { diff --git a/src/app/process-page/process-page-routes.ts b/src/app/process-page/process-page-routes.ts index d8e8ee1cd3..7e7cadd3e5 100644 --- a/src/app/process-page/process-page-routes.ts +++ b/src/app/process-page/process-page-routes.ts @@ -1,41 +1,42 @@ import { Route } from '@angular/router'; + +import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { ProcessDetailComponent } from './detail/process-detail.component'; import { NewProcessComponent } from './new/new-process.component'; import { ProcessOverviewComponent } from './overview/process-overview.component'; -import { ProcessPageResolver } from './process-page.resolver'; -import { ProcessDetailComponent } from './detail/process-detail.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { ProcessBreadcrumbResolver } from './process-breadcrumb.resolver'; -import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { ProcessPageResolver } from './process-page.resolver'; export const ROUTES: Route[] = [ { path: '', providers: [ - ProcessPageResolver + ProcessPageResolver, ], - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {breadcrumbKey: 'process.overview'}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { breadcrumbKey: 'process.overview' }, canActivate: [AuthenticatedGuard], children: [ { path: '', component: ProcessOverviewComponent, - data: {title: 'process.overview.title'}, + data: { title: 'process.overview.title' }, }, { path: 'new', component: NewProcessComponent, - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {title: 'process.new.title', breadcrumbKey: 'process.new'} + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { title: 'process.new.title', breadcrumbKey: 'process.new' }, }, { path: ':id', component: ProcessDetailComponent, resolve: { process: ProcessPageResolver, - breadcrumb: ProcessBreadcrumbResolver - } - } - ] + breadcrumb: ProcessBreadcrumbResolver, + }, + }, + ], }, ]; diff --git a/src/app/process-page/process-page-shared.module.ts b/src/app/process-page/process-page-shared.module.ts index 9f2f2d5284..2381e19ec8 100644 --- a/src/app/process-page/process-page-shared.module.ts +++ b/src/app/process-page/process-page-shared.module.ts @@ -1,55 +1,46 @@ import { DatePipe } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NewProcessComponent } from './new/new-process.component'; -import { ScriptsSelectComponent } from './form/scripts-select/scripts-select.component'; -import { ScriptHelpComponent } from './form/script-help/script-help.component'; import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; + import { ProcessDetailComponent } from './detail/process-detail.component'; import { ProcessDetailFieldComponent } from './detail/process-detail-field/process-detail-field.component'; import { ProcessFormComponent } from './form/process-form.component'; import { ParameterSelectComponent } from './form/process-parameters/parameter-select/parameter-select.component'; -import { - BooleanValueInputComponent -} from './form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component'; -import { - DateValueInputComponent -} from './form/process-parameters/parameter-value-input/date-value-input/date-value-input.component'; -import { - FileValueInputComponent -} from './form/process-parameters/parameter-value-input/file-value-input/file-value-input.component'; -import { - ParameterValueInputComponent -} from './form/process-parameters/parameter-value-input/parameter-value-input.component'; -import { - StringValueInputComponent -} from './form/process-parameters/parameter-value-input/string-value-input/string-value-input.component'; +import { BooleanValueInputComponent } from './form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component'; +import { DateValueInputComponent } from './form/process-parameters/parameter-value-input/date-value-input/date-value-input.component'; +import { FileValueInputComponent } from './form/process-parameters/parameter-value-input/file-value-input/file-value-input.component'; +import { ParameterValueInputComponent } from './form/process-parameters/parameter-value-input/parameter-value-input.component'; +import { StringValueInputComponent } from './form/process-parameters/parameter-value-input/string-value-input/string-value-input.component'; import { ProcessParametersComponent } from './form/process-parameters/process-parameters.component'; +import { ScriptHelpComponent } from './form/script-help/script-help.component'; +import { ScriptsSelectComponent } from './form/scripts-select/scripts-select.component'; +import { NewProcessComponent } from './new/new-process.component'; import { ProcessOverviewComponent } from './overview/process-overview.component'; import { ProcessOverviewTableComponent } from './overview/table/process-overview-table.component'; import { ProcessBreadcrumbResolver } from './process-breadcrumb.resolver'; import { ProcessBreadcrumbsService } from './process-breadcrumbs.service'; @NgModule({ - imports: [ - NgbCollapseModule, - NewProcessComponent, - ScriptsSelectComponent, - ScriptHelpComponent, - ParameterSelectComponent, - ProcessParametersComponent, - StringValueInputComponent, - ParameterValueInputComponent, - FileValueInputComponent, - BooleanValueInputComponent, - DateValueInputComponent, - ProcessOverviewComponent, + imports: [ + NgbCollapseModule, + NewProcessComponent, + ScriptsSelectComponent, + ScriptHelpComponent, + ParameterSelectComponent, + ProcessParametersComponent, + StringValueInputComponent, + ParameterValueInputComponent, + FileValueInputComponent, + BooleanValueInputComponent, + DateValueInputComponent, + ProcessOverviewComponent, ProcessOverviewTableComponent, - ProcessDetailComponent, - ProcessDetailFieldComponent, + ProcessDetailComponent, + ProcessDetailFieldComponent, ProcessFormComponent, - ], - providers: [ - ProcessBreadcrumbResolver, + ], + providers: [ + ProcessBreadcrumbResolver, ProcessBreadcrumbsService, DatePipe, ], diff --git a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.spec.ts b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.spec.ts index d439b75f5e..9d515e1abb 100644 --- a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.spec.ts +++ b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.spec.ts @@ -1,7 +1,14 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; @@ -9,12 +16,10 @@ import { of } from 'rxjs'; import { Item } from '../../core/shared/item.model'; import { getItemPageRoute } from '../../item-page/item-page-routing-paths'; import { ItemSearchResult } from '../../shared/object-collection/shared/item-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { SearchObjects } from '../../shared/search/models/search-objects.model'; import { RouterStub } from '../../shared/testing/router.stub'; -import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { ProfileClaimService } from '../profile-claim/profile-claim.service'; import { ProfileClaimItemModalComponent } from './profile-claim-item-modal.component'; @@ -107,17 +112,17 @@ describe('ProfileClaimItemModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ProfileClaimItemModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), ProfileClaimItemModalComponent], + providers: [ { provide: NgbActiveModal, useValue: {} }, { provide: ActivatedRoute, useValue: {} }, { provide: Router, useValue: new RouterStub() }, { provide: ProfileClaimService, useValue: profileClaimService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(ProfileClaimItemModalComponent, { - remove: { imports: [ListableObjectComponentLoaderComponent]} + remove: { imports: [ListableObjectComponentLoaderComponent] }, }) .compileComponents(); })); diff --git a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts index f9854f072b..4ff9b637f6 100644 --- a/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts +++ b/src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts @@ -1,6 +1,20 @@ -import { Component, EventEmitter, Input, OnInit, Output, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + AsyncPipe, + NgForOf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @@ -11,17 +25,11 @@ import { Item } from '../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { ViewMode } from '../../core/shared/view-mode.model'; import { getItemPageRoute } from '../../item-page/item-page-routing-paths'; -import { - DSOSelectorModalWrapperComponent -} from '../../shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component'; +import { DSOSelectorModalWrapperComponent } from '../../shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component'; import { CollectionElementLinkType } from '../../shared/object-collection/collection-element-link.type'; +import { ListableObjectComponentLoaderComponent } from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { SearchObjects } from '../../shared/search/models/search-objects.model'; import { ProfileClaimService } from '../profile-claim/profile-claim.service'; -import { - ListableObjectComponentLoaderComponent -} from '../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; -import { AsyncPipe, NgForOf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; /** * Component representing a modal that show a list of suggested profile item to claim @@ -33,9 +41,9 @@ import { TranslateModule } from '@ngx-translate/core'; ListableObjectComponentLoaderComponent, AsyncPipe, TranslateModule, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class ProfileClaimItemModalComponent extends DSOSelectorModalWrapperComponent implements OnInit { diff --git a/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.spec.ts b/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.spec.ts index 86b0078065..68a4bfdfa6 100644 --- a/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.spec.ts +++ b/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.spec.ts @@ -1,17 +1,27 @@ -import { EventEmitter, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + EventEmitter, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import cloneDeep from 'lodash/cloneDeep'; +import { of } from 'rxjs'; +import { ConfigurationDataService } from '../../core/data/configuration-data.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; +import { FormComponent } from '../../shared/form/form.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; -import { FormComponent } from '../../shared/form/form.component'; -import { ConfigurationDataService } from '../../core/data/configuration-data.service'; -import { of } from 'rxjs'; import { VarDirective } from '../../shared/utils/var.directive'; import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form.component'; @@ -65,7 +75,7 @@ describe('ProfilePageMetadataFormComponent', () => { }; configurationDataService = jasmine.createSpyObj('ConfigurationDataService', { - findByPropertyName: of({payload: {value: 'test'}}), + findByPropertyName: of({ payload: { value: 'test' } }), }); } @@ -73,18 +83,18 @@ describe('ProfilePageMetadataFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageMetadataFormComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageMetadataFormComponent, VarDirective], + providers: [ { provide: EPersonDataService, useValue: epersonService }, { provide: TranslateService, useValue: translate }, { provide: NotificationsService, useValue: notificationsService }, { provide: ConfigurationDataService, useValue: configurationDataService }, FormBuilderService, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ProfilePageMetadataFormComponent, { - remove: { imports: [FormComponent]} + remove: { imports: [FormComponent] }, }) .compileComponents(); })); diff --git a/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.ts b/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.ts index de4df87368..4ccaeb1453 100644 --- a/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.ts +++ b/src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.ts @@ -1,4 +1,9 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { DynamicFormControlModel, @@ -13,21 +18,26 @@ import { LangConfig } from '../../../config/lang-config.interface'; import { environment } from '../../../environments/environment'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; -import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../core/shared/operators'; -import { hasValue, isNotEmpty, } from '../../shared/empty.util'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../../core/shared/operators'; +import { + hasValue, + isNotEmpty, +} from '../../shared/empty.util'; import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; import { FormComponent } from '../../shared/form/form.component'; -import { NgIf } from '@angular/common'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; @Component({ selector: 'ds-profile-page-metadata-form', templateUrl: './profile-page-metadata-form.component.html', imports: [ FormComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component for a user to edit their metadata diff --git a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts index 62561aa64c..c8f18fc300 100644 --- a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts +++ b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts @@ -77,16 +77,16 @@ describe('ProfilePageResearcherFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageResearcherFormComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageResearcherFormComponent, VarDirective], + providers: [ NgbModal, { provide: ResearcherProfileDataService, useValue: researcherProfileService }, { provide: NotificationsService, useValue: notificationsServiceStub }, { provide: ProfileClaimService, useValue: profileClaimService }, { provide: AuthService, useValue: authService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts index d05b1a18b6..cfbbacac12 100644 --- a/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts +++ b/src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -5,7 +9,11 @@ import { } from '@angular/core'; import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { UiSwitchModule } from 'ngx-ui-switch'; import { BehaviorSubject, Observable, @@ -32,11 +40,9 @@ import { ConfirmationModalComponent } from '../../shared/confirmation-modal/conf import { isNotEmpty } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { followLink } from '../../shared/utils/follow-link-config.model'; +import { VarDirective } from '../../shared/utils/var.directive'; import { ProfileClaimService } from '../profile-claim/profile-claim.service'; import { ProfileClaimItemModalComponent } from '../profile-claim-item-modal/profile-claim-item-modal.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { UiSwitchModule } from 'ngx-ui-switch'; -import { VarDirective } from '../../shared/utils/var.directive'; @Component({ selector: 'ds-profile-page-researcher-form', @@ -46,9 +52,9 @@ import { VarDirective } from '../../shared/utils/var.directive'; AsyncPipe, TranslateModule, UiSwitchModule, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) /** * Component for a user to create/delete or change their researcher profile. diff --git a/src/app/profile-page/profile-page-routes.ts b/src/app/profile-page/profile-page-routes.ts index f187033513..a164ff707a 100644 --- a/src/app/profile-page/profile-page-routes.ts +++ b/src/app/profile-page/profile-page-routes.ts @@ -1,7 +1,8 @@ import { Route } from '@angular/router'; + import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { ThemedProfilePageComponent } from './themed-profile-page.component'; import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; +import { ThemedProfilePageComponent } from './themed-profile-page.component'; export const ROUTES: Route[] = [ { @@ -9,7 +10,7 @@ export const ROUTES: Route[] = [ pathMatch: 'full', component: ThemedProfilePageComponent, providers: [provideSuggestionNotifications()], - resolve: {breadcrumb: I18nBreadcrumbResolver}, - data: {breadcrumbKey: 'profile', title: 'profile.title'} - } + resolve: { breadcrumb: I18nBreadcrumbResolver }, + data: { breadcrumbKey: 'profile', title: 'profile.title' }, + }, ]; diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts index eb4a3ced86..0975954ccc 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts @@ -1,5 +1,12 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -10,7 +17,6 @@ import { FormBuilderService } from '../../shared/form/builder/form-builder.servi import { NotificationsService } from '../../shared/notifications/notifications.service'; import { VarDirective } from '../../shared/utils/var.directive'; import { ProfilePageSecurityFormComponent } from './profile-page-security-form.component'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('ProfilePageSecurityFormComponent', () => { let component: ProfilePageSecurityFormComponent; @@ -33,20 +39,20 @@ describe('ProfilePageSecurityFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ProfilePageSecurityFormComponent, - VarDirective, - NoopAnimationsModule, - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + ProfilePageSecurityFormComponent, + VarDirective, + NoopAnimationsModule, + ], + providers: [ { provide: EPersonDataService, useValue: epersonService }, { provide: NotificationsService, useValue: notificationsService }, FormBuilderService, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts index 720fa52b36..41a6064857 100644 --- a/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts +++ b/src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts @@ -1,15 +1,31 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; +import { + DynamicFormControlModel, + DynamicFormService, + DynamicInputModel, +} from '@ng-dynamic-forms/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { debounceTimeWorkaround as debounceTime } from '../../core/shared/operators'; -import { FormComponent } from '../../shared/form/form.component'; import { AlertComponent } from '../../shared/alert/alert.component'; -import { hasValue, isEmpty, } from '../../shared/empty.util'; +import { + hasValue, + isEmpty, +} from '../../shared/empty.util'; +import { FormComponent } from '../../shared/form/form.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @Component({ @@ -18,9 +34,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s imports: [ FormComponent, AlertComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Component for a user to edit their security information diff --git a/src/app/profile-page/profile-page.component.spec.ts b/src/app/profile-page/profile-page.component.spec.ts index d1a988a9e0..debecc14cb 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -1,12 +1,22 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { StoreModule } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { storeModuleConfig } from '../app.reducer'; import { authReducer } from '../core/auth/auth.reducer'; @@ -18,17 +28,21 @@ import { AuthorizationDataService } from '../core/data/feature-authorization/aut import { EPersonDataService } from '../core/eperson/eperson-data.service'; import { EPerson } from '../core/eperson/models/eperson.model'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; -import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component'; -import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component'; -import { - ProfilePageResearcherFormComponent -} from './profile-page-researcher-form/profile-page-researcher-form.component'; import { NotificationsService } from '../shared/notifications/notifications.service'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../shared/remote-data.utils'; -import { EmptySpecialGroupDataMock$, SpecialGroupDataMock$, } from '../shared/testing/special-group.mock'; +import { + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../shared/remote-data.utils'; +import { + EmptySpecialGroupDataMock$, + SpecialGroupDataMock$, +} from '../shared/testing/special-group.mock'; import { createPaginatedList } from '../shared/testing/utils.test'; import { VarDirective } from '../shared/utils/var.directive'; import { ProfilePageComponent } from './profile-page.component'; +import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component'; +import { ProfilePageResearcherFormComponent } from './profile-page-researcher-form/profile-page-researcher-form.component'; +import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component'; describe('ProfilePageComponent', () => { let component: ProfilePageComponent; @@ -95,28 +109,28 @@ describe('ProfilePageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - ProfilePageComponent, VarDirective - ], - providers: [ + ProfilePageComponent, VarDirective, + ], + providers: [ { provide: EPersonDataService, useValue: epersonService }, { provide: NotificationsService, useValue: notificationsService }, { provide: AuthService, useValue: authService }, { provide: ConfigurationDataService, useValue: configurationService }, { provide: AuthorizationDataService, useValue: authorizationService }, provideMockStore({ initialState }), - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ProfilePageComponent, { remove: { imports: [ - ProfilePageMetadataFormComponent, - ProfilePageSecurityFormComponent, - ProfilePageResearcherFormComponent, - ]} + ProfilePageMetadataFormComponent, + ProfilePageSecurityFormComponent, + ProfilePageResearcherFormComponent, + ] }, }) .compileComponents(); })); diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts index 336f20d105..e62faacc97 100644 --- a/src/app/profile-page/profile-page.component.ts +++ b/src/app/profile-page/profile-page.component.ts @@ -1,8 +1,28 @@ -import { Component, OnInit, ViewChild, } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, + ViewChild, +} from '@angular/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; -import { BehaviorSubject, Observable, } from 'rxjs'; -import { filter, switchMap, tap, } from 'rxjs/operators'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; +import { + filter, + switchMap, + tap, +} from 'rxjs/operators'; + import { AuthService } from '../core/auth/auth.service'; import { DSONameService } from '../core/breadcrumbs/dso-name.service'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; @@ -14,24 +34,22 @@ import { EPersonDataService } from '../core/eperson/eperson-data.service'; import { EPerson } from '../core/eperson/models/eperson.model'; import { Group } from '../core/eperson/models/group.model'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; -import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { - ProfilePageResearcherFormComponent -} from './profile-page-researcher-form/profile-page-researcher-form.component'; -import { VarDirective } from '../shared/utils/var.directive'; -import { - SuggestionsNotificationComponent -} from '../notifications/suggestions-notification/suggestions-notification.component'; import { getAllSucceededRemoteData, getFirstCompletedRemoteData, getRemoteDataPayload, } from '../core/shared/operators'; -import { hasValue, isNotEmpty, } from '../shared/empty.util'; +import { SuggestionsNotificationComponent } from '../notifications/suggestions-notification/suggestions-notification.component'; +import { + hasValue, + isNotEmpty, +} from '../shared/empty.util'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { followLink } from '../shared/utils/follow-link-config.model'; +import { VarDirective } from '../shared/utils/var.directive'; import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component'; +import { ProfilePageResearcherFormComponent } from './profile-page-researcher-form/profile-page-researcher-form.component'; +import { ProfilePageSecurityFormComponent } from './profile-page-security-form/profile-page-security-form.component'; @Component({ selector: 'ds-profile-page', @@ -46,9 +64,9 @@ import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/p VarDirective, NgIf, NgForOf, - SuggestionsNotificationComponent + SuggestionsNotificationComponent, ], - standalone: true + standalone: true, }) /** * Component for a user to edit their profile information diff --git a/src/app/profile-page/themed-profile-page.component.ts b/src/app/profile-page/themed-profile-page.component.ts index e84292d911..8288c7b8dc 100644 --- a/src/app/profile-page/themed-profile-page.component.ts +++ b/src/app/profile-page/themed-profile-page.component.ts @@ -7,10 +7,10 @@ import { ProfilePageComponent } from './profile-page.component'; * Themed wrapper for ProfilePageComponent */ @Component({ - selector: 'ds-themed-profile-page', - styleUrls: [], - templateUrl: './../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-profile-page', + styleUrls: [], + templateUrl: './../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedProfilePageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/quality-assurance-notifications-pages/notifications-pages-routes.ts b/src/app/quality-assurance-notifications-pages/notifications-pages-routes.ts index 260a93a920..e7d23242f5 100644 --- a/src/app/quality-assurance-notifications-pages/notifications-pages-routes.ts +++ b/src/app/quality-assurance-notifications-pages/notifications-pages-routes.ts @@ -3,38 +3,22 @@ import { Route } from '@angular/router'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; -import { - NOTIFICATIONS_RECITER_SUGGESTION_PATH, - QUALITY_ASSURANCE_EDIT_PATH -} from './notifications-pages-routing-paths'; -import { - NotificationsSuggestionTargetsPageComponent -} from './notifications-suggestion-targets-page/notifications-suggestion-targets-page.component'; -import { - AdminNotificationsPublicationClaimPageResolver -} from './notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service'; -import { - QualityAssuranceTopicsPageComponent -} from './quality-assurance-topics-page/quality-assurance-topics-page.component'; -import { - QualityAssuranceEventsPageComponent -} from './quality-assurance-events-page/quality-assurance-events-page.component'; -import { - QualityAssuranceTopicsPageResolver -} from './quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; -import { - QualityAssuranceEventsPageResolver -} from './quality-assurance-events-page/quality-assurance-events-page.resolver'; -import { - QualityAssuranceSourcePageComponent -} from './quality-assurance-source-page-component/quality-assurance-source-page.component'; -import { - QualityAssuranceSourcePageResolver -} from './quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; import { QualityAssuranceBreadcrumbResolver } from '../core/breadcrumbs/quality-assurance-breadcrumb.resolver'; import { QualityAssuranceBreadcrumbService } from '../core/breadcrumbs/quality-assurance-breadcrumb.service'; -import { SourceDataResolver } from './quality-assurance-source-page-component/quality-assurance-source-data.resolver'; import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; +import { + NOTIFICATIONS_RECITER_SUGGESTION_PATH, + QUALITY_ASSURANCE_EDIT_PATH, +} from './notifications-pages-routing-paths'; +import { NotificationsSuggestionTargetsPageComponent } from './notifications-suggestion-targets-page/notifications-suggestion-targets-page.component'; +import { AdminNotificationsPublicationClaimPageResolver } from './notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service'; +import { QualityAssuranceEventsPageComponent } from './quality-assurance-events-page/quality-assurance-events-page.component'; +import { QualityAssuranceEventsPageResolver } from './quality-assurance-events-page/quality-assurance-events-page.resolver'; +import { SourceDataResolver } from './quality-assurance-source-page-component/quality-assurance-source-data.resolver'; +import { QualityAssuranceSourcePageComponent } from './quality-assurance-source-page-component/quality-assurance-source-page.component'; +import { QualityAssuranceSourcePageResolver } from './quality-assurance-source-page-component/quality-assurance-source-page-resolver.service'; +import { QualityAssuranceTopicsPageComponent } from './quality-assurance-topics-page/quality-assurance-topics-page.component'; +import { QualityAssuranceTopicsPageResolver } from './quality-assurance-topics-page/quality-assurance-topics-page-resolver.service'; const providers = [ I18nBreadcrumbResolver, @@ -47,7 +31,7 @@ const providers = [ QualityAssuranceSourcePageResolver, QualityAssuranceBreadcrumbResolver, QualityAssuranceBreadcrumbService, - provideSuggestionNotifications() + provideSuggestionNotifications(), ]; export const ROUTES: Route[] = [ @@ -59,13 +43,13 @@ export const ROUTES: Route[] = [ providers, resolve: { breadcrumb: I18nBreadcrumbResolver, - reciterSuggestionTargetParams: AdminNotificationsPublicationClaimPageResolver + reciterSuggestionTargetParams: AdminNotificationsPublicationClaimPageResolver, }, data: { title: 'admin.notifications.recitersuggestion.page.title', breadcrumbKey: 'admin.notifications.recitersuggestion', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -75,13 +59,13 @@ export const ROUTES: Route[] = [ providers, resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver + openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver, }, data: { title: 'admin.quality-assurance.page.title', breadcrumbKey: 'admin.quality-assurance', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -91,13 +75,13 @@ export const ROUTES: Route[] = [ providers, resolve: { breadcrumb: I18nBreadcrumbResolver, - openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver + openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver, }, data: { title: 'admin.quality-assurance.page.title', breadcrumbKey: 'admin.quality-assurance', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -108,13 +92,13 @@ export const ROUTES: Route[] = [ resolve: { breadcrumb: I18nBreadcrumbResolver, openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver, - sourceData: SourceDataResolver + sourceData: SourceDataResolver, }, data: { title: 'admin.notifications.source.breadcrumbs', breadcrumbKey: 'admin.notifications.source', - showBreadcrumbsFluid: false - } + showBreadcrumbsFluid: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -124,12 +108,12 @@ export const ROUTES: Route[] = [ providers, resolve: { breadcrumb: QualityAssuranceBreadcrumbResolver, - openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver + openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver, }, data: { title: 'admin.notifications.event.page.title', breadcrumbKey: 'admin.notifications.event', - showBreadcrumbsFluid: false - } - } + showBreadcrumbsFluid: false, + }, + }, ]; diff --git a/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.spec.ts b/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.spec.ts index c30d9ed525..bab60f0f0a 100644 --- a/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.spec.ts +++ b/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.spec.ts @@ -16,17 +16,17 @@ describe('NotificationsSuggestionTargetsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), NotificationsSuggestionTargetsPageComponent, - ], - providers: [ + ], + providers: [ AdminNotificationsPublicationClaimPageComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.ts b/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.ts index 012ac60957..d545eb4e94 100644 --- a/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.ts @@ -1,16 +1,15 @@ import { Component } from '@angular/core'; -import { - PublicationClaimComponent -} from '../../notifications/suggestion-targets/publication-claim/publication-claim.component'; + +import { PublicationClaimComponent } from '../../notifications/suggestion-targets/publication-claim/publication-claim.component'; @Component({ selector: 'ds-notifications-reciter-page', templateUrl: './notifications-suggestion-targets-page.component.html', styleUrls: ['./notifications-suggestion-targets-page.component.scss'], imports: [ - PublicationClaimComponent + PublicationClaimComponent, ], - standalone: true + standalone: true, }) export class NotificationsSuggestionTargetsPageComponent { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.spec.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.spec.ts index 937d3e0ad1..48a5bc0317 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.spec.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.spec.ts @@ -1,8 +1,12 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { async, ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + async, + ComponentFixture, + TestBed, +} from '@angular/core/testing'; -import { QualityAssuranceEventsPageComponent } from './quality-assurance-events-page.component'; import { QualityAssuranceEventsComponent } from '../../../notifications/qa/events/quality-assurance-events.component'; +import { QualityAssuranceEventsPageComponent } from './quality-assurance-events-page.component'; describe('QualityAssuranceEventsPageComponent', () => { let component: QualityAssuranceEventsPageComponent; @@ -10,13 +14,13 @@ describe('QualityAssuranceEventsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [QualityAssuranceEventsPageComponent], - schemas: [NO_ERRORS_SCHEMA], -}) - .overrideComponent(AdminQualityAssuranceEventsPageComponent, { + imports: [QualityAssuranceEventsPageComponent], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(AdminQualityAssuranceEventsPageComponent, { remove: { - imports: [QualityAssuranceEventsComponent] - } + imports: [QualityAssuranceEventsComponent], + }, }) .compileComponents(); })); diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts index b1069d5ab0..e586260d3e 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts @@ -1,14 +1,15 @@ import { Component } from '@angular/core'; + import { QualityAssuranceEventsComponent } from '../../notifications/qa/events/quality-assurance-events.component'; /** * Component for the page that show the QA events related to a specific topic. */ @Component({ - selector: 'ds-quality-assurance-events-page', - templateUrl: './quality-assurance-events-page.component.html', - standalone: true, - imports: [QualityAssuranceEventsComponent] + selector: 'ds-quality-assurance-events-page', + templateUrl: './quality-assurance-events-page.component.html', + standalone: true, + imports: [QualityAssuranceEventsComponent], }) export class QualityAssuranceEventsPageComponent { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.spec.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.spec.ts index 223d63763b..b90bc96ced 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.spec.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.spec.ts @@ -1,5 +1,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { QualityAssuranceSourcePageComponent } from './quality-assurance-source-page.component'; @@ -9,10 +12,10 @@ describe('QualityAssuranceSourcePageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [QualityAssuranceSourcePageComponent], - schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + imports: [QualityAssuranceSourcePageComponent], + schemas: [NO_ERRORS_SCHEMA], + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.ts index d56e3bf147..aeeff3d4b9 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; + import { QualityAssuranceSourceComponent } from '../../notifications/qa/source/quality-assurance-source.component'; /** @@ -8,8 +9,8 @@ import { QualityAssuranceSourceComponent } from '../../notifications/qa/source/q selector: 'ds-quality-assurance-source-page-component', templateUrl: './quality-assurance-source-page.component.html', imports: [ - QualityAssuranceSourceComponent + QualityAssuranceSourceComponent, ], - standalone: true + standalone: true, }) export class QualityAssuranceSourcePageComponent {} diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.spec.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.spec.ts index a4f013d194..aa0243530a 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.spec.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.spec.ts @@ -13,10 +13,10 @@ describe('QualityAssuranceTopicsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [QualityAssuranceTopicsPageComponent], - schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + imports: [QualityAssuranceTopicsPageComponent], + schemas: [NO_ERRORS_SCHEMA], + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts index bb252d5552..3329788731 100644 --- a/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts +++ b/src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts @@ -1,14 +1,15 @@ import { Component } from '@angular/core'; + import { QualityAssuranceTopicsComponent } from '../../notifications/qa/topics/quality-assurance-topics.component'; /** * Component for the page that show the QA topics related to a specific source. */ @Component({ - selector: 'ds-notification-qa-page', - templateUrl: './quality-assurance-topics-page.component.html', - standalone: true, - imports: [QualityAssuranceTopicsComponent] + selector: 'ds-notification-qa-page', + templateUrl: './quality-assurance-topics-page.component.html', + standalone: true, + imports: [QualityAssuranceTopicsComponent], }) export class QualityAssuranceTopicsPageComponent { diff --git a/src/app/register-email-form/register-email-form.component.spec.ts b/src/app/register-email-form/register-email-form.component.spec.ts index a1fa380f41..eda9110dc7 100644 --- a/src/app/register-email-form/register-email-form.component.spec.ts +++ b/src/app/register-email-form/register-email-form.component.spec.ts @@ -1,12 +1,25 @@ import { CommonModule } from '@angular/common'; import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, } from '@angular/forms'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { of as observableOf, of, } from 'rxjs'; +import { + of as observableOf, + of, +} from 'rxjs'; import { RestResponse } from '../core/cache/response.models'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; @@ -14,6 +27,8 @@ import { EpersonRegistrationService } from '../core/data/eperson-registration.se import { GoogleRecaptchaService } from '../core/google-recaptcha/google-recaptcha.service'; import { CookieService } from '../core/services/cookie.service'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; +import { AlertComponent } from '../shared/alert/alert.component'; +import { GoogleRecaptchaComponent } from '../shared/google-recaptcha/google-recaptcha.component'; import { CookieServiceMock } from '../shared/mocks/cookie.service.mock'; import { NotificationsService } from '../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils'; @@ -24,8 +39,6 @@ import { TYPE_REQUEST_FORGOT, TYPE_REQUEST_REGISTER, } from './register-email-form.component'; -import { GoogleRecaptchaComponent } from '../shared/google-recaptcha/google-recaptcha.component'; -import { AlertComponent } from '../shared/alert/alert.component'; describe('RegisterEmailFormComponent', () => { @@ -64,8 +77,8 @@ describe('RegisterEmailFormComponent', () => { jasmine.getEnv().allowRespy(true); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailFormComponent, FormsModule], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailFormComponent, FormsModule], + providers: [ { provide: Router, useValue: router }, { provide: EpersonRegistrationService, useValue: epersonRegistrationService }, { provide: ConfigurationDataService, useValue: configurationDataService }, @@ -73,12 +86,12 @@ describe('RegisterEmailFormComponent', () => { { provide: NotificationsService, useValue: notificationsService }, { provide: CookieService, useValue: new CookieServiceMock() }, { provide: GoogleRecaptchaService, useValue: googleRecaptchaService }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).overrideComponent(RegisterEmailFormComponent, { - remove: { imports: [GoogleRecaptchaComponent, AlertComponent] } -}) - .compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(RegisterEmailFormComponent, { + remove: { imports: [GoogleRecaptchaComponent, AlertComponent] }, + }) + .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(RegisterEmailFormComponent); diff --git a/src/app/register-email-form/register-email-form.component.ts b/src/app/register-email-form/register-email-form.component.ts index a8b7f6b313..25916fd87e 100644 --- a/src/app/register-email-form/register-email-form.component.ts +++ b/src/app/register-email-form/register-email-form.component.ts @@ -1,7 +1,15 @@ -import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, Optional } from '@angular/core'; -import { EpersonRegistrationService } from '../core/data/eperson-registration.service'; -import { NotificationsService } from '../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Input, + OnDestroy, + OnInit, + Optional, +} from '@angular/core'; import { FormsModule, ReactiveFormsModule, @@ -12,31 +20,53 @@ import { Validators, } from '@angular/forms'; import { Router } from '@angular/router'; -import { Registration } from '../core/shared/registration.model'; -import { RemoteData } from '../core/data/remote-data'; -import { BehaviorSubject, combineLatest, Observable, of, Subscription, switchMap, } from 'rxjs'; -import { map, startWith, take, } from 'rxjs/operators'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, + Observable, + of, + Subscription, + switchMap, +} from 'rxjs'; +import { + map, + startWith, + take, +} from 'rxjs/operators'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; -import { CAPTCHA_NAME, GoogleRecaptchaService, } from '../core/google-recaptcha/google-recaptcha.service'; +import { EpersonRegistrationService } from '../core/data/eperson-registration.service'; +import { RemoteData } from '../core/data/remote-data'; +import { + CAPTCHA_NAME, + GoogleRecaptchaService, +} from '../core/google-recaptcha/google-recaptcha.service'; import { CookieService } from '../core/services/cookie.service'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; -import { getAllSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../core/shared/operators'; +import { + getAllSucceededRemoteDataPayload, + getFirstSucceededRemoteDataPayload, +} from '../core/shared/operators'; +import { Registration } from '../core/shared/registration.model'; +import { AlertComponent } from '../shared/alert/alert.component'; import { AlertType } from '../shared/alert/alert-type'; import { KlaroService } from '../shared/cookies/klaro.service'; import { isNotEmpty } from '../shared/empty.util'; import { GoogleRecaptchaComponent } from '../shared/google-recaptcha/google-recaptcha.component'; -import { AlertComponent } from '../shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { NotificationsService } from '../shared/notifications/notifications.service'; export const TYPE_REQUEST_FORGOT = 'forgot'; export const TYPE_REQUEST_REGISTER = 'register'; @Component({ - selector: 'ds-register-email-form', - templateUrl: './register-email-form.component.html', - standalone: true, - imports: [NgIf, FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule] + selector: 'ds-register-email-form', + templateUrl: './register-email-form.component.html', + standalone: true, + imports: [NgIf, FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule], }) /** * Component responsible to render an email registration form. diff --git a/src/app/register-email-form/register-email-form.module.ts b/src/app/register-email-form/register-email-form.module.ts index 564a9a9438..6c95c313bf 100644 --- a/src/app/register-email-form/register-email-form.module.ts +++ b/src/app/register-email-form/register-email-form.module.ts @@ -1,7 +1,8 @@ import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; + import { RegisterEmailFormComponent } from './register-email-form.component'; import { ThemedRegisterEmailFormComponent } from './themed-registry-email-form.component'; -import { NgModule } from '@angular/core'; const DECLARATIONS = [ RegisterEmailFormComponent, @@ -9,13 +10,13 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - ...DECLARATIONS, - ], - providers: [], - exports: [ - ...DECLARATIONS, + imports: [ + CommonModule, + ...DECLARATIONS, + ], + providers: [], + exports: [ + ...DECLARATIONS, ], }) diff --git a/src/app/register-email-form/themed-registry-email-form.component.ts b/src/app/register-email-form/themed-registry-email-form.component.ts index 374b7fdc62..679e0c9a0f 100644 --- a/src/app/register-email-form/themed-registry-email-form.component.ts +++ b/src/app/register-email-form/themed-registry-email-form.component.ts @@ -13,7 +13,7 @@ import { RegisterEmailFormComponent } from './register-email-form.component'; selector: 'ds-themed-register-email-form', styleUrls: [], templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + standalone: true, }) export class ThemedRegisterEmailFormComponent extends ThemedComponent { diff --git a/src/app/register-page/create-profile/create-profile.component.spec.ts b/src/app/register-page/create-profile/create-profile.component.spec.ts index c7e9cf68f7..1b770e1cd6 100644 --- a/src/app/register-page/create-profile/create-profile.component.spec.ts +++ b/src/app/register-page/create-profile/create-profile.component.spec.ts @@ -28,6 +28,7 @@ import { import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { Registration } from '../../core/shared/registration.model'; +import { ProfilePageSecurityFormComponent } from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, @@ -37,9 +38,6 @@ import { import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; import { RouterStub } from '../../shared/testing/router.stub'; import { CreateProfileComponent } from './create-profile.component'; -import { - ProfilePageSecurityFormComponent -} from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; describe('CreateProfileComponent', () => { let comp: CreateProfileComponent; @@ -142,8 +140,8 @@ describe('CreateProfileComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, CreateProfileComponent], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, CreateProfileComponent], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: Store, useValue: store }, @@ -151,11 +149,11 @@ describe('CreateProfileComponent', () => { { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, { provide: NotificationsService, useValue: notificationsService }, { provide: EndUserAgreementService, useValue: endUserAgreementService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .overrideComponent(CreateProfileComponent, { - remove: { imports: [ProfilePageSecurityFormComponent]} + remove: { imports: [ProfilePageSecurityFormComponent] }, }) .compileComponents(); })); diff --git a/src/app/register-page/create-profile/create-profile.component.ts b/src/app/register-page/create-profile/create-profile.component.ts index 365ff859e0..5c4526b494 100644 --- a/src/app/register-page/create-profile/create-profile.component.ts +++ b/src/app/register-page/create-profile/create-profile.component.ts @@ -1,59 +1,77 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { map } from 'rxjs/operators'; -import { Registration } from '../../core/shared/registration.model'; -import { Observable } from 'rxjs'; import { - ReactiveFormsModule, - UntypedFormBuilder, - UntypedFormControl, - UntypedFormGroup, - Validators -} from '@angular/forms'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { EPersonDataService } from '../../core/eperson/eperson-data.service'; -import { EPerson } from '../../core/eperson/models/eperson.model'; + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, + Component, + OnInit, OnInit, } from '@angular/core'; import { + ReactiveFormsModule, + UntypedFormBuilder, UntypedFormBuilder, UntypedFormControl, + UntypedFormControl, UntypedFormGroup, + UntypedFormGroup, + Validators, Validators, } from '@angular/forms'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + Observable, +} from 'rxjs'; +import { + map, + map, +} from 'rxjs/operators'; import { LangConfig } from '../../../config/lang-config.interface'; import { environment } from '../../../environments/environment'; import { AuthenticateAction } from '../../core/auth/auth.actions'; -import { CoreState } from '../../core/core-state.model'; +import { + CoreState, + CoreState, +} from '../../core/core-state.model'; import { RemoteData } from '../../core/data/remote-data'; import { END_USER_AGREEMENT_METADATA_FIELD, EndUserAgreementService, } from '../../core/end-user-agreement/end-user-agreement.service'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { CoreState } from '../../core/core-state.model'; import { - ProfilePageSecurityFormComponent -} from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { EPersonDataService } from '../../core/eperson/eperson-data.service'; -import { EPerson } from '../../core/eperson/models/eperson.model'; + EPersonDataService, + EPersonDataService, +} from '../../core/eperson/eperson-data.service'; +import { + EPerson, + EPerson, +} from '../../core/eperson/models/eperson.model'; import { getFirstCompletedRemoteData, + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; -import { Registration } from '../../core/shared/registration.model'; +import { + Registration, + Registration, +} from '../../core/shared/registration.model'; +import { ProfilePageSecurityFormComponent } from '../../profile-page/profile-page-security-form/profile-page-security-form.component'; import { isEmpty } from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; @@ -70,9 +88,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s NgIf, AsyncPipe, ReactiveFormsModule, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class CreateProfileComponent implements OnInit { registration$: Observable; diff --git a/src/app/register-page/create-profile/themed-create-profile.component.ts b/src/app/register-page/create-profile/themed-create-profile.component.ts index 00edff81ed..cf5d6d2def 100644 --- a/src/app/register-page/create-profile/themed-create-profile.component.ts +++ b/src/app/register-page/create-profile/themed-create-profile.component.ts @@ -7,10 +7,10 @@ import { CreateProfileComponent } from './create-profile.component'; * Themed wrapper for CreateProfileComponent */ @Component({ - selector: 'ds-themed-create-profile', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-create-profile', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCreateProfileComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/register-page/register-email/register-email.component.spec.ts b/src/app/register-page/register-email/register-email.component.spec.ts index 1cce5f7315..8696c2fed5 100644 --- a/src/app/register-page/register-email/register-email.component.spec.ts +++ b/src/app/register-page/register-email/register-email.component.spec.ts @@ -1,12 +1,16 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; -import { RegisterEmailComponent } from './register-email.component'; import { RegisterEmailFormComponent } from '../../register-email-form/register-email-form.component'; import { ThemedRegisterEmailFormComponent } from '../../register-email-form/themed-registry-email-form.component'; +import { RegisterEmailComponent } from './register-email.component'; describe('RegisterEmailComponent', () => { @@ -16,12 +20,12 @@ describe('RegisterEmailComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) .overrideComponent(RegisterEmailComponent, { remove: { - imports: [RegisterEmailFormComponent, ThemedRegisterEmailFormComponent] - } + imports: [RegisterEmailFormComponent, ThemedRegisterEmailFormComponent], + }, }) .compileComponents(); })); diff --git a/src/app/register-page/register-email/register-email.component.ts b/src/app/register-page/register-email/register-email.component.ts index 771d0a98d7..6164cb30d2 100644 --- a/src/app/register-page/register-email/register-email.component.ts +++ b/src/app/register-page/register-email/register-email.component.ts @@ -1,19 +1,19 @@ import { Component } from '@angular/core'; +import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; import { RegisterEmailFormComponent, - TYPE_REQUEST_REGISTER + TYPE_REQUEST_REGISTER, } from '../../register-email-form/register-email-form.component'; -import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; @Component({ selector: 'ds-register-email', styleUrls: ['./register-email.component.scss'], templateUrl: './register-email.component.html', imports: [ - RegisterEmailFormComponent, ThemedRegisterEmailFormComponent + RegisterEmailFormComponent, ThemedRegisterEmailFormComponent, ], - standalone: true + standalone: true, }) /** * Component responsible the email registration step when registering as a new user diff --git a/src/app/register-page/register-email/themed-register-email.component.ts b/src/app/register-page/register-email/themed-register-email.component.ts index d33a10a2e0..987191d218 100644 --- a/src/app/register-page/register-email/themed-register-email.component.ts +++ b/src/app/register-page/register-email/themed-register-email.component.ts @@ -7,10 +7,10 @@ import { RegisterEmailComponent } from './register-email.component'; * Themed wrapper for RegisterEmailComponent */ @Component({ - selector: 'ds-themed-register-email', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-register-email', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedRegisterEmailComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/register-page/register-page-routes.ts b/src/app/register-page/register-page-routes.ts index 9a7980b25f..d1d3e7ed49 100644 --- a/src/app/register-page/register-page-routes.ts +++ b/src/app/register-page/register-page-routes.ts @@ -1,29 +1,30 @@ -import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component'; -import { ItemPageResolver } from '../item-page/item-page.resolver'; -import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard'; -import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component'; -import { RegistrationGuard } from './registration.guard'; import { Route } from '@angular/router'; +import { EndUserAgreementCookieGuard } from '../core/end-user-agreement/end-user-agreement-cookie.guard'; +import { ItemPageResolver } from '../item-page/item-page.resolver'; +import { ThemedCreateProfileComponent } from './create-profile/themed-create-profile.component'; +import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component'; +import { RegistrationGuard } from './registration.guard'; + export const ROUTES: Route[] = [ { path: '', component: ThemedRegisterEmailComponent, providers: [ - ItemPageResolver + ItemPageResolver, ], - data: {title: 'register-email.title'}, + data: { title: 'register-email.title' }, }, { path: ':token', component: ThemedCreateProfileComponent, providers: [ - ItemPageResolver + ItemPageResolver, ], canActivate: [ RegistrationGuard, EndUserAgreementCookieGuard, ], - } + }, ]; diff --git a/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts b/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts index 5ec05b01e3..ea2848f67b 100644 --- a/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts +++ b/src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts @@ -23,17 +23,17 @@ import { EPerson } from '../../core/eperson/models/eperson.model'; import { Item } from '../../core/shared/item.model'; import { ItemRequest } from '../../core/shared/item-request.model'; import { DSONameServiceMock } from '../../shared/mocks/dso-name.service.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; +import { ThemeService } from '../../shared/theme-support/theme.service'; import { VarDirective } from '../../shared/utils/var.directive'; import { RequestCopyEmail } from '../email-request-copy/request-copy-email.model'; import { DenyRequestCopyComponent } from './deny-request-copy.component'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; describe('DenyRequestCopyComponent', () => { let component: DenyRequestCopyComponent; @@ -112,8 +112,8 @@ describe('DenyRequestCopyComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); return TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DenyRequestCopyComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DenyRequestCopyComponent, VarDirective], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: AuthService, useValue: authService }, @@ -122,9 +122,9 @@ describe('DenyRequestCopyComponent', () => { { provide: ItemRequestDataService, useValue: itemRequestService }, { provide: NotificationsService, useValue: notificationsService }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts b/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts index 428de7f9ab..9d7a86d6a9 100644 --- a/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts +++ b/src/app/request-copy/deny-request-copy/deny-request-copy.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -6,8 +10,13 @@ import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, combineLatest as observableCombineLatest, Observable, } from 'rxjs'; @@ -17,14 +26,15 @@ import { } from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; -import { combineLatest as observableCombineLatest } from 'rxjs'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { ItemRequestDataService } from '../../core/data/item-request-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { EPerson } from '../../core/eperson/models/eperson.model'; -import { redirectOn4xx } from '../../core/shared/authorized.operators'; +import { + redirectOn4xx, + redirectOn4xx, +} from '../../core/shared/authorized.operators'; import { Item } from '../../core/shared/item.model'; import { ItemRequest } from '../../core/shared/item-request.model'; import { @@ -32,21 +42,21 @@ import { getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; import { isNotEmpty } from '../../shared/empty.util'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { RequestCopyEmail } from '../email-request-copy/request-copy-email.model'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { redirectOn4xx } from '../../core/shared/authorized.operators'; import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-email-request-copy.component'; -import { NgIf, AsyncPipe } from '@angular/common'; +import { + NotificationsService, + NotificationsService, +} from '../../shared/notifications/notifications.service'; import { VarDirective } from '../../shared/utils/var.directive'; +import { RequestCopyEmail } from '../email-request-copy/request-copy-email.model'; +import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-email-request-copy.component'; @Component({ - selector: 'ds-deny-request-copy', - styleUrls: ['./deny-request-copy.component.scss'], - templateUrl: './deny-request-copy.component.html', - standalone: true, - imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-deny-request-copy', + styleUrls: ['./deny-request-copy.component.scss'], + templateUrl: './deny-request-copy.component.html', + standalone: true, + imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * Component for denying an item request diff --git a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts index 9f4b6a91f2..45141d10dd 100644 --- a/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts +++ b/src/app/request-copy/deny-request-copy/themed-deny-request-copy.component.ts @@ -7,10 +7,10 @@ import { DenyRequestCopyComponent } from './deny-request-copy.component'; * Themed wrapper for deny-request-copy.component */ @Component({ - selector: 'ds-themed-deny-request-copy', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-deny-request-copy', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedDenyRequestCopyComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/request-copy/email-request-copy/email-request-copy.component.spec.ts b/src/app/request-copy/email-request-copy/email-request-copy.component.spec.ts index aaf8472d4b..2e84a9a9c1 100644 --- a/src/app/request-copy/email-request-copy/email-request-copy.component.spec.ts +++ b/src/app/request-copy/email-request-copy/email-request-copy.component.spec.ts @@ -22,12 +22,12 @@ describe('EmailRequestCopyComponent', () => { location = jasmine.createSpyObj('location', ['back']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), EmailRequestCopyComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), EmailRequestCopyComponent, VarDirective], + providers: [ { provide: Location, useValue: location }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/request-copy/email-request-copy/email-request-copy.component.ts b/src/app/request-copy/email-request-copy/email-request-copy.component.ts index 362893816e..692e859160 100644 --- a/src/app/request-copy/email-request-copy/email-request-copy.component.ts +++ b/src/app/request-copy/email-request-copy/email-request-copy.component.ts @@ -1,24 +1,34 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { RequestCopyEmail } from './request-copy-email.model'; -import { Location, NgClass, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule } from '@angular/forms'; -import { Location } from '@angular/common'; +import { + Location, + Location, + NgClass, + NgIf, +} from '@angular/common'; import { Component, + Component, + EventEmitter, EventEmitter, Input, + Input, + Output, Output, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; + +import { + RequestCopyEmail, + RequestCopyEmail, +} from './request-copy-email.model'; -import { RequestCopyEmail } from './request-copy-email.model'; @Component({ - selector: 'ds-email-request-copy', - styleUrls: ['./email-request-copy.component.scss'], - templateUrl: './email-request-copy.component.html', - standalone: true, - imports: [FormsModule, NgClass, NgIf, TranslateModule] + selector: 'ds-email-request-copy', + styleUrls: ['./email-request-copy.component.scss'], + templateUrl: './email-request-copy.component.html', + standalone: true, + imports: [FormsModule, NgClass, NgIf, TranslateModule], }) /** * A form component for an email to send back to the user requesting an item diff --git a/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts b/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts index 594ffb60c3..2512485f81 100644 --- a/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts +++ b/src/app/request-copy/email-request-copy/themed-email-request-copy.component.ts @@ -13,10 +13,10 @@ import { RequestCopyEmail } from './request-copy-email.model'; * Themed wrapper for email-request-copy.component */ @Component({ - selector: 'ds-themed-email-request-copy', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-email-request-copy', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedEmailRequestCopyComponent extends ThemedComponent { /** diff --git a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts index 6a514ab056..b00c8575bc 100644 --- a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts +++ b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts @@ -84,15 +84,15 @@ describe('GrantDenyRequestCopyComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), GrantDenyRequestCopyComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), GrantDenyRequestCopyComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: AuthService, useValue: authService }, { provide: ItemDataService, useValue: itemDataService }, { provide: DSONameService, useValue: nameService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts index 661dad3948..101b462914 100644 --- a/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts +++ b/src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts @@ -1,29 +1,48 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { map, switchMap } from 'rxjs/operators'; -import { ItemRequest } from '../../core/shared/item-request.model'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { ItemDataService } from '../../core/data/item-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; import { Item } from '../../core/shared/item.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; +import { ItemRequest } from '../../core/shared/item-request.model'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../core/shared/operators'; import { getItemPageRoute } from '../../item-page/item-page-routing-paths'; -import { getRequestCopyDenyRoute, getRequestCopyGrantRoute, } from '../request-copy-routing-paths'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { + getRequestCopyDenyRoute, + getRequestCopyGrantRoute, +} from '../request-copy-routing-paths'; @Component({ - selector: 'ds-grant-deny-request-copy', - styleUrls: ['./grant-deny-request-copy.component.scss'], - templateUrl: './grant-deny-request-copy.component.html', - standalone: true, - imports: [VarDirective, NgIf, RouterLink, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-grant-deny-request-copy', + styleUrls: ['./grant-deny-request-copy.component.scss'], + templateUrl: './grant-deny-request-copy.component.html', + standalone: true, + imports: [VarDirective, NgIf, RouterLink, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * Component for an author to decide to grant or deny an item request diff --git a/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts b/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts index 7e07bf29d0..e9865d4dc3 100644 --- a/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts +++ b/src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts @@ -1,8 +1,18 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; @@ -13,17 +23,17 @@ import { EPerson } from '../../core/eperson/models/eperson.model'; import { Item } from '../../core/shared/item.model'; import { ItemRequest } from '../../core/shared/item-request.model'; import { DSONameServiceMock } from '../../shared/mocks/dso-name.service.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; +import { ThemeService } from '../../shared/theme-support/theme.service'; import { VarDirective } from '../../shared/utils/var.directive'; import { RequestCopyEmail } from '../email-request-copy/request-copy-email.model'; import { GrantRequestCopyComponent } from './grant-request-copy.component'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../shared/theme-support/theme.service'; describe('GrantRequestCopyComponent', () => { let component: GrantRequestCopyComponent; @@ -102,8 +112,8 @@ describe('GrantRequestCopyComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); return TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), GrantRequestCopyComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), GrantRequestCopyComponent, VarDirective], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: AuthService, useValue: authService }, @@ -112,9 +122,9 @@ describe('GrantRequestCopyComponent', () => { { provide: ItemRequestDataService, useValue: itemRequestService }, { provide: NotificationsService, useValue: notificationsService }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts b/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts index 578699c91d..e2e2fe8843 100644 --- a/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts +++ b/src/app/request-copy/grant-request-copy/grant-request-copy.component.ts @@ -1,29 +1,47 @@ -import { Component, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; import { ItemRequestDataService } from '../../core/data/item-request-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { FormsModule } from '@angular/forms'; -import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-email-request-copy.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; import { ItemRequest } from '../../core/shared/item-request.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../core/shared/operators'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { VarDirective } from '../../shared/utils/var.directive'; import { RequestCopyEmail } from '../email-request-copy/request-copy-email.model'; +import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-email-request-copy.component'; @Component({ - selector: 'ds-grant-request-copy', - styleUrls: ['./grant-request-copy.component.scss'], - templateUrl: './grant-request-copy.component.html', - standalone: true, - imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-grant-request-copy', + styleUrls: ['./grant-request-copy.component.scss'], + templateUrl: './grant-request-copy.component.html', + standalone: true, + imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * Component for granting an item request diff --git a/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts b/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts index d61990becd..7c6f9f61a6 100644 --- a/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts +++ b/src/app/request-copy/grant-request-copy/themed-grant-request-copy.component.ts @@ -7,10 +7,10 @@ import { GrantRequestCopyComponent } from './grant-request-copy.component'; * Themed wrapper for grant-request-copy.component */ @Component({ - selector: 'ds-themed-grant-request-copy', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-grant-request-copy', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedGrantRequestCopyComponent extends ThemedComponent { diff --git a/src/app/request-copy/request-copy-routes.ts b/src/app/request-copy/request-copy-routes.ts index 23b387ebd9..aa4d579027 100644 --- a/src/app/request-copy/request-copy-routes.ts +++ b/src/app/request-copy/request-copy-routes.ts @@ -1,19 +1,23 @@ import { Route } from '@angular/router'; -import { RequestCopyResolver } from './request-copy.resolver'; -import { GrantDenyRequestCopyComponent } from './grant-deny-request-copy/grant-deny-request-copy.component'; -import { REQUEST_COPY_DENY_PATH, REQUEST_COPY_GRANT_PATH } from './request-copy-routing-paths'; + import { ThemedDenyRequestCopyComponent } from './deny-request-copy/themed-deny-request-copy.component'; +import { GrantDenyRequestCopyComponent } from './grant-deny-request-copy/grant-deny-request-copy.component'; import { ThemedGrantRequestCopyComponent } from './grant-request-copy/themed-grant-request-copy.component'; +import { RequestCopyResolver } from './request-copy.resolver'; +import { + REQUEST_COPY_DENY_PATH, + REQUEST_COPY_GRANT_PATH, +} from './request-copy-routing-paths'; export const ROUTES: Route[] = [ { path: ':token', providers: [ RequestCopyResolver, - GrantDenyRequestCopyComponent + GrantDenyRequestCopyComponent, ], resolve: { - request: RequestCopyResolver + request: RequestCopyResolver, }, children: [ { @@ -28,6 +32,6 @@ export const ROUTES: Route[] = [ path: REQUEST_COPY_GRANT_PATH, component: ThemedGrantRequestCopyComponent, }, - ] - } + ], + }, ]; diff --git a/src/app/root.module.ts b/src/app/root.module.ts index b2bd150180..a6308d72f2 100644 --- a/src/app/root.module.ts +++ b/src/app/root.module.ts @@ -3,12 +3,8 @@ import { NgModule } from '@angular/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { AdminSidebarComponent } from './admin/admin-sidebar/admin-sidebar.component'; -import { - AdminSidebarSectionComponent -} from './admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; -import { - ExpandableAdminSidebarSectionComponent -} from './admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; +import { AdminSidebarSectionComponent } from './admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; +import { ExpandableAdminSidebarSectionComponent } from './admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; import { ThemedAdminSidebarComponent } from './admin/admin-sidebar/themed-admin-sidebar.component'; import { BreadcrumbsComponent } from './breadcrumbs/breadcrumbs.component'; import { ThemedBreadcrumbsComponent } from './breadcrumbs/themed-breadcrumbs.component'; @@ -25,16 +21,14 @@ import { NavbarModule } from './navbar/navbar.module'; import { PageErrorComponent } from './page-error/page-error.component'; import { ThemedPageErrorComponent } from './page-error/themed-page-error.component'; import { PageInternalServerErrorComponent } from './page-internal-server-error/page-internal-server-error.component'; -import { - ThemedPageInternalServerErrorComponent -} from './page-internal-server-error/themed-page-internal-server-error.component'; +import { ThemedPageInternalServerErrorComponent } from './page-internal-server-error/themed-page-internal-server-error.component'; import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; -import { NotificationComponent } from './shared/notifications/notification/notification.component'; -import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component'; import { ThemedPageNotFoundComponent } from './pagenotfound/themed-pagenotfound.component'; import { RootComponent } from './root/root.component'; import { ThemedRootComponent } from './root/themed-root.component'; import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; +import { NotificationComponent } from './shared/notifications/notification/notification.component'; +import { NotificationsBoardComponent } from './shared/notifications/notifications-board/notifications-board.component'; import { SystemWideAlertModule } from './system-wide-alert/system-wide-alert.module'; const IMPORTS = [ @@ -80,16 +74,16 @@ const EXPORTS = [ ]; @NgModule({ - imports: [ - ...IMPORTS, - ...DECLARATIONS - ], - providers: [ + imports: [ + ...IMPORTS, + ...DECLARATIONS, + ], + providers: [ ...PROVIDERS, - ], - exports: [ - ...EXPORTS, - ...DECLARATIONS, + ], + exports: [ + ...EXPORTS, + ...DECLARATIONS, ], }) export class RootModule { diff --git a/src/app/root/root.component.spec.ts b/src/app/root/root.component.spec.ts index 0c53b11d0f..9f7f8f4f0e 100644 --- a/src/app/root/root.component.spec.ts +++ b/src/app/root/root.component.spec.ts @@ -1,20 +1,37 @@ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { StoreModule } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { ThemedAdminSidebarComponent } from '../admin/admin-sidebar/themed-admin-sidebar.component'; import { storeModuleConfig } from '../app.reducer'; +import { ThemedBreadcrumbsComponent } from '../breadcrumbs/themed-breadcrumbs.component'; import { authReducer } from '../core/auth/auth.reducer'; import { AuthService } from '../core/auth/auth.service'; import { LocaleService } from '../core/locale/locale.service'; import { MetadataService } from '../core/metadata/metadata.service'; import { RouteService } from '../core/services/route.service'; -import { NativeWindowRef, NativeWindowService, } from '../core/services/window.service'; +import { + NativeWindowRef, + NativeWindowService, +} from '../core/services/window.service'; +import { ThemedFooterComponent } from '../footer/themed-footer.component'; +import { ThemedHeaderNavbarWrapperComponent } from '../header-nav-wrapper/themed-header-navbar-wrapper.component'; import { HostWindowService } from '../shared/host-window.service'; +import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; import { MenuService } from '../shared/menu/menu.service'; import { MockActivatedRoute } from '../shared/mocks/active-router.mock'; import { AngularticsProviderMock } from '../shared/mocks/angulartics-provider.service.mock'; @@ -22,19 +39,14 @@ import { AuthServiceMock } from '../shared/mocks/auth.service.mock'; import { MetadataServiceMock } from '../shared/mocks/metadata-service.mock'; import { RouterMock } from '../shared/mocks/router.mock'; import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock'; +import { NotificationsBoardComponent } from '../shared/notifications/notifications-board/notifications-board.component'; import { CSSVariableService } from '../shared/sass-helper/css-variable.service'; import { CSSVariableServiceStub } from '../shared/testing/css-variable-service.stub'; import { HostWindowServiceStub } from '../shared/testing/host-window-service.stub'; import { MenuServiceStub } from '../shared/testing/menu-service.stub'; import { Angulartics2DSpace } from '../statistics/angulartics/dspace-provider'; -import { RootComponent } from './root.component'; -import { NotificationsBoardComponent } from '../shared/notifications/notifications-board/notifications-board.component'; import { SystemWideAlertBannerComponent } from '../system-wide-alert/alert-banner/system-wide-alert-banner.component'; -import { ThemedAdminSidebarComponent } from '../admin/admin-sidebar/themed-admin-sidebar.component'; -import { ThemedHeaderNavbarWrapperComponent } from '../header-nav-wrapper/themed-header-navbar-wrapper.component'; -import { ThemedBreadcrumbsComponent } from '../breadcrumbs/themed-breadcrumbs.component'; -import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { ThemedFooterComponent } from '../footer/themed-footer.component'; +import { RootComponent } from './root.component'; describe('RootComponent', () => { let component: RootComponent; @@ -42,19 +54,19 @@ describe('RootComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NoopAnimationsModule, StoreModule.forRoot(authReducer, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - RootComponent - ], - providers: [ + RootComponent, + ], + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: MetadataService, useValue: new MetadataServiceMock() }, { provide: Angulartics2DSpace, useValue: new AngularticsProviderMock() }, @@ -68,23 +80,23 @@ describe('RootComponent', () => { provideMockStore({ core: { auth: { loading: false } } } as any), RootComponent, RouteService, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) -.overrideComponent(RootComponent, { - remove: { - imports: [ - ThemedAdminSidebarComponent, - SystemWideAlertBannerComponent, - ThemedHeaderNavbarWrapperComponent, - ThemedBreadcrumbsComponent, - ThemedLoadingComponent, - ThemedFooterComponent, - NotificationsBoardComponent - ] - } -}) -.compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .overrideComponent(RootComponent, { + remove: { + imports: [ + ThemedAdminSidebarComponent, + SystemWideAlertBannerComponent, + ThemedHeaderNavbarWrapperComponent, + ThemedBreadcrumbsComponent, + ThemedLoadingComponent, + ThemedFooterComponent, + NotificationsBoardComponent, + ], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/root/root.component.ts b/src/app/root/root.component.ts index 1c2fe39876..d98fd85b0a 100644 --- a/src/app/root/root.component.ts +++ b/src/app/root/root.component.ts @@ -1,33 +1,53 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { Router, RouterOutlet } from '@angular/router'; -import { combineLatest as combineLatestObservable, Observable, of, } from 'rxjs'; -import { first, map, skipWhile, startWith, } from 'rxjs/operators'; -import { INotificationBoardOptions } from 'src/config/notifications-config.interfaces'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + Router, + RouterOutlet, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { CSSVariableService } from '../shared/sass-helper/css-variable.service'; -import { MenuService } from '../shared/menu/menu.service'; -import { HostWindowService } from '../shared/host-window.service'; +import { + combineLatest as combineLatestObservable, + Observable, + of, +} from 'rxjs'; +import { + first, + map, + skipWhile, + startWith, +} from 'rxjs/operators'; +import { INotificationBoardOptions } from 'src/config/notifications-config.interfaces'; + import { ThemeConfig } from '../../config/theme.config'; import { environment } from '../../environments/environment'; +import { ThemedAdminSidebarComponent } from '../admin/admin-sidebar/themed-admin-sidebar.component'; import { getPageInternalServerErrorRoute } from '../app-routing-paths'; +import { ThemedBreadcrumbsComponent } from '../breadcrumbs/themed-breadcrumbs.component'; +import { ThemedFooterComponent } from '../footer/themed-footer.component'; +import { ThemedHeaderNavbarWrapperComponent } from '../header-nav-wrapper/themed-header-navbar-wrapper.component'; import { slideSidebarPadding } from '../shared/animations/slide'; +import { HostWindowService } from '../shared/host-window.service'; +import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; +import { MenuService } from '../shared/menu/menu.service'; import { MenuID } from '../shared/menu/menu-id.model'; import { NotificationsBoardComponent } from '../shared/notifications/notifications-board/notifications-board.component'; -import { ThemedFooterComponent } from '../footer/themed-footer.component'; -import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedBreadcrumbsComponent } from '../breadcrumbs/themed-breadcrumbs.component'; -import { ThemedHeaderNavbarWrapperComponent } from '../header-nav-wrapper/themed-header-navbar-wrapper.component'; +import { CSSVariableService } from '../shared/sass-helper/css-variable.service'; import { SystemWideAlertBannerComponent } from '../system-wide-alert/alert-banner/system-wide-alert-banner.component'; -import { ThemedAdminSidebarComponent } from '../admin/admin-sidebar/themed-admin-sidebar.component'; @Component({ - selector: 'ds-root', - templateUrl: './root.component.html', - styleUrls: ['./root.component.scss'], - animations: [slideSidebarPadding], - standalone: true, - imports: [TranslateModule, ThemedAdminSidebarComponent, SystemWideAlertBannerComponent, ThemedHeaderNavbarWrapperComponent, ThemedBreadcrumbsComponent, NgIf, ThemedLoadingComponent, RouterOutlet, ThemedFooterComponent, NotificationsBoardComponent, AsyncPipe] + selector: 'ds-root', + templateUrl: './root.component.html', + styleUrls: ['./root.component.scss'], + animations: [slideSidebarPadding], + standalone: true, + imports: [TranslateModule, ThemedAdminSidebarComponent, SystemWideAlertBannerComponent, ThemedHeaderNavbarWrapperComponent, ThemedBreadcrumbsComponent, NgIf, ThemedLoadingComponent, RouterOutlet, ThemedFooterComponent, NotificationsBoardComponent, AsyncPipe], }) export class RootComponent implements OnInit { theme: Observable = of({} as any); diff --git a/src/app/root/themed-root.component.ts b/src/app/root/themed-root.component.ts index 3f2d307705..b2ea91c75d 100644 --- a/src/app/root/themed-root.component.ts +++ b/src/app/root/themed-root.component.ts @@ -7,10 +7,10 @@ import { ThemedComponent } from '../shared/theme-support/themed.component'; import { RootComponent } from './root.component'; @Component({ - selector: 'ds-themed-root', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-root', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedRootComponent extends ThemedComponent { /** diff --git a/src/app/search-navbar/search-navbar.component.spec.ts b/src/app/search-navbar/search-navbar.component.spec.ts index be95a0cff2..3d383cbcef 100644 --- a/src/app/search-navbar/search-navbar.component.spec.ts +++ b/src/app/search-navbar/search-navbar.component.spec.ts @@ -1,10 +1,25 @@ -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { NavigationExtras, Router, } from '@angular/router'; +import { + NavigationExtras, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { SearchService } from '../core/shared/search/search.service'; import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock'; @@ -24,23 +39,23 @@ describe('SearchNavbarComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, BrowserAnimationsModule, RouterTestingModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - SearchNavbarComponent - ], - providers: [ + SearchNavbarComponent, + ], + providers: [ { provide: SearchService, useValue: mockSearchService }, ], -}) + }) .compileComponents(); })); diff --git a/src/app/search-navbar/search-navbar.component.ts b/src/app/search-navbar/search-navbar.component.ts index 3a0cad9395..006a217d57 100644 --- a/src/app/search-navbar/search-navbar.component.ts +++ b/src/app/search-navbar/search-navbar.component.ts @@ -1,23 +1,31 @@ -import { Component, ElementRef, ViewChild, } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; +import { + Component, + ElementRef, + ViewChild, +} from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; import { Router } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../core/shared/search/search.service'; import { expandSearchInput } from '../shared/animations/slide'; import { BrowserOnlyPipe } from '../shared/utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; import { ClickOutsideDirective } from '../shared/utils/click-outside.directive'; /** * The search box in the header that expands on focus and collapses on focus out */ @Component({ - selector: 'ds-search-navbar', - templateUrl: './search-navbar.component.html', - styleUrls: ['./search-navbar.component.scss'], - animations: [expandSearchInput], - standalone: true, - imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe] + selector: 'ds-search-navbar', + templateUrl: './search-navbar.component.html', + styleUrls: ['./search-navbar.component.scss'], + animations: [expandSearchInput], + standalone: true, + imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe], }) export class SearchNavbarComponent { diff --git a/src/app/search-navbar/themed-search-navbar.component.ts b/src/app/search-navbar/themed-search-navbar.component.ts index b5a527bcc8..240b39314b 100644 --- a/src/app/search-navbar/themed-search-navbar.component.ts +++ b/src/app/search-navbar/themed-search-navbar.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../shared/theme-support/themed.component'; import { SearchNavbarComponent } from './search-navbar.component'; @Component({ - selector: 'ds-themed-search-navbar', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-navbar', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchNavbarComponent extends ThemedComponent { diff --git a/src/app/search-page/configuration-search-page.component.spec.ts b/src/app/search-page/configuration-search-page.component.spec.ts index 3f7f677030..ef94e0cc8f 100644 --- a/src/app/search-page/configuration-search-page.component.spec.ts +++ b/src/app/search-page/configuration-search-page.component.spec.ts @@ -26,9 +26,9 @@ const QUERY = 'test query'; `, imports: [ - ConfigurationSearchPageComponent + ConfigurationSearchPageComponent, ], - standalone: true + standalone: true, }) class HostComponent { @ViewChild('configurationSearchPage') configurationSearchPage: ConfigurationSearchPageComponent; diff --git a/src/app/search-page/configuration-search-page.component.ts b/src/app/search-page/configuration-search-page.component.ts index 570372fca7..24a13c1369 100644 --- a/src/app/search-page/configuration-search-page.component.ts +++ b/src/app/search-page/configuration-search-page.component.ts @@ -1,15 +1,18 @@ -import { HostWindowService } from '../shared/host-window.service'; -import { SidebarService } from '../shared/sidebar/sidebar.service'; -import { SearchComponent } from '../shared/search/search.component'; -import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; -import { pushInOut } from '../shared/animations/push'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; +import { + AsyncPipe, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { + ChangeDetectionStrategy, ChangeDetectionStrategy, Component, + Component, + Inject, Inject, } from '@angular/core'; import { Router } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { APP_CONFIG, @@ -17,39 +20,52 @@ import { } from '../../config/app-config.interface'; import { RouteService } from '../core/services/route.service'; import { SearchService } from '../core/shared/search/search.service'; -import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.component'; -import { pushInOut } from '../shared/animations/push'; -import { HostWindowService } from '../shared/host-window.service'; -import { SearchComponent } from '../shared/search/search.component'; -import { SidebarService } from '../shared/sidebar/sidebar.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchLabelsComponent } from '../shared/search/search-labels/search-labels.component'; -import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; -import { ThemedSearchSidebarComponent } from '../shared/search/search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchResultsComponent } from '../shared/search/search-results/themed-search-results.component'; -import { ViewModeSwitchComponent } from '../shared/view-mode-switch/view-mode-switch.component'; -import { PageWithSidebarComponent } from '../shared/sidebar/page-with-sidebar.component'; -import { NgIf, NgTemplateOutlet, AsyncPipe } from '@angular/common'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.component'; +import { + pushInOut, + pushInOut, +} from '../shared/animations/push'; +import { + HostWindowService, + HostWindowService, +} from '../shared/host-window.service'; +import { + SearchComponent, + SearchComponent, +} from '../shared/search/search.component'; +import { SearchLabelsComponent } from '../shared/search/search-labels/search-labels.component'; +import { ThemedSearchResultsComponent } from '../shared/search/search-results/themed-search-results.component'; +import { ThemedSearchSidebarComponent } from '../shared/search/search-sidebar/themed-search-sidebar.component'; +import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; +import { PageWithSidebarComponent } from '../shared/sidebar/page-with-sidebar.component'; +import { + SidebarService, + SidebarService, +} from '../shared/sidebar/sidebar.service'; +import { ViewModeSwitchComponent } from '../shared/view-mode-switch/view-mode-switch.component'; /** * This component renders a search page using a configuration as input. */ @Component({ - selector: 'ds-configuration-search-page', - styleUrls: ['../shared/search/search.component.scss'], - templateUrl: '../shared/search/search.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [pushInOut], - providers: [ - { - provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } - ], - standalone: true, - imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule] + selector: 'ds-configuration-search-page', + styleUrls: ['../shared/search/search.component.scss'], + templateUrl: '../shared/search/search.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [pushInOut], + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService, + }, + ], + standalone: true, + imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule], }) export class ConfigurationSearchPageComponent extends SearchComponent { diff --git a/src/app/search-page/search-page-routes.ts b/src/app/search-page/search-page-routes.ts index c7ade3ac46..ceeaee1adb 100644 --- a/src/app/search-page/search-page-routes.ts +++ b/src/app/search-page/search-page-routes.ts @@ -1,24 +1,24 @@ import { Route } from '@angular/router'; -import { ConfigurationSearchPageGuard } from './configuration-search-page.guard'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; -import { ThemedSearchPageComponent } from './themed-search-page.component'; +import { ConfigurationSearchPageGuard } from './configuration-search-page.guard'; import { ThemedConfigurationSearchPageComponent } from './themed-configuration-search-page.component'; +import { ThemedSearchPageComponent } from './themed-search-page.component'; export const ROUTES: Route[] = [{ path: '', - resolve: {breadcrumb: I18nBreadcrumbResolver}, data: {title: 'search.title', breadcrumbKey: 'search'}, + resolve: { breadcrumb: I18nBreadcrumbResolver }, data: { title: 'search.title', breadcrumbKey: 'search' }, providers: [ I18nBreadcrumbResolver, - I18nBreadcrumbsService + I18nBreadcrumbsService, ], children: [ - {path: '', component: ThemedSearchPageComponent}, + { path: '', component: ThemedSearchPageComponent }, { path: ':configuration', component: ThemedConfigurationSearchPageComponent, - canActivate: [ConfigurationSearchPageGuard] - } - ] + canActivate: [ConfigurationSearchPageGuard], + }, + ], }]; diff --git a/src/app/search-page/search-page.component.ts b/src/app/search-page/search-page.component.ts index 2c758709c8..ecc67296cd 100644 --- a/src/app/search-page/search-page.component.ts +++ b/src/app/search-page/search-page.component.ts @@ -1,20 +1,20 @@ import { Component } from '@angular/core'; import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; -import { ThemedSearchComponent } from '../shared/search/themed-search.component'; import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.component'; +import { ThemedSearchComponent } from '../shared/search/themed-search.component'; @Component({ - selector: 'ds-search-page', - templateUrl: './search-page.component.html', - providers: [ - { - provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } - ], - standalone: true, - imports: [ThemedSearchComponent] + selector: 'ds-search-page', + templateUrl: './search-page.component.html', + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService, + }, + ], + standalone: true, + imports: [ThemedSearchComponent], }) /** * This component represents the whole search page diff --git a/src/app/search-page/search-page.module.ts b/src/app/search-page/search-page.module.ts index 8079fbbdd9..ad43d046ce 100644 --- a/src/app/search-page/search-page.module.ts +++ b/src/app/search-page/search-page.module.ts @@ -1,5 +1,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; + import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../core/shared/search/search-filter.service'; import { SearchModule } from '../shared/search/search.module'; @@ -15,18 +16,18 @@ const components = [ ]; @NgModule({ - imports: [ - CommonModule, - SearchModule, - StatisticsModule.forRoot(), - ...components - ], - providers: [ - SidebarService, - SearchFilterService, - ConfigurationSearchPageGuard, + imports: [ + CommonModule, + SearchModule, + StatisticsModule.forRoot(), + ...components, + ], + providers: [ + SidebarService, + SearchFilterService, + ConfigurationSearchPageGuard, SearchConfigurationService, - ], + ], exports: components, }) diff --git a/src/app/search-page/themed-configuration-search-page.component.ts b/src/app/search-page/themed-configuration-search-page.component.ts index ad2a014e8b..fc9497268c 100644 --- a/src/app/search-page/themed-configuration-search-page.component.ts +++ b/src/app/search-page/themed-configuration-search-page.component.ts @@ -12,10 +12,10 @@ import { ConfigurationSearchPageComponent } from './configuration-search-page.co * Themed wrapper for ConfigurationSearchPageComponent */ @Component({ - selector: 'ds-themed-configuration-search-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-configuration-search-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedConfigurationSearchPageComponent extends ThemedComponent { /** diff --git a/src/app/search-page/themed-search-page.component.ts b/src/app/search-page/themed-search-page.component.ts index 11c13038ea..30e6e6db11 100644 --- a/src/app/search-page/themed-search-page.component.ts +++ b/src/app/search-page/themed-search-page.component.ts @@ -7,10 +7,10 @@ import { SearchPageComponent } from './search-page.component'; * Themed wrapper for SearchPageComponent */ @Component({ - selector: 'ds-themed-search-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-page', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchPageComponent extends ThemedComponent { diff --git a/src/app/shared/abstract-component-loader/abstract-component-loader.component.ts b/src/app/shared/abstract-component-loader/abstract-component-loader.component.ts index 732e5fecf9..e188725e47 100644 --- a/src/app/shared/abstract-component-loader/abstract-component-loader.component.ts +++ b/src/app/shared/abstract-component-loader/abstract-component-loader.component.ts @@ -35,7 +35,7 @@ import { DynamicComponentLoaderDirective } from './dynamic-component-loader.dire standalone: true, imports: [ DynamicComponentLoaderDirective, - ] + ], }) export abstract class AbstractComponentLoaderComponent implements OnInit, OnChanges, OnDestroy { diff --git a/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts b/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts index dd6c0bd871..702daa2d34 100644 --- a/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts +++ b/src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts @@ -8,7 +8,7 @@ import { */ @Directive({ standalone: true, - selector: '[dsDynamicComponentLoader]' + selector: '[dsDynamicComponentLoader]', }) export class DynamicComponentLoaderDirective { diff --git a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts index 9a7d579f2d..d3c64f2e6f 100644 --- a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts +++ b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts @@ -19,9 +19,9 @@ describe('AccessControlArrayFormComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule, AccessControlArrayFormComponent, ToDatePipe] -}) - .compileComponents(); + imports: [CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule, AccessControlArrayFormComponent, ToDatePipe], + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts index 88357d2e5d..dc6fe4d297 100644 --- a/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts +++ b/src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts @@ -1,23 +1,31 @@ +import { + NgFor, + NgIf, +} from '@angular/common'; import { Component, Input, OnInit, - ViewChild,} from '@angular/core'; -import { NgForm, FormsModule } from '@angular/forms'; + ViewChild, +} from '@angular/core'; +import { + FormsModule, + NgForm, +} from '@angular/forms'; +import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; + import { AccessesConditionOption } from '../../../core/config/models/config-accesses-conditions-options.model'; import { dateToISOFormat } from '../../date.util'; import { ToDatePipe } from './to-date.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf, NgFor } from '@angular/common'; @Component({ - selector: 'ds-access-control-array-form', - templateUrl: './access-control-array-form.component.html', - styleUrls: ['./access-control-array-form.component.scss'], - exportAs: 'accessControlArrayForm', - standalone: true, - imports: [FormsModule, NgIf, NgFor, NgbDatepickerModule, TranslateModule, ToDatePipe] + selector: 'ds-access-control-array-form', + templateUrl: './access-control-array-form.component.html', + styleUrls: ['./access-control-array-form.component.scss'], + exportAs: 'accessControlArrayForm', + standalone: true, + imports: [FormsModule, NgIf, NgFor, NgbDatepickerModule, TranslateModule, ToDatePipe], }) export class AccessControlArrayFormComponent implements OnInit { @Input() dropdownOptions: AccessesConditionOption[] = []; diff --git a/src/app/shared/access-control-form-container/access-control-array-form/to-date.pipe.ts b/src/app/shared/access-control-form-container/access-control-array-form/to-date.pipe.ts index 1006e5af08..c759e127e8 100644 --- a/src/app/shared/access-control-form-container/access-control-array-form/to-date.pipe.ts +++ b/src/app/shared/access-control-form-container/access-control-array-form/to-date.pipe.ts @@ -5,10 +5,10 @@ import { import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap/datepicker/ngb-date-struct'; @Pipe({ - // eslint-disable-next-line @angular-eslint/pipe-prefix - name: 'toDate', - pure: false, - standalone: true + // eslint-disable-next-line @angular-eslint/pipe-prefix + name: 'toDate', + pure: false, + standalone: true, }) export class ToDatePipe implements PipeTransform { transform(dateValue: string | null): NgbDateStruct | null { diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts index ee2336bebb..45e55bc5e8 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts @@ -19,11 +19,10 @@ import { BulkAccessConfigDataService } from '../../core/config/bulk-access-confi import { Item } from '../../core/shared/item.model'; import { SharedBrowseByModule } from '../browse-by/shared-browse-by.module'; import { SelectableListService } from '../object-list/selectable-list/selectable-list.service'; -import { AccessControlFormModule } from './access-control-form.module'; import { AccessControlFormContainerComponent } from './access-control-form-container.component'; import { createAccessControlInitialFormState } from './access-control-form-container-intial-state'; import { BulkAccessControlService } from './bulk-access-control.service'; -import { ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID} from './item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; +import { ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID } from './item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; describe('AccessControlFormContainerComponent', () => { @@ -36,11 +35,11 @@ describe('AccessControlFormContainerComponent', () => { selector: 'ds-ngb-modal', template: '', standalone: true, imports: [CommonModule, - FormsModule, - SharedBrowseByModule, - NgbDatepickerModule, - UiSwitchModule] -}) + FormsModule, + SharedBrowseByModule, + NgbDatepickerModule, + UiSwitchModule], + }) class MockNgbModalComponent { } @@ -67,22 +66,22 @@ describe('AccessControlFormContainerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule, UiSwitchModule, - AccessControlFormContainerComponent, MockNgbModalComponent - ], - providers: [ + AccessControlFormContainerComponent, MockNgbModalComponent, + ], + providers: [ { provide: BulkAccessControlService, useValue: mockBulkAccessControlService }, { provide: BulkAccessConfigDataService, useValue: mockBulkAccessConfigDataService }, { provide: SelectableListService, useValue: mockSelectableListService }, { provide: NgbModal, useValue: mockNgbModal }, - ] -}).compileComponents(); + ], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/access-control-form-container/access-control-form-container.component.ts b/src/app/shared/access-control-form-container/access-control-form-container.component.ts index 84b590199a..1a53ec5495 100644 --- a/src/app/shared/access-control-form-container/access-control-form-container.component.ts +++ b/src/app/shared/access-control-form-container/access-control-form-container.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -5,7 +9,10 @@ import { OnDestroy, ViewChild, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { UiSwitchModule } from 'ngx-ui-switch'; import { concatMap, Observable, @@ -16,41 +23,45 @@ import { take, } from 'rxjs/operators'; -import { BulkAccessConfigDataService } from '../../core/config/bulk-access-config-data.service'; -import { BulkAccessConditionOptions } from '../../core/config/models/bulk-access-condition-options.model'; +import { + BulkAccessConfigDataService, + BulkAccessConfigDataService, +} from '../../core/config/bulk-access-config-data.service'; +import { + BulkAccessConditionOptions, + BulkAccessConditionOptions, +} from '../../core/config/models/bulk-access-condition-options.model'; import { RemoteData } from '../../core/data/remote-data'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; -import { getFirstCompletedRemoteData } from '../../core/shared/operators'; -import { AlertType } from '../alert/alert-type'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../core/shared/operators'; +import { AlertComponent } from '../alert/alert.component'; +import { + AlertType, + AlertType, +} from '../alert/alert-type'; import { SelectableListService } from '../object-list/selectable-list/selectable-list.service'; import { AccessControlArrayFormComponent } from './access-control-array-form/access-control-array-form.component'; -import { createAccessControlInitialFormState } from './access-control-form-container-intial-state'; +import { + createAccessControlInitialFormState, + createAccessControlInitialFormState, +} from './access-control-form-container-intial-state'; import { BulkAccessControlService } from './bulk-access-control.service'; import { ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID, ItemAccessControlSelectBitstreamsModalComponent, } from './item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component'; -import { BulkAccessConfigDataService } from '../../core/config/bulk-access-config-data.service'; -import { getFirstCompletedRemoteData } from '../../core/shared/operators'; -import { BulkAccessConditionOptions } from '../../core/config/models/bulk-access-condition-options.model'; -import { AlertType } from '../alert/alert-type'; -import { - createAccessControlInitialFormState -} from './access-control-form-container-intial-state'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule } from '@angular/forms'; -import { UiSwitchModule } from 'ngx-ui-switch'; -import { AlertComponent } from '../alert/alert.component'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-access-control-form-container', - templateUrl: './access-control-form-container.component.html', - styleUrls: ['./access-control-form-container.component.scss'], - exportAs: 'dsAccessControlForm', - standalone: true, - imports: [NgIf, AlertComponent, UiSwitchModule, FormsModule, AccessControlArrayFormComponent, AsyncPipe, TranslateModule] + selector: 'ds-access-control-form-container', + templateUrl: './access-control-form-container.component.html', + styleUrls: ['./access-control-form-container.component.scss'], + exportAs: 'dsAccessControlForm', + standalone: true, + imports: [NgIf, AlertComponent, UiSwitchModule, FormsModule, AccessControlArrayFormComponent, AsyncPipe, TranslateModule], }) export class AccessControlFormContainerComponent implements OnDestroy { diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts index 2c5fc1d7db..453ec5ea4b 100644 --- a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts @@ -1,26 +1,31 @@ +import { + EventEmitter, + Pipe, + PipeTransform, +} from '@angular/core'; import { ComponentFixture, TestBed, } from '@angular/core/testing'; - -import { - ItemAccessControlSelectBitstreamsModalComponent -} from './item-access-control-select-bitstreams-modal.component'; -import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; -import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { TranslateService } from '@ngx-translate/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Item } from '../../../core/shared/item.model'; -import { Observable, of as observableOf } from 'rxjs'; -import { RemoteData } from '../../../core/data/remote-data'; -import { Bitstream } from '../../../core/shared/bitstream.model'; -import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; +import { TranslateService } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; + +import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { FindListOptions } from '../../../core/data/find-list-options.model'; -import { FollowLinkConfig } from '../../utils/follow-link-config.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; +import { RemoteData } from '../../../core/data/remote-data'; +import { PaginationService } from '../../../core/pagination/pagination.service'; +import { Bitstream } from '../../../core/shared/bitstream.model'; +import { Item } from '../../../core/shared/item.model'; +import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; +import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; import { createPaginatedList } from '../../testing/utils.test'; -import { EventEmitter, Pipe, PipeTransform } from '@angular/core'; +import { FollowLinkConfig } from '../../utils/follow-link-config.model'; +import { ItemAccessControlSelectBitstreamsModalComponent } from './item-access-control-select-bitstreams-modal.component'; describe('ItemAccessControlSelectBitstreamsModalComponent', () => { let component: ItemAccessControlSelectBitstreamsModalComponent; @@ -36,7 +41,7 @@ describe('ItemAccessControlSelectBitstreamsModalComponent', () => { get: () => observableOf('test-message'), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), - onDefaultLangChange: new EventEmitter() + onDefaultLangChange: new EventEmitter(), }; beforeEach(async () => { @@ -44,18 +49,18 @@ describe('ItemAccessControlSelectBitstreamsModalComponent', () => { imports: [ItemAccessControlSelectBitstreamsModalComponent], providers: [ NgbActiveModal, - {provide: BitstreamDataService, useValue: mockBitstreamDataService}, - {provide: PaginationService, useValue: {}}, - {provide: TranslateService, useValue: translateServiceStub} - ] + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: PaginationService, useValue: {} }, + { provide: TranslateService, useValue: translateServiceStub }, + ], }) .overrideComponent(ItemAccessControlSelectBitstreamsModalComponent, { remove: { - imports: [ObjectCollectionComponent] + imports: [ObjectCollectionComponent], }, add: { - imports: [MockTranslatePipe] - } + imports: [MockTranslatePipe], + }, }) .compileComponents(); }); @@ -74,7 +79,7 @@ describe('ItemAccessControlSelectBitstreamsModalComponent', () => { @Pipe({ // eslint-disable-next-line @angular-eslint/pipe-prefix name: 'translate', - standalone: true + standalone: true, }) class MockTranslatePipe implements PipeTransform { transform(value: string): string { diff --git a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts index c6bd4cb43d..12b38a419b 100644 --- a/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts +++ b/src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts @@ -1,6 +1,17 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { PaginatedList } from 'src/app/core/data/paginated-list.model'; import { RemoteData } from 'src/app/core/data/remote-data'; @@ -9,21 +20,20 @@ import { Context } from 'src/app/core/shared/context.model'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; -import { hasValue } from '../../empty.util'; import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { hasValue } from '../../empty.util'; import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; -import { AsyncPipe, NgIf } from '@angular/common'; import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; export const ITEM_ACCESS_CONTROL_SELECT_BITSTREAMS_LIST_ID = 'item-access-control-select-bitstreams'; @Component({ - selector: 'ds-item-access-control-select-bitstreams-modal', - templateUrl: './item-access-control-select-bitstreams-modal.component.html', - styleUrls: ['./item-access-control-select-bitstreams-modal.component.scss'], - standalone: true, - imports: [NgIf, ObjectCollectionComponent, AsyncPipe, TranslateModule] + selector: 'ds-item-access-control-select-bitstreams-modal', + templateUrl: './item-access-control-select-bitstreams-modal.component.html', + styleUrls: ['./item-access-control-select-bitstreams-modal.component.scss'], + standalone: true, + imports: [NgIf, ObjectCollectionComponent, AsyncPipe, TranslateModule], }) export class ItemAccessControlSelectBitstreamsModalComponent implements OnInit { diff --git a/src/app/shared/alert/alert.component.spec.ts b/src/app/shared/alert/alert.component.spec.ts index 8611bcf333..dcdf94929a 100644 --- a/src/app/shared/alert/alert.component.spec.ts +++ b/src/app/shared/alert/alert.component.spec.ts @@ -1,9 +1,10 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { By } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; import { + ChangeDetectorRef, ChangeDetectorRef, Component, + Component, + NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA, } from '@angular/core'; import { @@ -13,7 +14,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { - BrowserModule, + By, By, } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -31,19 +32,19 @@ describe('AlertComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NoopAnimationsModule, TranslateModule.forRoot(), AlertComponent, TestComponent, - ], - providers: [ + ], + providers: [ ChangeDetectorRef, AlertComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); describe('', () => { @@ -113,10 +114,10 @@ describe('AlertComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule], }) class TestComponent { diff --git a/src/app/shared/alert/alert.component.ts b/src/app/shared/alert/alert.component.ts index 3ba778de73..eff18e90c8 100644 --- a/src/app/shared/alert/alert.component.ts +++ b/src/app/shared/alert/alert.component.ts @@ -1,4 +1,5 @@ import { trigger } from '@angular/animations'; +import { NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,31 +8,31 @@ import { Output, ViewEncapsulation, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { fadeOutLeave, + fadeOutLeave, + fadeOutState, fadeOutState, } from '../animations/fade'; import { AlertType } from './alert-type'; -import { fadeOutLeave, fadeOutState } from '../animations/fade'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; /** * This component allow to create div that uses the Bootstrap's Alerts component. */ @Component({ - selector: 'ds-alert', - encapsulation: ViewEncapsulation.None, - animations: [ - trigger('enterLeave', [ - fadeOutLeave, fadeOutState, + selector: 'ds-alert', + encapsulation: ViewEncapsulation.None, + animations: [ + trigger('enterLeave', [ + fadeOutLeave, fadeOutState, ]), - ], - templateUrl: './alert.component.html', - styleUrls: ['./alert.component.scss'], - standalone: true, - imports: [NgIf, TranslateModule] + ], + templateUrl: './alert.component.html', + styleUrls: ['./alert.component.scss'], + standalone: true, + imports: [NgIf, TranslateModule], }) export class AlertComponent { diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts b/src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts index 4bcba647a4..515812f3a1 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts @@ -9,31 +9,41 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NoopAnimationsModule, + NoopAnimationsModule, +} from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; +import { + NgbDropdownModule, + NgbDropdownModule, +} from '@ng-bootstrap/ng-bootstrap'; import { Store, StoreModule, } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; -import { of } from 'rxjs'; +import { + of, + of, +} from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; import { AppState } from '../../app.reducer'; import { authReducer, AuthState, } from '../../core/auth/auth.reducer'; -import { AuthService } from '../../core/auth/auth.service'; -import { AuthTokenInfo } from '../../core/auth/models/auth-token-info.model'; +import { + AuthService, + AuthService, +} from '../../core/auth/auth.service'; +import { + AuthTokenInfo, + AuthTokenInfo, +} from '../../core/auth/models/auth-token-info.model'; import { HostWindowService } from '../host-window.service'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { AuthTokenInfo } from '../../core/auth/models/auth-token-info.model'; -import { AuthService } from '../../core/auth/auth.service'; -import { of } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../testing/active-router.stub'; -import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { BrowserOnlyMockPipe } from '../testing/browser-only-mock.pipe'; import { EPersonMock } from '../testing/eperson.mock'; import { HostWindowServiceStub } from '../testing/host-window-service.stub'; diff --git a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts index c34d1e04ef..d24b1db853 100644 --- a/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -1,12 +1,23 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, OnInit, } from '@angular/core'; +import { + RouterLink, + RouterLinkActive, +} from '@angular/router'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterReducerState } from '@ngrx/router-store'; import { select, Store, } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -37,23 +48,19 @@ import { } from '../animations/fade'; import { isNotUndefined } from '../empty.util'; import { HostWindowService } from '../host-window.service'; -import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { UserMenuComponent } from './user-menu/user-menu.component'; -import { RouterLink, RouterLinkActive } from '@angular/router'; import { LogInComponent } from '../log-in/log-in.component'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgClass, NgIf, AsyncPipe } from '@angular/common'; import { ThemedLogInComponent } from '../log-in/themed-log-in.component'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; import { ThemedUserMenuComponent } from './user-menu/themed-user-menu.component'; +import { UserMenuComponent } from './user-menu/user-menu.component'; @Component({ - selector: 'ds-auth-nav-menu', - templateUrl: './auth-nav-menu.component.html', - styleUrls: ['./auth-nav-menu.component.scss'], - animations: [fadeInOut, fadeOut], - standalone: true, - imports: [NgClass, NgIf, NgbDropdownModule, LogInComponent, ThemedLogInComponent, RouterLink, RouterLinkActive, UserMenuComponent, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe] + selector: 'ds-auth-nav-menu', + templateUrl: './auth-nav-menu.component.html', + styleUrls: ['./auth-nav-menu.component.scss'], + animations: [fadeInOut, fadeOut], + standalone: true, + imports: [NgClass, NgIf, NgbDropdownModule, LogInComponent, ThemedLogInComponent, RouterLink, RouterLinkActive, UserMenuComponent, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class AuthNavMenuComponent implements OnInit { /** diff --git a/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts b/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts index e52ae148a9..d15a10d9ce 100644 --- a/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts +++ b/src/app/shared/auth-nav-menu/themed-auth-nav-menu.component.ts @@ -7,10 +7,10 @@ import { AuthNavMenuComponent } from './auth-nav-menu.component'; * Themed wrapper for {@link AuthNavMenuComponent} */ @Component({ - selector: 'ds-themed-auth-nav-menu', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-auth-nav-menu', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', + standalone: true, }) export class ThemedAuthNavMenuComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts b/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts index 224cd2ad98..feb3f90b35 100644 --- a/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts +++ b/src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts @@ -13,7 +13,7 @@ import { UserMenuComponent } from './user-menu.component'; selector: 'ds-themed-user-menu', templateUrl: './../../theme-support/themed.component.html', styleUrls: [], - standalone: true + standalone: true, }) export class ThemedUserMenuComponent extends ThemedComponent{ diff --git a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts index f132e149c0..d57db27684 100644 --- a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts +++ b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts @@ -1,19 +1,36 @@ -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Store, StoreModule, } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { ActivatedRoute } from '@angular/router'; +import { + Store, + StoreModule, +} from '@ngrx/store'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of } from 'rxjs'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { AppState } from '../../../app.reducer'; -import { authReducer, AuthState, } from '../../../core/auth/auth.reducer'; +import { + authReducer, + AuthState, +} from '../../../core/auth/auth.reducer'; import { AuthService } from '../../../core/auth/auth.service'; import { AuthTokenInfo } from '../../../core/auth/models/auth-token-info.model'; import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { EPersonMock } from '../../testing/eperson.mock'; import { UserMenuComponent } from './user-menu.component'; @@ -56,30 +73,30 @@ describe('UserMenuComponent', () => { beforeEach(waitForAsync(() => { serviceInit(); TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot(authReducer, { - runtimeChecks: { - strictStateImmutability: false, + runtimeChecks: { + strictStateImmutability: false, strictActionImmutability: false, }, }), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - UserMenuComponent - ], - providers: [ + UserMenuComponent, + ], + providers: [ { provide: AuthService, useValue: authService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); diff --git a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts index bdc6061776..2cc5c2bf68 100644 --- a/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts +++ b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts @@ -1,29 +1,46 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { select, Store, } from '@ngrx/store'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + RouterLink, + RouterLinkActive, +} from '@angular/router'; +import { + select, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { AppState } from '../../../app.reducer'; -import { getProfileModuleRoute, getSubscriptionsModuleRoute, } from '../../../app-routing-paths'; +import { + getProfileModuleRoute, + getSubscriptionsModuleRoute, +} from '../../../app-routing-paths'; import { AuthService } from '../../../core/auth/auth.service'; import { isAuthenticationLoading } from '../../../core/auth/selectors'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { LogOutComponent } from '../../log-out/log-out.component'; -import { RouterLink, RouterLinkActive } from '@angular/router'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { MYDSPACE_ROUTE } from '../../../my-dspace-page/my-dspace-page.component'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { LogOutComponent } from '../../log-out/log-out.component'; /** * This component represents the user nav menu. */ @Component({ - selector: 'ds-user-menu', - templateUrl: './user-menu.component.html', - styleUrls: ['./user-menu.component.scss'], - standalone: true, - imports: [NgIf, ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule] + selector: 'ds-user-menu', + templateUrl: './user-menu.component.html', + styleUrls: ['./user-menu.component.scss'], + standalone: true, + imports: [NgIf, ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule], }) export class UserMenuComponent implements OnInit { diff --git a/src/app/shared/browse-by/browse-by.component.spec.ts b/src/app/shared/browse-by/browse-by.component.spec.ts index 30ca460e09..4db360f1d6 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -18,8 +18,6 @@ import { } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { AccessControlRoutingModule } from '../../access-control/access-control-routing.module'; -import { BrowseByRoutingModule } from '../../browse-by/browse-by-routing.module'; import { SortDirection, SortOptions, @@ -34,10 +32,16 @@ import { BrowseEntry } from '../../core/shared/browse-entry.model'; import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; import { ITEM } from '../../core/shared/item.resource-type'; import { PageInfo } from '../../core/shared/page-info.model'; -import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../core/shared/search/search-configuration.service'; import { ViewMode } from '../../core/shared/view-mode.model'; import { HostWindowService } from '../host-window.service'; -import { getMockThemeService } from '../mocks/theme-service.mock'; +import { + getMockThemeService, + getMockThemeService, +} from '../mocks/theme-service.mock'; import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; import { DEFAULT_CONTEXT, @@ -48,13 +52,10 @@ import { BrowseEntryListElementComponent } from '../object-list/browse-entry-lis import { SelectableListService } from '../object-list/selectable-list/selectable-list.service'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; -import { SharedModule } from '../shared.module'; import { HostWindowServiceStub } from '../testing/host-window-service.stub'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; import { routeServiceStub } from '../testing/route-service.stub'; import { SearchConfigurationServiceStub } from '../testing/search-configuration-service.stub'; -import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { getMockThemeService } from '../mocks/theme-service.mock'; import { createPaginatedList } from '../testing/utils.test'; import { ThemeService } from '../theme-support/theme.service'; import { BrowseByComponent } from './browse-by.component'; @@ -104,20 +105,20 @@ describe('BrowseByComponent', () => { beforeEach(waitForAsync(() => { themeService = getMockThemeService('base'); void TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule, NoopAnimationsModule, - BrowseByComponent - ], - providers: [ + BrowseByComponent, + ], + providers: [ { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: LinkHeadService, useValue: linkHeadService }, @@ -128,9 +129,9 @@ describe('BrowseByComponent', () => { { provide: RouteService, useValue: routeServiceStub }, { provide: SelectableListService, useValue: {} }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); fixture = TestBed.createComponent(BrowseByComponent); comp = fixture.componentInstance; comp.paginationConfig = paginationConfig; diff --git a/src/app/shared/browse-by/browse-by.component.ts b/src/app/shared/browse-by/browse-by.component.ts index b94401932d..ab0e5e7b8c 100644 --- a/src/app/shared/browse-by/browse-by.component.ts +++ b/src/app/shared/browse-by/browse-by.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -8,57 +14,68 @@ import { OnInit, Output, } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + combineLatest as observableCombineLatest, combineLatest as observableCombineLatest, Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { map } from 'rxjs/operators'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { fadeIn, fadeInOut } from '../animations/fade'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { ListableObject } from '../object-collection/shared/listable-object.model'; import { RemoteData } from '../../core/data/remote-data'; import { PaginationService } from '../../core/pagination/pagination.service'; import { RouteService } from '../../core/services/route.service'; import { ViewMode } from '../../core/shared/view-mode.model'; import { fadeIn, + fadeIn, + fadeInOut, fadeInOut, } from '../animations/fade'; import { hasValue } from '../empty.util'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { ErrorComponent } from '../error/error.component'; import { ThemedLoadingComponent } from '../loading/themed-loading.component'; import { ObjectCollectionComponent } from '../object-collection/object-collection.component'; +import { + ListableObject, + ListableObject, +} from '../object-collection/shared/listable-object.model'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../pagination/pagination-component-options.model'; import { ThemedResultsBackButtonComponent } from '../results-back-button/themed-results-back-button.component'; -import { NgClass, NgComponentOutlet, NgIf, AsyncPipe } from '@angular/common'; -import { VarDirective } from '../utils/var.directive'; +import { StartsWithType } from '../starts-with/starts-with-decorator'; import { StartsWithLoaderComponent } from '../starts-with/starts-with-loader.component'; import { StartsWithType } from '../starts-with/starts-with-type'; -import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { StartsWithType } from '../starts-with/starts-with-decorator'; +import { VarDirective } from '../utils/var.directive'; @Component({ - selector: 'ds-browse-by', - styleUrls: ['./browse-by.component.scss'], - templateUrl: './browse-by.component.html', - animations: [ - fadeIn, - fadeInOut - ], - standalone: true, - imports: [VarDirective, NgClass, NgComponentOutlet, NgIf, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent] + selector: 'ds-browse-by', + styleUrls: ['./browse-by.component.scss'], + templateUrl: './browse-by.component.html', + animations: [ + fadeIn, + fadeInOut, + ], + standalone: true, + imports: [VarDirective, NgClass, NgComponentOutlet, NgIf, ThemedResultsBackButtonComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent], }) /** * Component to display a browse-by page for any ListableObject diff --git a/src/app/shared/browse-by/shared-browse-by.module.ts b/src/app/shared/browse-by/shared-browse-by.module.ts index 6106baa796..25dc1be535 100644 --- a/src/app/shared/browse-by/shared-browse-by.module.ts +++ b/src/app/shared/browse-by/shared-browse-by.module.ts @@ -1,13 +1,11 @@ -import { CommonModule } from '@angular/common'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; import { NgModule } from '@angular/core'; -import { AccessControlRoutingModule } from '../../access-control/access-control-routing.module'; -import { BrowseByRoutingModule } from '../../browse-by/browse-by-routing.module'; -import { ResultsBackButtonModule } from '../results-back-button/results-back-button.module'; -import { SharedModule } from '../shared.module'; import { BrowseByComponent } from './browse-by.component'; import { ThemedBrowseByComponent } from './themed-browse-by.component'; -import { CommonModule } from '@angular/common'; const DECLARATIONS = [ BrowseByComponent, @@ -15,12 +13,12 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ + imports: [ CommonModule, - ...DECLARATIONS -], - exports: [ - ...DECLARATIONS, + ...DECLARATIONS, + ], + exports: [ + ...DECLARATIONS, ], }) export class SharedBrowseByModule { diff --git a/src/app/shared/browse-by/themed-browse-by.component.ts b/src/app/shared/browse-by/themed-browse-by.component.ts index 4e30e2ff4a..98bda5cb98 100644 --- a/src/app/shared/browse-by/themed-browse-by.component.ts +++ b/src/app/shared/browse-by/themed-browse-by.component.ts @@ -1,15 +1,23 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { ThemedComponent } from '../theme-support/themed.component'; -import { BrowseByComponent } from './browse-by.component'; +import { + Component, + EventEmitter, + Input, + Output, +} from '@angular/core'; import { Observable } from 'rxjs'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { ListableObject } from '../object-collection/shared/listable-object.model'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { StartsWithType } from '../starts-with/starts-with-type'; import { StartsWithType } from '../starts-with/starts-with-decorator'; +import { StartsWithType } from '../starts-with/starts-with-type'; +import { ThemedComponent } from '../theme-support/themed.component'; +import { BrowseByComponent } from './browse-by.component'; /** * Themed wrapper for {@link BrowseByComponent} @@ -18,7 +26,7 @@ import { StartsWithType } from '../starts-with/starts-with-decorator'; selector: 'ds-themed-browse-by', styleUrls: [], templateUrl: '../theme-support/themed.component.html', - standalone: true + standalone: true, }) export class ThemedBrowseByComponent extends ThemedComponent { diff --git a/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts b/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts index a2311dec1e..d43b4086d6 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts @@ -21,10 +21,10 @@ import { buildPaginatedList } from '../../core/data/paginated-list.model'; import { Collection } from '../../core/shared/collection.model'; import { Community } from '../../core/shared/community.model'; import { PageInfo } from '../../core/shared/page-info.model'; +import { getMockThemeService } from '../mocks/theme-service.mock'; import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; import { MockElementRef } from '../testing/element-ref.mock'; -import { getMockThemeService } from '../mocks/theme-service.mock'; import { ThemeService } from '../theme-support/theme.service'; import { CollectionDropdownComponent } from './collection-dropdown.component'; @@ -127,23 +127,23 @@ describe('CollectionDropdownComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - CollectionDropdownComponent - ], - providers: [ - {provide: CollectionDataService, useValue: collectionDataServiceMock}, - {provide: ElementRef, useClass: MockElementRef}, - ChangeDetectorRef, - {provide: ThemeService, useValue: themeService}, - ], + CollectionDropdownComponent, + ], + providers: [ + { provide: CollectionDataService, useValue: collectionDataServiceMock }, + { provide: ElementRef, useClass: MockElementRef }, + ChangeDetectorRef, + { provide: ThemeService, useValue: themeService }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/collection-dropdown/collection-dropdown.component.ts b/src/app/shared/collection-dropdown/collection-dropdown.component.ts index 869013dd48..7e755659fc 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -9,8 +14,14 @@ import { OnInit, Output, } from '@angular/core'; -import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { UntypedFormControl } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, + UntypedFormControl, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { BehaviorSubject, from as observableFrom, @@ -41,11 +52,8 @@ import { getFirstSucceededRemoteDataPayload, } from '../../core/shared/operators'; import { hasValue } from '../empty.util'; -import { followLink } from '../utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { NgIf, NgFor, AsyncPipe } from '@angular/common'; +import { followLink } from '../utils/follow-link-config.model'; /** * An interface to represent a collection entry @@ -65,11 +73,11 @@ export interface CollectionListEntry { } @Component({ - selector: 'ds-collection-dropdown', - templateUrl: './collection-dropdown.component.html', - styleUrls: ['./collection-dropdown.component.scss'], - standalone: true, - imports: [NgIf, FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgFor, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-collection-dropdown', + templateUrl: './collection-dropdown.component.html', + styleUrls: ['./collection-dropdown.component.scss'], + standalone: true, + imports: [NgIf, FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgFor, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class CollectionDropdownComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts b/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts index acc6160756..2f7055d4e7 100644 --- a/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts @@ -12,10 +12,10 @@ import { } from './collection-dropdown.component'; @Component({ - selector: 'ds-themed-collection-dropdown', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-collection-dropdown', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCollectionDropdownComponent extends ThemedComponent { diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts index b6eb1a80cc..acaf4f5786 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts @@ -17,7 +17,10 @@ import { DynamicInputModel, } from '@ng-dynamic-forms/core'; import { TranslateModule } from '@ngx-translate/core'; -import { Operation } from 'fast-json-patch'; +import { + Operation, + Operation, +} from 'fast-json-patch'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; @@ -26,20 +29,20 @@ import { RequestService } from '../../../../core/data/request.service'; import { RestRequestMethod } from '../../../../core/data/rest-request-method'; import { Community } from '../../../../core/shared/community.model'; import { hasValue } from '../../../empty.util'; +import { FormComponent } from '../../../form/form.component'; import { AuthServiceMock } from '../../../mocks/auth.service.mock'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createFailedRemoteDataObject$, + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../remote-data.utils'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; -import { VarDirective } from '../../../utils/var.directive'; -import { ComColFormComponent } from './comcol-form.component'; -import { Operation } from 'fast-json-patch'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils'; -import { FormComponent } from '../../../form/form.component'; import { UploaderComponent } from '../../../upload/uploader/uploader.component'; +import { VarDirective } from '../../../utils/var.directive'; import { ComcolPageLogoComponent } from '../../comcol-page-logo/comcol-page-logo.component'; +import { ComColFormComponent } from './comcol-form.component'; describe('ComColFormComponent', () => { let comp: ComColFormComponent; @@ -100,11 +103,11 @@ describe('ComColFormComponent', () => { TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), RouterTestingModule, ComColFormComponent, VarDirective], providers: [ - {provide: Location, useValue: locationStub}, - {provide: DynamicFormService, useValue: formServiceStub}, - {provide: NotificationsService, useValue: notificationsService}, - {provide: AuthService, useValue: new AuthServiceMock()}, - {provide: RequestService, useValue: requestServiceStub}, + { provide: Location, useValue: locationStub }, + { provide: DynamicFormService, useValue: formServiceStub }, + { provide: NotificationsService, useValue: notificationsService }, + { provide: AuthService, useValue: new AuthServiceMock() }, + { provide: RequestService, useValue: requestServiceStub }, { provide: ObjectCacheService, useValue: objectCacheStub }, ], schemas: [NO_ERRORS_SCHEMA], @@ -115,8 +118,8 @@ describe('ComColFormComponent', () => { FormComponent, UploaderComponent, ComcolPageLogoComponent, - ] - } + ], + }, }) .compileComponents(); })); diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts index 386a9f1baa..6c7b30d8d6 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -13,8 +18,14 @@ import { DynamicFormService, DynamicInputModel, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Operation } from 'fast-json-patch'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Operation, + Operation, +} from 'fast-json-patch'; import { FileUploader } from 'ng2-file-upload'; import { BehaviorSubject, @@ -35,23 +46,25 @@ import { MetadataMap, MetadataValue, } from '../../../../core/shared/metadata.models'; -import { NoContent } from '../../../../core/shared/NoContent.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { + NoContent, + NoContent, +} from '../../../../core/shared/NoContent.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; import { ResourceType } from '../../../../core/shared/resource-type'; import { hasValue, isNotEmpty, } from '../../../empty.util'; +import { FormComponent } from '../../../form/form.component'; import { NotificationsService } from '../../../notifications/notifications.service'; import { UploaderComponent } from '../../../upload/uploader/uploader.component'; -import { Operation } from 'fast-json-patch'; -import { NoContent } from '../../../../core/shared/NoContent.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { FormComponent } from '../../../form/form.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ComcolPageLogoComponent } from '../../comcol-page-logo/comcol-page-logo.component'; -import { VarDirective } from '../../../utils/var.directive'; import { UploaderOptions } from '../../../upload/uploader/uploader-options.model'; +import { VarDirective } from '../../../utils/var.directive'; +import { ComcolPageLogoComponent } from '../../comcol-page-logo/comcol-page-logo.component'; /** * A form for creating and editing Communities or Collections @@ -68,9 +81,9 @@ import { UploaderOptions } from '../../../upload/uploader/uploader-options.model ComcolPageLogoComponent, NgIf, NgClass, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class ComColFormComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts index 915ad51a59..5def3e0a73 100644 --- a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts @@ -1,12 +1,21 @@ -import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; import { Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; @@ -16,15 +25,11 @@ import { CommunityDataService } from '../../../../core/data/community-data.servi import { RequestService } from '../../../../core/data/request.service'; import { RouteService } from '../../../../core/services/route.service'; import { Community } from '../../../../core/shared/community.model'; -import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../remote-data.utils'; -import { SharedModule } from '../../../shared.module'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; import { CreateComColPageComponent } from './create-comcol-page.component'; diff --git a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts index d49b6f7092..398ffeb6ba 100644 --- a/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts +++ b/src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts @@ -32,9 +32,9 @@ import { NotificationsService } from '../../../notifications/notifications.servi * Component representing the create page for communities and collections */ @Component({ - selector: 'ds-create-comcol', - template: '', - standalone: true + selector: 'ds-create-comcol', + template: '', + standalone: true, }) export class CreateComColPageComponent implements OnInit { /** diff --git a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts index b2dffc359a..9c1e20b1be 100644 --- a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts @@ -1,5 +1,11 @@ -import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -9,7 +15,10 @@ import { ActivatedRoute, Router, } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule, TranslateService, @@ -20,15 +29,11 @@ import { of as observableOf } from 'rxjs'; import { ComColDataService } from '../../../../core/data/comcol-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; import { Community } from '../../../../core/shared/community.model'; -import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createFailedRemoteDataObject$, createNoContentRemoteDataObject$, } from '../../../remote-data.utils'; -import { SharedModule } from '../../../shared.module'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; import { DeleteComColPageComponent } from './delete-comcol-page.component'; diff --git a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts index fa9ae6f6f9..754b32e09b 100644 --- a/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts +++ b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts @@ -29,9 +29,9 @@ import { NotificationsService } from '../../../notifications/notifications.servi * Component representing the delete page for communities and collections */ @Component({ - selector: 'ds-delete-comcol', - template: '', - standalone: true + selector: 'ds-delete-comcol', + template: '', + standalone: true, }) export class DeleteComColPageComponent implements OnInit { /** diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts index 16840e02d6..3e68955735 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts @@ -16,14 +16,15 @@ import { of as observableOf } from 'rxjs'; import { ComColDataService } from '../../../../../core/data/comcol-data.service'; import { Community } from '../../../../../core/shared/community.model'; import { NotificationsService } from '../../../../notifications/notifications.service'; -import { NotificationsServiceStub } from '../../../../testing/notifications-service.stub'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../../../remote-data.utils'; -import { SharedModule } from '../../../../shared.module'; -import { NotificationsServiceStub } from '../../../../testing/notifications-service.stub'; +import { + NotificationsServiceStub, + NotificationsServiceStub, +} from '../../../../testing/notifications-service.stub'; import { ComcolMetadataComponent } from './comcol-metadata.component'; describe('ComColMetadataComponent', () => { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts index f553a4cded..c74153f083 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts @@ -30,9 +30,9 @@ import { import { NotificationsService } from '../../../../notifications/notifications.service'; @Component({ - selector: 'ds-comcol-metadata', - template: '', - standalone: true + selector: 'ds-comcol-metadata', + template: '', + standalone: true, }) export class ComcolMetadataComponent implements OnInit { /** diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts index 274c5fac54..306b0e0905 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts @@ -8,27 +8,35 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + NoopAnimationsModule, + NoopAnimationsModule, +} from '@angular/platform-browser/animations'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { RouterTestingModule } from '@angular/router/testing'; -import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { NotificationsService } from '../../../../notifications/notifications.service'; -import { NotificationsServiceStub } from '../../../../testing/notifications-service.stub'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../../../../core/data/request.service'; import { GroupDataService } from '../../../../../core/eperson/group-data.service'; import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; -import { NotificationsService } from '../../../../notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../../notifications/notifications.service'; import { createFailedRemoteDataObject$, + createFailedRemoteDataObject$, + createSuccessfulRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../../remote-data.utils'; -import { NotificationsServiceStub } from '../../../../testing/notifications-service.stub'; -import { ComcolModule } from '../../../comcol.module'; +import { + NotificationsServiceStub, + NotificationsServiceStub, +} from '../../../../testing/notifications-service.stub'; import { ComcolRoleComponent } from './comcol-role.component'; describe('ComcolRoleComponent', () => { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts index 9471938436..ac21bac4b9 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts @@ -1,9 +1,18 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -15,7 +24,10 @@ import { } from 'rxjs/operators'; import { getGroupEditRoute } from '../../../../../access-control/access-control-routing-paths'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../../../core/data/remote-data'; import { RequestService } from '../../../../../core/data/request.service'; import { GroupDataService } from '../../../../../core/eperson/group-data.service'; @@ -28,18 +40,14 @@ import { getAllCompletedRemoteData, getFirstCompletedRemoteData, } from '../../../../../core/shared/operators'; +import { AlertComponent } from '../../../../alert/alert.component'; import { hasNoValue, hasValue, } from '../../../../empty.util'; -import { NotificationsService } from '../../../../notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; -import { AlertComponent } from '../../../../alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { NotificationsService } from '../../../../notifications/notifications.service'; import { VarDirective } from '../../../../utils/var.directive'; -import { RouterLink } from '@angular/router'; /** * Component for managing a community or collection role. @@ -55,9 +63,9 @@ import { RouterLink } from '@angular/router'; TranslateModule, NgIf, RouterLink, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class ComcolRoleComponent implements OnInit { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts index ee27cf486b..58f8be788a 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts @@ -1,5 +1,11 @@ -import { CommonModule } from '@angular/common'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, @@ -9,17 +15,18 @@ import { ActivatedRoute, Router, } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { Community } from '../../../../core/shared/community.model'; -import { CommonModule } from '@angular/common'; -import { RouterTestingModule } from '@angular/router/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { SharedModule } from '../../../shared.module'; +import { + DSpaceObject, + DSpaceObject, +} from '../../../../core/shared/dspace-object.model'; import { EditComColPageComponent } from './edit-comcol-page.component'; describe('EditComColPageComponent', () => { diff --git a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.ts index 52f52cf791..f9baf75bfd 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.ts +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.ts @@ -17,9 +17,9 @@ import { isNotEmpty } from '../../../empty.util'; * Component representing the edit page for communities and collections */ @Component({ - selector: 'ds-edit-comcol', - template: '', - standalone: true + selector: 'ds-edit-comcol', + template: '', + standalone: true, }) export class EditComColPageComponent implements OnInit { /** diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts index a7a912b503..6577890673 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -1,39 +1,53 @@ -import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs'; -import { map, take } from 'rxjs/operators'; -import { EventType, Router, RouterLink, RouterLinkActive, Scroll } from '@angular/router'; -import { getCommunityPageRoute } from '../../../community-page/community-page-routing-paths'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { + EventType, EventType, Router, + Router, + RouterLink, + RouterLinkActive, + Scroll, Scroll, } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + combineLatest, combineLatest, Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { map, + map, + take, take, } from 'rxjs/operators'; import { getCollectionPageRoute } from '../../../collection-page/collection-page-routing-paths'; -import { getCommunityPageRoute } from '../../../community-page/community-page-routing-paths'; +import { + getCommunityPageRoute, + getCommunityPageRoute, +} from '../../../community-page/community-page-routing-paths'; import { BrowseService } from '../../../core/browse/browse.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { BrowseDefinition } from '../../../core/shared/browse-definition.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; -import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; export interface ComColPageNavOption { id: string; @@ -57,9 +71,9 @@ export interface ComColPageNavOption { RouterLinkActive, TranslateModule, AsyncPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class ComcolPageBrowseByComponent implements OnDestroy, OnInit { /** diff --git a/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts index 6e96cc86a2..2133bbe312 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component.ts @@ -10,10 +10,10 @@ import { ComcolPageBrowseByComponent } from './comcol-page-browse-by.component'; * Themed wrapper for ComcolPageBrowseByComponent */ @Component({ - selector: 'ds-themed-comcol-page-browse-by', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-comcol-page-browse-by', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) export class ThemedComcolPageBrowseByComponent extends ThemedComponent { /** diff --git a/src/app/shared/comcol/comcol-page-content/comcol-page-content.component.ts b/src/app/shared/comcol/comcol-page-content/comcol-page-content.component.ts index 1925bfeab7..b9e827fb88 100644 --- a/src/app/shared/comcol/comcol-page-content/comcol-page-content.component.ts +++ b/src/app/shared/comcol/comcol-page-content/comcol-page-content.component.ts @@ -1,9 +1,9 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; /** * This component renders any content inside of this component. @@ -17,9 +17,9 @@ import { NgIf } from '@angular/common'; templateUrl: './comcol-page-content.component.html', imports: [ TranslateModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class ComcolPageContentComponent { diff --git a/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.spec.ts b/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.spec.ts index 9f6f206578..215a3cbe45 100644 --- a/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.spec.ts +++ b/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.spec.ts @@ -16,8 +16,8 @@ describe('ComcolPageHandleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ComcolPageHandleComponent], -}) + imports: [TranslateModule.forRoot(), ComcolPageHandleComponent], + }) .compileComponents(); })); diff --git a/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.ts b/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.ts index 12edb195d7..4487c20982 100644 --- a/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.ts +++ b/src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.ts @@ -1,9 +1,9 @@ +import { NgIf } from '@angular/common'; import { Component, Injectable, Input, } from '@angular/core'; -import { NgIf } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; /** @@ -15,7 +15,7 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./comcol-page-handle.component.scss'], templateUrl: './comcol-page-handle.component.html', imports: [NgIf, TranslateModule], - standalone: true + standalone: true, }) @Injectable() diff --git a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts index 752ba20e13..590a7136bd 100644 --- a/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts +++ b/src/app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component.ts @@ -10,10 +10,10 @@ import { ComcolPageHandleComponent } from './comcol-page-handle.component'; * Themed wrapper for BreadcrumbsComponent */ @Component({ - selector: 'ds-themed-comcol-page-handle', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-comcol-page-handle', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) diff --git a/src/app/shared/comcol/comcol-page-header/comcol-page-header.component.ts b/src/app/shared/comcol/comcol-page-header/comcol-page-header.component.ts index 7cd66e843c..f409e991ec 100644 --- a/src/app/shared/comcol/comcol-page-header/comcol-page-header.component.ts +++ b/src/app/shared/comcol/comcol-page-header/comcol-page-header.component.ts @@ -1,17 +1,17 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; -import { NgIf } from '@angular/common'; @Component({ selector: 'ds-comcol-page-header', styleUrls: ['./comcol-page-header.component.scss'], templateUrl: './comcol-page-header.component.html', imports: [ - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class ComcolPageHeaderComponent { @Input() name: string; diff --git a/src/app/shared/comcol/comcol-page-logo/comcol-page-logo.component.ts b/src/app/shared/comcol/comcol-page-logo/comcol-page-logo.component.ts index b3f62f2b54..589f54d45c 100644 --- a/src/app/shared/comcol/comcol-page-logo/comcol-page-logo.component.ts +++ b/src/app/shared/comcol/comcol-page-logo/comcol-page-logo.component.ts @@ -1,17 +1,17 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; import { Bitstream } from '../../../core/shared/bitstream.model'; -import { NgIf } from '@angular/common'; @Component({ selector: 'ds-comcol-page-logo', styleUrls: ['./comcol-page-logo.component.scss'], templateUrl: './comcol-page-logo.component.html', imports: [NgIf], - standalone: true + standalone: true, }) export class ComcolPageLogoComponent { @Input() logo: Bitstream; diff --git a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts index 89313c074e..f057a7fe5e 100644 --- a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts +++ b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.spec.ts @@ -44,14 +44,14 @@ describe('ComcolBrowseByComponent', () => { themeService = getMockThemeService(); await TestBed.configureTestingModule({ - imports: [BrowseBySwitcherComponent, ComcolBrowseByComponent], - declarations: [DynamicComponentLoaderDirective], - providers: [ + imports: [BrowseBySwitcherComponent, ComcolBrowseByComponent], + declarations: [DynamicComponentLoaderDirective], + providers: [ BrowseByTestComponent, { provide: ActivatedRoute, useValue: activatedRoute }, { provide: ThemeService, useValue: themeService }, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(ComcolBrowseByComponent); component = fixture.componentInstance; diff --git a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts index b56fe1dea2..35d292c5f7 100644 --- a/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts +++ b/src/app/shared/comcol/sections/comcol-browse-by/comcol-browse-by.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, OnInit, @@ -10,9 +11,8 @@ import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { BrowseByDataType } from '../../../../browse-by/browse-by-switcher/browse-by-data-type'; -import { BrowseDefinition } from '../../../../core/shared/browse-definition.model'; import { BrowseBySwitcherComponent } from '../../../../browse-by/browse-by-switcher/browse-by-switcher.component'; -import { AsyncPipe } from '@angular/common'; +import { BrowseDefinition } from '../../../../core/shared/browse-definition.model'; @Component({ selector: 'ds-comcol-browse-by', @@ -20,9 +20,9 @@ import { AsyncPipe } from '@angular/common'; styleUrls: ['./comcol-browse-by.component.scss'], imports: [ BrowseBySwitcherComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class ComcolBrowseByComponent implements OnInit { diff --git a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.spec.ts b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.spec.ts index cacc773bdf..2ae10f3133 100644 --- a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.spec.ts +++ b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.spec.ts @@ -19,12 +19,12 @@ describe('ComcolSearchSectionComponent', () => { route = new ActivatedRouteStub(); await TestBed.configureTestingModule({ - imports: [ComcolSearchSectionComponent], - providers: [ + imports: [ComcolSearchSectionComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: ActivatedRoute, useValue: route }, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(ComcolSearchSectionComponent); component = fixture.componentInstance; diff --git a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts index 0ecc9ed742..4ead849a3f 100644 --- a/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts +++ b/src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Inject, @@ -9,7 +10,6 @@ import { } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; import { APP_CONFIG, @@ -18,12 +18,14 @@ import { import { RemoteData } from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; import { Community } from '../../../../core/shared/community.model'; -import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { hasValue } from '../../../empty.util'; -import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service'; import { ThemedSearchComponent } from '../../../search/themed-search.component'; -import { AsyncPipe } from '@angular/common'; /** * The search tab on community & collection pages @@ -40,9 +42,9 @@ import { AsyncPipe } from '@angular/common'; ], imports: [ ThemedSearchComponent, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class ComcolSearchSectionComponent implements OnInit { diff --git a/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts b/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts index 6a71705d33..af589716de 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts @@ -24,12 +24,12 @@ describe('ConfirmationModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ConfirmationModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), ConfirmationModalComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); diff --git a/src/app/shared/confirmation-modal/confirmation-modal.component.ts b/src/app/shared/confirmation-modal/confirmation-modal.component.ts index c89d8294fe..aedbf55a3a 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, EventEmitter, @@ -6,13 +7,12 @@ import { } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-confirmation-modal', - templateUrl: 'confirmation-modal.component.html', - standalone: true, - imports: [NgIf, TranslateModule] + selector: 'ds-confirmation-modal', + templateUrl: 'confirmation-modal.component.html', + standalone: true, + imports: [NgIf, TranslateModule], }) export class ConfirmationModalComponent { @Input() headerLabel: string; diff --git a/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts b/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts index 81cebe69a6..a23708dfc6 100644 --- a/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts +++ b/src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts @@ -23,7 +23,7 @@ import { ContextHelpWrapperComponent } from './context-help-wrapper.component'; import { PlacementDir } from './placement-dir.model'; @Component({ - template: ` + template: ` template `, - standalone: true, - imports: [NgbTooltipModule, ContextHelpWrapperComponent] + standalone: true, + imports: [NgbTooltipModule, ContextHelpWrapperComponent], }) class TemplateComponent { @Input() content: string; @@ -86,12 +86,12 @@ describe('ContextHelpWrapperComponent', () => { ]); TestBed.configureTestingModule({ - imports: [NgbTooltipModule, TemplateComponent, ContextHelpWrapperComponent], - providers: [ + imports: [NgbTooltipModule, TemplateComponent, ContextHelpWrapperComponent], + providers: [ { provide: TranslateService, useValue: translateService }, { provide: ContextHelpService, useValue: contextHelpService }, - ] -}).compileComponents(); + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts b/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts index 86d21891f1..edb3e2f082 100644 --- a/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts +++ b/src/app/shared/context-help-wrapper/context-help-wrapper.component.ts @@ -1,3 +1,10 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { Component, Input, @@ -6,7 +13,11 @@ import { TemplateRef, ViewChild, } from '@angular/core'; -import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbTooltip, + NgbTooltip, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; import { PlacementArray } from '@ng-bootstrap/ng-bootstrap/util/positioning'; import { TranslateService } from '@ngx-translate/core'; import { @@ -23,10 +34,8 @@ import { import { ContextHelp } from '../context-help.model'; import { ContextHelpService } from '../context-help.service'; -import { NgbTooltip, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { hasValueOperator } from '../empty.util'; import { PlacementDir } from './placement-dir.model'; -import { NgFor, NgIf, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common'; type ParsedContent = (string | {href: string, text: string})[]; @@ -35,11 +44,11 @@ type ParsedContent = (string | {href: string, text: string})[]; * produces a tooltip when clicked. */ @Component({ - selector: 'ds-context-help-wrapper', - templateUrl: './context-help-wrapper.component.html', - styleUrls: ['./context-help-wrapper.component.scss'], - standalone: true, - imports: [NgFor, NgIf, NgClass, NgbTooltipModule, NgTemplateOutlet, AsyncPipe] + selector: 'ds-context-help-wrapper', + templateUrl: './context-help-wrapper.component.html', + styleUrls: ['./context-help-wrapper.component.scss'], + standalone: true, + imports: [NgFor, NgIf, NgClass, NgbTooltipModule, NgTemplateOutlet, AsyncPipe], }) export class ContextHelpWrapperComponent implements OnInit, OnDestroy { /** diff --git a/src/app/shared/context-help.directive.spec.ts b/src/app/shared/context-help.directive.spec.ts index b15f50310d..5b12579250 100644 --- a/src/app/shared/context-help.directive.spec.ts +++ b/src/app/shared/context-help.directive.spec.ts @@ -23,9 +23,9 @@ import { ContextHelpService } from './context-help.service'; import { ContextHelpWrapperComponent } from './context-help-wrapper/context-help-wrapper.component'; @Component({ - template: `
some text
`, - standalone: true, - imports: [NgbTooltipModule, ContextHelpDirective] + template: `
some text
`, + standalone: true, + imports: [NgbTooltipModule, ContextHelpDirective], }) class TestComponent { @Input() content = ''; @@ -70,12 +70,12 @@ describe('ContextHelpDirective', () => { ]); TestBed.configureTestingModule({ - imports: [NgbTooltipModule, TestComponent, ContextHelpWrapperComponent, ContextHelpDirective], - providers: [ + imports: [NgbTooltipModule, TestComponent, ContextHelpWrapperComponent, ContextHelpDirective], + providers: [ { provide: TranslateService, useValue: translateService }, - { provide: ContextHelpService, useValue: contextHelpService } - ] -}).compileComponents(); + { provide: ContextHelpService, useValue: contextHelpService }, + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/context-help.directive.ts b/src/app/shared/context-help.directive.ts index e993b728b1..5b39392d6e 100644 --- a/src/app/shared/context-help.directive.ts +++ b/src/app/shared/context-help.directive.ts @@ -27,8 +27,8 @@ export interface ContextHelpDirectiveInput { * and so is the position of the tooltip itself (PlacementArray). */ @Directive({ - selector: '[dsContextHelp]', - standalone: true + selector: '[dsContextHelp]', + standalone: true, }) export class ContextHelpDirective implements OnChanges, OnDestroy { /** diff --git a/src/app/shared/correction-suggestion/withdrawn-reinstate-modal.component.ts b/src/app/shared/correction-suggestion/withdrawn-reinstate-modal.component.ts index 43559dffcf..1c7e33718f 100644 --- a/src/app/shared/correction-suggestion/withdrawn-reinstate-modal.component.ts +++ b/src/app/shared/correction-suggestion/withdrawn-reinstate-modal.component.ts @@ -1,13 +1,17 @@ -import { Component, EventEmitter, Output, } from '@angular/core'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + EventEmitter, + Output, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { LoadingComponent } from '../loading/loading.component'; -import { FormsModule } from '@angular/forms'; -import { AsyncPipe } from '@angular/common'; import { ModalBeforeDismiss } from '../interfaces/modal-before-dismiss.interface'; +import { LoadingComponent } from '../loading/loading.component'; @Component({ selector: 'ds-item-withdrawn-reinstate-modal', @@ -17,9 +21,9 @@ import { ModalBeforeDismiss } from '../interfaces/modal-before-dismiss.interface TranslateModule, LoadingComponent, FormsModule, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Represents a modal component for withdrawing or reinstating an item. diff --git a/src/app/shared/ds-select/ds-select.component.spec.ts b/src/app/shared/ds-select/ds-select.component.spec.ts index db08dfd501..9bad8872cc 100644 --- a/src/app/shared/ds-select/ds-select.component.spec.ts +++ b/src/app/shared/ds-select/ds-select.component.spec.ts @@ -13,11 +13,11 @@ describe('DsSelectComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - DsSelectComponent - ] -}) + DsSelectComponent, + ], + }) .compileComponents(); })); diff --git a/src/app/shared/ds-select/ds-select.component.ts b/src/app/shared/ds-select/ds-select.component.ts index d933a529ac..d018ffa29e 100644 --- a/src/app/shared/ds-select/ds-select.component.ts +++ b/src/app/shared/ds-select/ds-select.component.ts @@ -1,22 +1,22 @@ +import { NgIf } from '@angular/common'; import { Component, EventEmitter, Input, Output, } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; /** * Component which represent a DSpace dropdown selector. */ @Component({ - selector: 'ds-select', - templateUrl: './ds-select.component.html', - styleUrls: ['./ds-select.component.scss'], - standalone: true, - imports: [NgbDropdownModule, NgIf, TranslateModule] + selector: 'ds-select', + templateUrl: './ds-select.component.html', + styleUrls: ['./ds-select.component.scss'], + standalone: true, + imports: [NgbDropdownModule, NgIf, TranslateModule], }) export class DsSelectComponent { diff --git a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts index bd23879818..ba7933ffdc 100644 --- a/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts @@ -1,18 +1,18 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { TestBed, waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { AdminSidebarComponent } from '../../admin/admin-sidebar/admin-sidebar.component'; -import { MenuService } from '../menu/menu.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { DSOEditMenuResolver } from './dso-edit-menu.resolver'; -import { DsoVersioningModalService } from './dso-versioning-modal-service/dso-versioning-modal.service'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule, TranslateService, @@ -25,15 +25,24 @@ import { } from 'rxjs'; import { CorrectionTypeDataService } from 'src/app/core/submission/correctiontype-data.service'; -import { AdminSidebarComponent } from '../../admin/admin-sidebar/admin-sidebar.component'; +import { + AdminSidebarComponent, + AdminSidebarComponent, +} from '../../admin/admin-sidebar/admin-sidebar.component'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../core/data/feature-authorization/authorization-data.service'; import { ResearcherProfileDataService } from '../../core/profile/researcher-profile-data.service'; import { Collection } from '../../core/shared/collection.model'; import { Community } from '../../core/shared/community.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; -import { MenuService } from '../menu/menu.service'; +import { + MenuService, + MenuService, +} from '../menu/menu.service'; import { MenuID } from '../menu/menu-id.model'; import { LinkMenuItemModel } from '../menu/menu-item/models/link.model'; import { MenuItemType } from '../menu/menu-item-type.model'; @@ -44,8 +53,14 @@ import { } from '../remote-data.utils'; import { MenuServiceStub } from '../testing/menu-service.stub'; import { createPaginatedList } from '../testing/utils.test'; -import { DSOEditMenuResolver } from './dso-edit-menu.resolver'; -import { DsoVersioningModalService } from './dso-versioning-modal-service/dso-versioning-modal.service'; +import { + DSOEditMenuResolver, + DSOEditMenuResolver, +} from './dso-edit-menu.resolver'; +import { + DsoVersioningModalService, + DsoVersioningModalService, +} from './dso-versioning-modal-service/dso-versioning-modal.service'; import { DsoWithdrawnReinstateModalService } from './dso-withdrawn-reinstate-service/dso-withdrawn-reinstate-modal.service'; describe('DSOEditMenuResolver', () => { @@ -169,8 +184,8 @@ describe('DSOEditMenuResolver', () => { }); mockNgbModal = { open: jasmine.createSpy('open').and.returnValue( - { componentInstance: {}, closed: observableOf({})} as NgbModalRef - ) + { componentInstance: {}, closed: observableOf({}) } as NgbModalRef, + ), }; dsoWithdrawnReinstateModalService = jasmine.createSpyObj('dsoWithdrawnReinstateModalService', { @@ -182,8 +197,8 @@ describe('DSOEditMenuResolver', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], + providers: [ { provide: DSpaceObjectDataService, useValue: dSpaceObjectDataService }, { provide: MenuService, useValue: menuService }, { provide: AuthorizationDataService, useValue: authorizationService }, @@ -191,13 +206,13 @@ describe('DSOEditMenuResolver', () => { { provide: ResearcherProfileDataService, useValue: researcherProfileService }, { provide: TranslateService, useValue: translate }, { provide: NotificationsService, useValue: notificationsService }, - {provide: DsoWithdrawnReinstateModalService, useValue: dsoWithdrawnReinstateModalService}, + { provide: DsoWithdrawnReinstateModalService, useValue: dsoWithdrawnReinstateModalService }, { provide: CorrectionTypeDataService, useValue: correctionsDataService }, { - provide: NgbModal, useValue: mockNgbModal } - ], + provide: NgbModal, useValue: mockNgbModal }, + ], schemas: [NO_ERRORS_SCHEMA], -}); + }); resolver = TestBed.inject(DSOEditMenuResolver); spyOn(menuService, 'addSection'); diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts index f6e393a460..b46931084d 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts @@ -4,20 +4,22 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { MenuItemType } from 'src/app/shared/menu/menu-item-type.model'; +import { MenuItemType } from '../../../../shared/menu/menu-item-type.model'; import { MenuService } from '../../../menu/menu.service'; import { CSSVariableService } from '../../../sass-helper/css-variable.service'; import { CSSVariableServiceStub } from '../../../testing/css-variable-service.stub'; import { MenuServiceStub } from '../../../testing/menu-service.stub'; import { RouterStub } from '../../../testing/router.stub'; import { DsoEditMenuExpandableSectionComponent } from './dso-edit-menu-expandable-section.component'; -import { By } from '@angular/platform-browser'; -import { MenuItemType } from '../../../../shared/menu/menu-item-type.model'; describe('DsoEditMenuExpandableSectionComponent', () => { let component: DsoEditMenuExpandableSectionComponent; @@ -39,14 +41,14 @@ describe('DsoEditMenuExpandableSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), DsoEditMenuExpandableSectionComponent, TestComponent], - providers: [ + imports: [TranslateModule.forRoot(), DsoEditMenuExpandableSectionComponent, TestComponent], + providers: [ { provide: 'sectionDataProvider', useValue: dummySection }, { provide: MenuService, useValue: menuService }, { provide: CSSVariableService, useClass: CSSVariableServiceStub }, { provide: Router, useValue: new RouterStub() }, ], -}).overrideComponent(DsoEditMenuExpandableSectionComponent, { + }).overrideComponent(DsoEditMenuExpandableSectionComponent, { set: { entryComponents: [TestComponent], }, @@ -74,9 +76,9 @@ describe('DsoEditMenuExpandableSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { } diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts index 6c744e7b3e..3fe47be7e9 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts @@ -1,34 +1,47 @@ -import { Component, Inject, Injector } from '@angular/core'; -import { MenuSectionComponent } from 'src/app/shared/menu/menu-section/menu-section.component'; -import { MenuService } from '../../../menu/menu.service'; +import { + AsyncPipe, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { + Component, Component, Inject, + Inject, + Injector, Injector, } from '@angular/core'; import { Router } from '@angular/router'; +import { + NgbDropdownModule, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { MenuID } from 'src/app/shared/menu/menu-id.model'; -import { rendersSectionForMenu } from 'src/app/shared/menu/menu-section.decorator'; import { MenuSection } from 'src/app/shared/menu/menu-section.model'; -import { MenuSectionComponent } from 'src/app/shared/menu/menu-section/menu-section.component'; +import { + MenuSectionComponent, + MenuSectionComponent, +} from 'src/app/shared/menu/menu-section/menu-section.component'; import { hasValue } from '../../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgComponentOutlet, NgFor, NgIf } from '@angular/common'; -import { NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { MenuService } from '../../../menu/menu.service'; +import { + MenuService, + MenuService, +} from '../../../menu/menu.service'; /** * Represents an expandable section in the dso edit menus */ @Component({ - selector: 'ds-dso-edit-menu-expandable-section', - templateUrl: './dso-edit-menu-expandable-section.component.html', - styleUrls: ['./dso-edit-menu-expandable-section.component.scss'], - standalone: true, - imports: [NgbDropdownModule, NgbTooltipModule, NgFor, NgIf, NgComponentOutlet, TranslateModule, AsyncPipe] + selector: 'ds-dso-edit-menu-expandable-section', + templateUrl: './dso-edit-menu-expandable-section.component.html', + styleUrls: ['./dso-edit-menu-expandable-section.component.scss'], + standalone: true, + imports: [NgbDropdownModule, NgbTooltipModule, NgFor, NgIf, NgComponentOutlet, TranslateModule, AsyncPipe], }) export class DsoEditMenuExpandableSectionComponent extends MenuSectionComponent { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts index 711fd4acf0..2533b49cf1 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts @@ -1,29 +1,40 @@ -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { MenuServiceStub } from '../../../testing/menu-service.stub'; import { Component } from '@angular/core'; import { + ComponentFixture, ComponentFixture, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Router } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { MenuItemType } from 'src/app/shared/menu/menu-item-type.model'; +import { MenuItemType } from '../../../../shared/menu/menu-item-type.model'; import { MenuService } from '../../../menu/menu.service'; -import { OnClickMenuItemModel } from '../../../menu/menu-item/models/onclick.model'; +import { + OnClickMenuItemModel, + OnClickMenuItemModel, +} from '../../../menu/menu-item/models/onclick.model'; import { CSSVariableService } from '../../../sass-helper/css-variable.service'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; import { CSSVariableServiceStub } from '../../../testing/css-variable-service.stub'; -import { ActivatedRoute, Router } from '@angular/router'; -import { MenuServiceStub } from '../../../testing/menu-service.stub'; +import { + MenuServiceStub, + MenuServiceStub, +} from '../../../testing/menu-service.stub'; import { RouterStub } from '../../../testing/router.stub'; import { DsoEditMenuSectionComponent } from './dso-edit-menu-section.component'; -import { OnClickMenuItemModel } from '../../../menu/menu-item/models/onclick.model'; -import { MenuItemType } from '../../../../shared/menu/menu-item-type.model'; -import { ActivatedRouteStub } from '../../../testing/active-router.stub'; -import { TranslateModule } from '@ngx-translate/core'; function initAsync(dummySectionText: { visible: boolean; @@ -37,15 +48,15 @@ function initAsync(dummySectionText: { imports: [ TranslateModule.forRoot(), DsoEditMenuSectionComponent, - TestComponent + TestComponent, ], providers: [ { provide: 'sectionDataProvider', useValue: dummySectionText }, { provide: MenuService, useValue: menuService }, { provide: CSSVariableService, useClass: CSSVariableServiceStub }, { provide: Router, useValue: new RouterStub() }, - {provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ] + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], }).compileComponents(); })); } @@ -181,9 +192,9 @@ describe('DsoEditMenuSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { } diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts index 25718f9c53..2e2397f860 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts @@ -1,29 +1,29 @@ +import { NgIf } from '@angular/common'; import { Component, Inject, Injector, OnInit, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { MenuSectionComponent } from 'src/app/shared/menu/menu-section/menu-section.component'; import { isNotEmpty } from '../../../empty.util'; import { MenuService } from '../../../menu/menu.service'; import { MenuID } from '../../../menu/menu-id.model'; import { MenuSection } from '../../../menu/menu-section.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf } from '@angular/common'; /** * Represents a non-expandable section in the dso edit menus */ @Component({ - selector: 'ds-dso-edit-menu-section', - templateUrl: './dso-edit-menu-section.component.html', - styleUrls: ['./dso-edit-menu-section.component.scss'], - standalone: true, - imports: [NgIf, NgbTooltipModule, RouterLink, TranslateModule] + selector: 'ds-dso-edit-menu-section', + templateUrl: './dso-edit-menu-section.component.html', + styleUrls: ['./dso-edit-menu-section.component.scss'], + standalone: true, + imports: [NgIf, NgbTooltipModule, RouterLink, TranslateModule], }) export class DsoEditMenuSectionComponent extends MenuSectionComponent implements OnInit { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts index c8d16e3341..47acecf926 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts @@ -52,17 +52,17 @@ describe('DsoEditMenuComponent', () => { }); spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([section])); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, DsoPageModule, DsoEditMenuComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule, DsoPageModule, DsoEditMenuComponent], + providers: [ Injector, { provide: MenuService, useValue: menuService }, { provide: AuthService, useClass: AuthServiceStub }, { provide: ActivatedRoute, useValue: routeStub }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts index 7a9a75dd5f..a4b8b728f9 100644 --- a/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts +++ b/src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgComponentOutlet, + NgFor, +} from '@angular/common'; import { Component, Injector, @@ -8,18 +13,17 @@ import { AuthorizationDataService } from 'src/app/core/data/feature-authorizatio import { MenuComponent } from '../../menu/menu.component'; import { MenuService } from '../../menu/menu.service'; import { MenuID } from '../../menu/menu-id.model'; -import { NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common'; import { ThemeService } from '../../theme-support/theme.service'; /** * Component representing the edit menu and other menus on the dspace object pages */ @Component({ - selector: 'ds-dso-edit-menu', - styleUrls: ['./dso-edit-menu.component.scss'], - templateUrl: './dso-edit-menu.component.html', - standalone: true, - imports: [NgFor, NgComponentOutlet, AsyncPipe] + selector: 'ds-dso-edit-menu', + styleUrls: ['./dso-edit-menu.component.scss'], + templateUrl: './dso-edit-menu.component.html', + standalone: true, + imports: [NgFor, NgComponentOutlet, AsyncPipe], }) export class DsoEditMenuComponent extends MenuComponent { /** diff --git a/src/app/shared/dso-page/dso-page.module.ts b/src/app/shared/dso-page/dso-page.module.ts index 2f147133fe..694aa1abfe 100644 --- a/src/app/shared/dso-page/dso-page.module.ts +++ b/src/app/shared/dso-page/dso-page.module.ts @@ -32,16 +32,16 @@ const PROVIDERS = [ ]; @NgModule({ - imports: [ - ...MODULES, - ...COMPONENTS, - ...ENTRY_COMPONENTS - ], - providers: [ - ...PROVIDERS, - ...ENTRY_COMPONENTS, - ], - exports: [ + imports: [ + ...MODULES, + ...COMPONENTS, + ...ENTRY_COMPONENTS, + ], + providers: [ + ...PROVIDERS, + ...ENTRY_COMPONENTS, + ], + exports: [ ...COMPONENTS, ], }) diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts index 781d7e7a5c..1695d43f52 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts @@ -11,11 +11,9 @@ import { CollectionDataService } from '../../../../core/data/collection-data.ser import { Collection } from '../../../../core/shared/collection.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { SearchService } from '../../../../core/shared/search/search.service'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { - ListableObjectComponentLoaderComponent -} from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; +import { NotificationsService } from '../../../notifications/notifications.service'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils'; import { createPaginatedList } from '../../../testing/utils.test'; import { VarDirective } from '../../../utils/var.directive'; @@ -40,16 +38,16 @@ describe('AuthorizedCollectionSelectorComponent', () => { }); notificationsService = jasmine.createSpyObj('notificationsService', ['error']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), AuthorizedCollectionSelectorComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), AuthorizedCollectionSelectorComponent, VarDirective], + providers: [ { provide: SearchService, useValue: {} }, { provide: CollectionDataService, useValue: collectionService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(AuthorizedCollectionSelectorComponent, { - remove: { imports: [ListableObjectComponentLoaderComponent, ThemedLoadingComponent,]} + remove: { imports: [ListableObjectComponentLoaderComponent, ThemedLoadingComponent] }, }) .compileComponents(); })); diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts index 251da17a57..fda26c4373 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts @@ -1,46 +1,63 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; import { CollectionDataService } from '../../../../core/data/collection-data.service'; -import { FindListOptions } from '../../../../core/data/find-list-options.model'; +import { + FindListOptions, + FindListOptions, +} from '../../../../core/data/find-list-options.model'; import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; -import { Collection } from '../../../../core/shared/collection.model'; +import { + Collection, + Collection, +} from '../../../../core/shared/collection.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { SearchService } from '../../../../core/shared/search/search.service'; import { hasValue } from '../../../empty.util'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; -import { Collection } from '../../../../core/shared/collection.model'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { FindListOptions } from '../../../../core/data/find-list-options.model'; -import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; -import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { HoverClassDirective } from '../../../hover-class.directive'; -import { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; +import { NotificationsService } from '../../../notifications/notifications.service'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { SearchResult } from '../../../search/models/search-result.model'; import { followLink } from '../../../utils/follow-link-config.model'; import { DSOSelectorComponent } from '../dso-selector.component'; @Component({ - selector: 'ds-authorized-collection-selector', - styleUrls: ['../dso-selector.component.scss'], - templateUrl: '../dso-selector.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgIf, NgFor, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-authorized-collection-selector', + styleUrls: ['../dso-selector.component.scss'], + templateUrl: '../dso-selector.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgIf, NgFor, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** * Component rendering a list of collections to select from diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts index 9e79455ec4..5867da9bde 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts @@ -19,6 +19,7 @@ import { SearchService } from '../../../core/shared/search/search.service'; import { hasValue } from '../../empty.util'; import { NotificationsService } from '../../notifications/notifications.service'; import { ItemSearchResult } from '../../object-collection/shared/item-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$, @@ -26,9 +27,6 @@ import { import { PaginatedSearchOptions } from '../../search/models/paginated-search-options.model'; import { createPaginatedList } from '../../testing/utils.test'; import { DSOSelectorComponent } from './dso-selector.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; describe('DSOSelectorComponent', () => { let component: DSOSelectorComponent; @@ -84,15 +82,15 @@ describe('DSOSelectorComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['error']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), DSOSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), DSOSelectorComponent], + providers: [ { provide: SearchService, useValue: searchService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(DSOSelectorComponent, { - remove: { imports: [ListableObjectComponentLoaderComponent]} + remove: { imports: [ListableObjectComponentLoaderComponent] }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts index 668d0cede3..2a3bf35dbf 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component, ElementRef, @@ -9,8 +15,17 @@ import { QueryList, ViewChildren, } from '@angular/core'; -import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl, +} from '@angular/forms'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -26,16 +41,16 @@ import { tap, } from 'rxjs/operators'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; -import { NotificationsService } from '../../notifications/notifications.service'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Context } from '../../../core/shared/context.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; @@ -45,35 +60,36 @@ import { } from '../../../core/shared/operators'; import { SearchService } from '../../../core/shared/search/search.service'; import { ViewMode } from '../../../core/shared/view-mode.model'; -import { - LISTABLE_NOTIFICATION_OBJECT -} from '../../object-list/listable-notification-object/listable-notification-object.resource-type'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; -import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { HoverClassDirective } from '../../hover-class.directive'; -import { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { hasNoValue, hasValue, isEmpty, isNotEmpty, } from '../../empty.util'; +import { HoverClassDirective } from '../../hover-class.directive'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; import { NotificationType } from '../../notifications/models/notification-type'; -import { NotificationsService } from '../../notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../notifications/notifications.service'; import { CollectionElementLinkType } from '../../object-collection/collection-element-link.type'; import { ListableObject } from '../../object-collection/shared/listable-object.model'; +import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { ListableNotificationObject } from '../../object-list/listable-notification-object/listable-notification-object.model'; -import { LISTABLE_NOTIFICATION_OBJECT } from '../../object-list/listable-notification-object/listable-notification-object.resource-type'; +import { + LISTABLE_NOTIFICATION_OBJECT, + LISTABLE_NOTIFICATION_OBJECT, +} from '../../object-list/listable-notification-object/listable-notification-object.resource-type'; import { PaginatedSearchOptions } from '../../search/models/paginated-search-options.model'; import { SearchResult } from '../../search/models/search-result.model'; @Component({ - selector: 'ds-dso-selector', - styleUrls: ['./dso-selector.component.scss'], - templateUrl: './dso-selector.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgIf, NgFor, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-dso-selector', + styleUrls: ['./dso-selector.component.scss'], + templateUrl: './dso-selector.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, InfiniteScrollModule, NgIf, NgFor, HoverClassDirective, NgClass, ListableObjectComponentLoaderComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts index 086c935538..7c6994f083 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts @@ -17,8 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../../core/shared/community.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { CreateCollectionParentSelectorComponent } from './create-collection-parent-selector.component'; describe('CreateCollectionParentSelectorComponent', () => { @@ -42,29 +42,29 @@ describe('CreateCollectionParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CreateCollectionParentSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), CreateCollectionParentSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: communityRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: communityRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(CreateCollectionParentSelectorComponent, { - remove: { imports: [DSOSelectorComponent]} + remove: { imports: [DSOSelectorComponent] }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index 18fb266c01..5c55232318 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -8,6 +9,7 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { environment } from '../../../../../environments/environment'; import { @@ -20,23 +22,21 @@ import { } from '../../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; /** * Component to wrap a list of existing communities inside a modal * Used to choose a community from to create a new collection in */ @Component({ - selector: 'ds-create-collection-parent-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-create-collection-parent-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class CreateCollectionParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COLLECTION; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts index dc4390f469..5ecd017f5c 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts @@ -9,8 +9,8 @@ import { CreateCollectionParentSelectorComponent } from './create-collection-par @Component({ selector: 'ds-themed-create-collection-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedCreateCollectionParentSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts index 7ae56c43ef..cfef8a6d68 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts @@ -17,8 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../../core/shared/community.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { CreateCommunityParentSelectorComponent } from './create-community-parent-selector.component'; describe('CreateCommunityParentSelectorComponent', () => { @@ -41,29 +41,29 @@ describe('CreateCommunityParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CreateCommunityParentSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), CreateCommunityParentSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: communityRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: communityRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(CreateCommunityParentSelectorComponent, { - remove: { imports: [DSOSelectorComponent]} + remove: { imports: [DSOSelectorComponent] }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts index ad055d54db..13f5c49119 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts @@ -8,31 +8,32 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; -import { environment } from '../../../../../environments/environment'; +import { + environment, + environment, +} from '../../../../../environments/environment'; import { COMMUNITY_PARENT_PARAMETER, + COMMUNITY_PARENT_PARAMETER, + getCommunityCreateRoute, getCommunityCreateRoute, } from '../../../../community-page/community-page-routing-paths'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { hasValue } from '../../../empty.util'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; -import { - getCommunityCreateRoute, - COMMUNITY_PARENT_PARAMETER -} from '../../../../community-page/community-page-routing-paths'; -import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; -import { environment } from '../../../../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; /** * Component to wrap a button - for top communities - @@ -42,11 +43,11 @@ import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component' */ @Component({ - selector: 'ds-create-community-parent-selector', - styleUrls: ['./create-community-parent-selector.component.scss'], - templateUrl: './create-community-parent-selector.component.html', - standalone: true, - imports: [DSOSelectorComponent, TranslateModule] + selector: 'ds-create-community-parent-selector', + styleUrls: ['./create-community-parent-selector.component.scss'], + templateUrl: './create-community-parent-selector.component.html', + standalone: true, + imports: [DSOSelectorComponent, TranslateModule], }) export class CreateCommunityParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COMMUNITY; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts index b297fc1875..9568cc261d 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts @@ -9,8 +9,8 @@ import { CreateCommunityParentSelectorComponent } from './create-community-paren @Component({ selector: 'ds-themed-create-community-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedCreateCommunityParentSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts index f6df84d653..e6a943d58e 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts @@ -17,10 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Collection } from '../../../../core/shared/collection.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { - AuthorizedCollectionSelectorComponent -} from '../../dso-selector/authorized-collection-selector/authorized-collection-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { AuthorizedCollectionSelectorComponent } from '../../dso-selector/authorized-collection-selector/authorized-collection-selector.component'; import { CreateItemParentSelectorComponent } from './create-item-parent-selector.component'; describe('CreateItemParentSelectorComponent', () => { @@ -42,29 +40,29 @@ describe('CreateItemParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CreateItemParentSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), CreateItemParentSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: collectionRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: collectionRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(CreateItemParentSelectorComponent, { - remove: { imports: [AuthorizedCollectionSelectorComponent]} + remove: { imports: [AuthorizedCollectionSelectorComponent] }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts index d36a22d8ac..4c649ba85b 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, Input, @@ -9,17 +10,16 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { environment } from '../../../../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { AuthorizedCollectionSelectorComponent } from '../../dso-selector/authorized-collection-selector/authorized-collection-selector.component'; -import { NgIf } from '@angular/common'; import { SortDirection, SortOptions, } from '../../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { AuthorizedCollectionSelectorComponent } from '../../dso-selector/authorized-collection-selector/authorized-collection-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, @@ -31,12 +31,12 @@ import { */ @Component({ - selector: 'ds-create-item-parent-selector', - // styleUrls: ['./create-item-parent-selector.component.scss'], - // templateUrl: '../dso-selector-modal-wrapper.component.html', - templateUrl: './create-item-parent-selector.component.html', - standalone: true, - imports: [NgIf, AuthorizedCollectionSelectorComponent, TranslateModule] + selector: 'ds-create-item-parent-selector', + // styleUrls: ['./create-item-parent-selector.component.scss'], + // templateUrl: '../dso-selector-modal-wrapper.component.html', + templateUrl: './create-item-parent-selector.component.html', + standalone: true, + imports: [NgIf, AuthorizedCollectionSelectorComponent, TranslateModule], }) export class CreateItemParentSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.ITEM; diff --git a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts index 18d3f0f37d..68bf918c45 100644 --- a/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts @@ -12,8 +12,8 @@ import { CreateItemParentSelectorComponent } from './create-item-parent-selector @Component({ selector: 'ds-themed-create-item-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedCreateItemParentSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts index 14f921312e..80ec88f02f 100644 --- a/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, DebugElement, @@ -24,7 +25,6 @@ import { Item } from '../../../core/shared/item.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { hasValue } from '../../empty.util'; import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; -import { NgIf } from '@angular/common'; import { DSOSelectorComponent } from '../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, @@ -50,24 +50,24 @@ describe('DSOSelectorModalWrapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), TestComponent, MockComponent(DSOSelectorComponent)], - providers: [ + imports: [TranslateModule.forRoot(), TestComponent, MockComponent(DSOSelectorComponent)], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: itemRD, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: itemRD, + }, + }, }, }, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); @@ -165,9 +165,9 @@ describe('DSOSelectorModalWrapperComponent', () => { imports: [ DSOSelectorComponent, NgIf, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) class TestComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.ITEM; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts index 9a800624af..43b1288925 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts @@ -17,8 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Collection } from '../../../../core/shared/collection.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { EditCollectionSelectorComponent } from './edit-collection-selector.component'; describe('EditCollectionSelectorComponent', () => { @@ -64,8 +64,8 @@ describe('EditCollectionSelectorComponent', () => { }) .overrideComponent(EditCollectionSelectorComponent, { remove: { - imports: [DSOSelectorComponent] - } + imports: [DSOSelectorComponent], + }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts index 6b549319ea..db79d040d4 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -7,25 +8,29 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; -import { environment } from '../../../../../environments/environment'; -import { getCollectionEditRoute } from '../../../../collection-page/collection-page-routing-paths'; +import { + environment, + environment, +} from '../../../../../environments/environment'; +import { + getCollectionEditRoute, + getCollectionEditRoute, +} from '../../../../collection-page/collection-page-routing-paths'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; -import { getCollectionEditRoute } from '../../../../collection-page/collection-page-routing-paths'; -import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; -import { environment } from '../../../../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; /** * Component to wrap a list of existing collections inside a modal @@ -33,10 +38,10 @@ import { NgIf } from '@angular/common'; */ @Component({ - selector: 'ds-edit-collection-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-edit-collection-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditCollectionSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COLLECTION; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts index 3491fb3f59..834b4a5f0b 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts @@ -9,8 +9,8 @@ import { EditCollectionSelectorComponent } from './edit-collection-selector.comp @Component({ selector: 'ds-themed-edit-collection-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedEditCollectionSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts index a33c8ce9eb..cd5c0d1831 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts @@ -17,8 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../../core/shared/community.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { EditCommunitySelectorComponent } from './edit-community-selector.component'; describe('EditCommunitySelectorComponent', () => { @@ -41,33 +41,33 @@ describe('EditCommunitySelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), EditCommunitySelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), EditCommunitySelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: communityRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: communityRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(EditCommunitySelectorComponent, { - remove: { - imports: [DSOSelectorComponent] - } -}) -.compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(EditCommunitySelectorComponent, { + remove: { + imports: [DSOSelectorComponent], + }, + }) + .compileComponents(); })); diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts index f29b10f125..591db83df2 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -7,25 +8,29 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; -import { environment } from '../../../../../environments/environment'; -import { getCommunityEditRoute } from '../../../../community-page/community-page-routing-paths'; +import { + environment, + environment, +} from '../../../../../environments/environment'; +import { + getCommunityEditRoute, + getCommunityEditRoute, +} from '../../../../community-page/community-page-routing-paths'; import { SortDirection, + SortDirection, + SortOptions, SortOptions, } from '../../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; -import { getCommunityEditRoute } from '../../../../community-page/community-page-routing-paths'; -import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; -import { environment } from '../../../../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; /** * Component to wrap a list of existing communities inside a modal @@ -33,10 +38,10 @@ import { NgIf } from '@angular/common'; */ @Component({ - selector: 'ds-edit-community-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-edit-community-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditCommunitySelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts index 9f6fde0ff5..27798879ff 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts @@ -9,8 +9,8 @@ import { EditCommunitySelectorComponent } from './edit-community-selector.compon @Component({ selector: 'ds-themed-edit-community-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedEditCommunitySelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts index 48c05cce06..36f38a48d8 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts @@ -17,8 +17,8 @@ import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../../core/shared/item.model'; import { MetadataValue } from '../../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { RouterStub } from '../../../testing/router.stub'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { EditItemSelectorComponent } from './edit-item-selector.component'; describe('EditItemSelectorComponent', () => { diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts index 249bf2786c..ebcc936a3e 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -7,14 +8,13 @@ import { Router, } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { Item } from '../../../../core/shared/item.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; import { getItemEditRoute } from '../../../../item-page/item-page-routing-paths'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, @@ -26,10 +26,10 @@ import { */ @Component({ - selector: 'ds-edit-item-selector', - templateUrl: 'edit-item-selector.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-edit-item-selector', + templateUrl: 'edit-item-selector.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.ITEM; diff --git a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts index 831a8f4d1b..e7b0a456d2 100644 --- a/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts @@ -9,8 +9,8 @@ import { EditItemSelectorComponent } from './edit-item-selector.component'; @Component({ selector: 'ds-themed-edit-item-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedEditItemSelectorComponent extends ThemedComponent { diff --git a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts index ca32c409a0..4db36c9ec2 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts @@ -24,14 +24,19 @@ import { } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../../../core/data/feature-authorization/authorization-data.service'; import { BATCH_EXPORT_SCRIPT_NAME, ScriptDataService, } from '../../../../core/data/processes/script-data.service'; import { Collection } from '../../../../core/shared/collection.model'; import { Item } from '../../../../core/shared/item.model'; +import { SearchService } from '../../../../core/shared/search/search.service'; import { ProcessParameter } from '../../../../process-page/processes/process-parameter.model'; +import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; import { ConfirmationModalComponent } from '../../../confirmation-modal/confirmation-modal.component'; import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; import { NotificationsService } from '../../../notifications/notifications.service'; @@ -42,9 +47,6 @@ import { } from '../../../remote-data.utils'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; import { ExportBatchSelectorComponent } from './export-batch-selector.component'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { SearchService } from '../../../../core/shared/search/search.service'; -import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; // No way to add entryComponents yet to testbed; alternative implemented; source: https://stackoverflow.com/questions/41689468/how-to-shallow-test-a-component-with-an-entrycomponents @NgModule({ @@ -54,9 +56,9 @@ import { SearchServiceStub } from '../../../../shared/testing/search-service.stu provide: TranslateLoader, useClass: TranslateLoaderMock, }, - }), ConfirmationModalComponent], + }), ConfirmationModalComponent], exports: [], - providers: [], + providers: [], }) class ModelTestModule { } @@ -109,31 +111,31 @@ describe('ExportBatchSelectorComponent', () => { isAuthorized: observableOf(true), }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportBatchSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportBatchSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: NotificationsService, useValue: notificationService }, { provide: ScriptDataService, useValue: scriptService }, { provide: AuthorizationDataService, useValue: authorizationDataService }, - { provide: SearchService, useValue: new SearchServiceStub()}, + { provide: SearchService, useValue: new SearchServiceStub() }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: itemRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: itemRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); diff --git a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts index c55298c567..c6ee8d3e41 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -10,7 +11,10 @@ import { NgbActiveModal, NgbModal, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -20,49 +24,63 @@ import { switchMap, } from 'rxjs/operators'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../../../core/data/feature-authorization/authorization-data.service'; +import { + FeatureID, + FeatureID, +} from '../../../../core/data/feature-authorization/feature-id'; import { BATCH_EXPORT_SCRIPT_NAME, ScriptDataService, } from '../../../../core/data/processes/script-data.service'; -import { RemoteData } from '../../../../core/data/remote-data'; +import { + RemoteData, + RemoteData, +} from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { getProcessDetailRoute } from '../../../../process-page/process-page-routing.paths'; -import { Process } from '../../../../process-page/processes/process.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; +import { + getProcessDetailRoute, + getProcessDetailRoute, +} from '../../../../process-page/process-page-routing.paths'; +import { + Process, + Process, +} from '../../../../process-page/processes/process.model'; import { ProcessParameter } from '../../../../process-page/processes/process-parameter.model'; import { ConfirmationModalComponent } from '../../../confirmation-modal/confirmation-modal.component'; import { isNotEmpty } from '../../../empty.util'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, + DSOSelectorModalWrapperComponent, + SelectorActionType, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; -import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { Process } from '../../../../process-page/processes/process.model'; -import { RemoteData } from '../../../../core/data/remote-data'; -import { getProcessDetailRoute } from '../../../../process-page/process-page-routing.paths'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; /** * Component to wrap a list of existing dso's inside a modal * Used to choose a dso from to export metadata of */ @Component({ - selector: 'ds-export-metadata-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-export-metadata-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class ExportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; diff --git a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts index 5280dc7a64..15cef550a1 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts @@ -24,7 +24,10 @@ import { } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../../../core/data/feature-authorization/authorization-data.service'; import { METADATA_EXPORT_SCRIPT_NAME, ScriptDataService, @@ -42,9 +45,8 @@ import { createSuccessfulRemoteDataObject$, } from '../../../remote-data.utils'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; -import { ExportMetadataSelectorComponent } from './export-metadata-selector.component'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; +import { ExportMetadataSelectorComponent } from './export-metadata-selector.component'; // No way to add entryComponents yet to testbed; alternative implemented; source: https://stackoverflow.com/questions/41689468/how-to-shallow-test-a-component-with-an-entrycomponents @NgModule({ @@ -54,9 +56,9 @@ import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component' provide: TranslateLoader, useClass: TranslateLoaderMock, }, - }), ConfirmationModalComponent], + }), ConfirmationModalComponent], exports: [], - providers: [], + providers: [], }) class ModelTestModule { } @@ -123,32 +125,32 @@ describe('ExportMetadataSelectorComponent', () => { isAuthorized: observableOf(true), }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportMetadataSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule, ExportMetadataSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: NotificationsService, useValue: notificationService }, { provide: ScriptDataService, useValue: scriptService }, { provide: AuthorizationDataService, useValue: authorizationDataService }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: itemRD, - }, - }, - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: itemRD, + }, + }, }, + }, }, { provide: Router, useValue: router, }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ExportMetadataSelectorComponent, { - remove: { imports: [DSOSelectorComponent] } + remove: { imports: [DSOSelectorComponent] }, }) .compileComponents(); diff --git a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts index 59c28a3446..58dfb10306 100644 --- a/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, OnInit, @@ -10,7 +11,10 @@ import { NgbActiveModal, NgbModal, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -20,38 +24,52 @@ import { switchMap, } from 'rxjs/operators'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; +import { + AuthorizationDataService, + AuthorizationDataService, +} from '../../../../core/data/feature-authorization/authorization-data.service'; +import { + FeatureID, + FeatureID, +} from '../../../../core/data/feature-authorization/feature-id'; import { METADATA_EXPORT_SCRIPT_NAME, ScriptDataService, } from '../../../../core/data/processes/script-data.service'; -import { RemoteData } from '../../../../core/data/remote-data'; +import { + RemoteData, + RemoteData, +} from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; import { Community } from '../../../../core/shared/community.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { getProcessDetailRoute } from '../../../../process-page/process-page-routing.paths'; -import { Process } from '../../../../process-page/processes/process.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; +import { + getProcessDetailRoute, + getProcessDetailRoute, +} from '../../../../process-page/process-page-routing.paths'; +import { + Process, + Process, +} from '../../../../process-page/processes/process.model'; import { ProcessParameter } from '../../../../process-page/processes/process-parameter.model'; import { ConfirmationModalComponent } from '../../../confirmation-modal/confirmation-modal.component'; import { isNotEmpty } from '../../../empty.util'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { Process } from '../../../../process-page/processes/process.model'; -import { RemoteData } from '../../../../core/data/remote-data'; -import { getProcessDetailRoute } from '../../../../process-page/process-page-routing.paths'; -import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; -import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { DSOSelectorModalWrapperComponent, + DSOSelectorModalWrapperComponent, + SelectorActionType, SelectorActionType, } from '../dso-selector-modal-wrapper.component'; @@ -60,10 +78,10 @@ import { * Used to choose a dso from to export metadata of */ @Component({ - selector: 'ds-export-metadata-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-export-metadata-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class ExportMetadataSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; diff --git a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.spec.ts b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.spec.ts index 6949b5d7a8..e8580fe51d 100644 --- a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.spec.ts +++ b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.spec.ts @@ -10,13 +10,13 @@ import { TranslateModule } from '@ngx-translate/core'; import { Collection } from '../../../../core/shared/collection.model'; import { Item } from '../../../../core/shared/item.model'; -import { ImportBatchSelectorComponent } from './import-batch-selector.component'; import { SearchService } from '../../../../core/shared/search/search.service'; -import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; +import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { ImportBatchSelectorComponent } from './import-batch-selector.component'; describe('ImportBatchSelectorComponent', () => { let component: ImportBatchSelectorComponent; @@ -43,15 +43,15 @@ describe('ImportBatchSelectorComponent', () => { const modalStub = jasmine.createSpyObj('modalStub', ['close']); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ImportBatchSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ImportBatchSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: SearchService, useValue: new SearchServiceStub() }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts index 2cb49d8a0e..599b9977ef 100644 --- a/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts +++ b/src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts @@ -1,25 +1,36 @@ -import { Component, EventEmitter, OnInit, Output, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + OnInit, + Output, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Observable, of, } from 'rxjs'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of, +} from 'rxjs'; import { Collection } from '../../../../core/shared/collection.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; -import { NgIf } from '@angular/common'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector.component'; +import { + DSOSelectorModalWrapperComponent, + SelectorActionType, +} from '../dso-selector-modal-wrapper.component'; /** * Component to wrap a list of existing dso's inside a modal * Used to choose a dso from to import metadata of */ @Component({ - selector: 'ds-import-batch-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', - standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + selector: 'ds-import-batch-selector', + templateUrl: '../dso-selector-modal-wrapper.component.html', + standalone: true, + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class ImportBatchSelectorComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.DSPACEOBJECT; diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts index e4d4c986fe..cd540328d1 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { ChangeDetectorRef, NO_ERRORS_SCHEMA, @@ -10,23 +11,22 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { TestScheduler } from 'rxjs/testing'; import { EntityTypeDataService } from '../../core/data/entity-type-data.service'; import { ItemType } from '../../core/shared/item-relationships/item-type.model'; +import { ThemedLoadingComponent } from '../loading/themed-loading.component'; import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; import { createPaginatedList } from '../testing/utils.test'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { AsyncPipe } from '@angular/common'; -import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; import { EntityDropdownComponent } from './entity-dropdown.component'; @Pipe({ // eslint-disable-next-line @angular-eslint/pipe-prefix - name: 'translate', - standalone: true + name: 'translate', + standalone: true, }) class MockTranslatePipe implements PipeTransform { transform(value: string): string { @@ -103,12 +103,12 @@ describe('EntityDropdownComponent', () => { ], schemas: [NO_ERRORS_SCHEMA], }) - .overrideComponent(EntityDropdownComponent, { - add: { - imports: [MockTranslatePipe] - } - }) - .compileComponents(); + .overrideComponent(EntityDropdownComponent, { + add: { + imports: [MockTranslatePipe], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index 0ccc2765d8..28caceb14e 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -8,6 +13,8 @@ import { OnInit, Output, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { BehaviorSubject, Observable, @@ -26,17 +33,14 @@ import { RemoteData } from '../../core/data/remote-data'; import { ItemType } from '../../core/shared/item-relationships/item-type.model'; import { getFirstSucceededRemoteWithNotEmptyData } from '../../core/shared/operators'; import { hasValue } from '../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { NgIf, NgFor, AsyncPipe } from '@angular/common'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; @Component({ - selector: 'ds-entity-dropdown', - templateUrl: './entity-dropdown.component.html', - styleUrls: ['./entity-dropdown.component.scss'], - standalone: true, - imports: [InfiniteScrollModule, NgIf, NgFor, ThemedLoadingComponent, AsyncPipe, TranslateModule] + selector: 'ds-entity-dropdown', + templateUrl: './entity-dropdown.component.html', + styleUrls: ['./entity-dropdown.component.scss'], + standalone: true, + imports: [InfiniteScrollModule, NgIf, NgFor, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class EntityDropdownComponent implements OnInit, OnDestroy { /** diff --git a/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts b/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts index 0b3cccd17b..65b636a1d2 100644 --- a/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts +++ b/src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts @@ -15,6 +15,14 @@ import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import uniqueId from 'lodash/uniqueId'; import { of as observableOf } from 'rxjs'; +import { DSONameService } from 'src/app/core/breadcrumbs/dso-name.service'; +import { + dataService, + getDataServiceFor, +} from 'src/app/core/data/base/data-service.decorator'; +import { EPERSON } from 'src/app/core/eperson/models/eperson.resource-type'; +import { GROUP } from 'src/app/core/eperson/models/group.resource-type'; +import { ResourceType } from 'src/app/core/shared/resource-type'; import { buildPaginatedList } from '../../core/data/paginated-list.model'; import { RequestService } from '../../core/data/request.service'; @@ -22,28 +30,23 @@ import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../core/eperson/group-data.service'; import { PaginationService } from '../../core/pagination/pagination.service'; import { PageInfo } from '../../core/shared/page-info.model'; +import { DSONameServiceMock } from '../mocks/dso-name.service.mock'; import { getMockRequestService } from '../mocks/request.service.mock'; -import { EpersonGroupListComponent } from './eperson-group-list.component'; +import { PaginationComponent } from '../pagination/pagination.component'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject } from '../remote-data.utils'; import { EPersonMock } from '../testing/eperson.mock'; import { GroupMock } from '../testing/group-mock'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; -import { EpersonSearchBoxComponent } from './eperson-search-box/eperson-search-box.component'; -import { GroupSearchBoxComponent } from './group-search-box/group-search-box.component'; -import { PaginationComponent } from '../pagination/pagination.component'; -import { DSONameService } from 'src/app/core/breadcrumbs/dso-name.service'; -import { DSONameServiceMock } from '../mocks/dso-name.service.mock'; -import { EPERSON } from 'src/app/core/eperson/models/eperson.resource-type'; -import { GROUP } from 'src/app/core/eperson/models/group.resource-type'; -import { ResourceType } from 'src/app/core/shared/resource-type'; -import { dataService, getDataServiceFor } from 'src/app/core/data/base/data-service.decorator'; -import { SearchEvent } from './eperson-group-list-event-type'; import { createTestComponent } from '../testing/utils.test'; import { + EpersonGroupListComponent, EpersonGroupListComponent, SearchEvent, } from './eperson-group-list.component'; +import { SearchEvent } from './eperson-group-list-event-type'; +import { EpersonSearchBoxComponent } from './eperson-search-box/eperson-search-box.component'; +import { GroupSearchBoxComponent } from './group-search-box/group-search-box.component'; describe('EpersonGroupListComponent test suite', () => { let comp: EpersonGroupListComponent; @@ -98,8 +101,8 @@ describe('EpersonGroupListComponent test suite', () => { EpersonGroupListComponent, TestComponent, EpersonSearchBoxComponent, - GroupSearchBoxComponent, - PaginationComponent, + GroupSearchBoxComponent, + PaginationComponent, ], providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, @@ -316,9 +319,9 @@ describe('EpersonGroupListComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/shared/eperson-group-list/eperson-group-list.component.ts b/src/app/shared/eperson-group-list/eperson-group-list.component.ts index 55c13b5c38..6605e6c541 100644 --- a/src/app/shared/eperson-group-list/eperson-group-list.component.ts +++ b/src/app/shared/eperson-group-list/eperson-group-list.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -7,6 +12,7 @@ import { OnInit, Output, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import uniqueId from 'lodash/uniqueId'; import { BehaviorSubject, @@ -33,23 +39,21 @@ import { hasValue, isNotEmpty, } from '../empty.util'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { TranslateModule } from '@ngx-translate/core'; import { PaginationComponent } from '../pagination/pagination.component'; -import { GroupSearchBoxComponent } from './group-search-box/group-search-box.component'; -import { EpersonSearchBoxComponent } from './eperson-search-box/eperson-search-box.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; +import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { SearchEvent } from './eperson-group-list-event-type'; +import { EpersonSearchBoxComponent } from './eperson-search-box/eperson-search-box.component'; +import { GroupSearchBoxComponent } from './group-search-box/group-search-box.component'; @Component({ - selector: 'ds-eperson-group-list', - styleUrls: ['./eperson-group-list.component.scss'], - templateUrl: './eperson-group-list.component.html', - animations: [ - fadeInOut - ], - standalone: true, - imports: [NgIf, EpersonSearchBoxComponent, GroupSearchBoxComponent, PaginationComponent, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-eperson-group-list', + styleUrls: ['./eperson-group-list.component.scss'], + templateUrl: './eperson-group-list.component.html', + animations: [ + fadeInOut, + ], + standalone: true, + imports: [NgIf, EpersonSearchBoxComponent, GroupSearchBoxComponent, PaginationComponent, NgFor, AsyncPipe, TranslateModule], }) /** * Component that shows a list of eperson or group diff --git a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.spec.ts b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.spec.ts index c86ba6437d..084fc8bf17 100644 --- a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.spec.ts +++ b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.spec.ts @@ -16,11 +16,12 @@ import { import { TranslateModule } from '@ngx-translate/core'; import { createTestComponent } from '../../testing/utils.test'; -import { EpersonSearchBoxComponent } from './eperson-search-box.component'; - -import { SearchEvent } from '../eperson-group-list-event-type'; import { SearchEvent } from '../eperson-group-list.component'; -import { EpersonSearchBoxComponent } from './eperson-search-box.component'; +import { SearchEvent } from '../eperson-group-list-event-type'; +import { + EpersonSearchBoxComponent, + EpersonSearchBoxComponent, +} from './eperson-search-box.component'; describe('EpersonSearchBoxComponent test suite', () => { let comp: EpersonSearchBoxComponent; @@ -31,21 +32,21 @@ describe('EpersonSearchBoxComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, TranslateModule.forRoot(), EpersonSearchBoxComponent, TestComponent, - ], - providers: [ + ], + providers: [ UntypedFormBuilder, EpersonSearchBoxComponent, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -119,11 +120,11 @@ describe('EpersonSearchBoxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule], }) class TestComponent { diff --git a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts index 3c7a92266b..b7006570ce 100644 --- a/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts +++ b/src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts @@ -3,22 +3,26 @@ import { EventEmitter, Output, } from '@angular/core'; -import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { isNotNull } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchEvent } from '../eperson-group-list-event-type'; import { SearchEvent } from '../eperson-group-list.component'; +import { SearchEvent } from '../eperson-group-list-event-type'; /** * A component used to show a search box for epersons. */ @Component({ - selector: 'ds-eperson-search-box', - templateUrl: './eperson-search-box.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule] + selector: 'ds-eperson-search-box', + templateUrl: './eperson-search-box.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, TranslateModule], }) export class EpersonSearchBoxComponent { diff --git a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.spec.ts b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.spec.ts index 417ad325f9..c835a3a286 100644 --- a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.spec.ts +++ b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.spec.ts @@ -1,13 +1,24 @@ -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, } from '@angular/forms'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; import { createTestComponent } from '../../testing/utils.test'; -import { GroupSearchBoxComponent } from './group-search-box.component'; - -import { SearchEvent } from '../eperson-group-list-event-type'; import { SearchEvent } from '../eperson-group-list.component'; +import { SearchEvent } from '../eperson-group-list-event-type'; +import { GroupSearchBoxComponent } from './group-search-box.component'; describe('GroupSearchBoxComponent test suite', () => { let comp: GroupSearchBoxComponent; @@ -18,21 +29,21 @@ describe('GroupSearchBoxComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, TranslateModule.forRoot(), GroupSearchBoxComponent, TestComponent, - ], - providers: [ + ], + providers: [ UntypedFormBuilder, GroupSearchBoxComponent, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -105,11 +116,11 @@ describe('GroupSearchBoxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule], }) class TestComponent { diff --git a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts index e1e7bcae16..0aa7955559 100644 --- a/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts +++ b/src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts @@ -1,19 +1,27 @@ -import { Component, EventEmitter, Output, } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; +import { + Component, + EventEmitter, + Output, +} from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { isNotNull } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; import { SearchEvent } from '../eperson-group-list-event-type'; /** * A component used to show a search box for groups. */ @Component({ - selector: 'ds-group-search-box', - templateUrl: './group-search-box.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule] + selector: 'ds-group-search-box', + templateUrl: './group-search-box.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, TranslateModule], }) export class GroupSearchBoxComponent { diff --git a/src/app/shared/error/error.component.spec.ts b/src/app/shared/error/error.component.spec.ts index f1c8148d59..5e65817402 100644 --- a/src/app/shared/error/error.component.spec.ts +++ b/src/app/shared/error/error.component.spec.ts @@ -1,3 +1,4 @@ +import { CommonModule } from '@angular/common'; import { DebugElement } from '@angular/core'; import { ComponentFixture, @@ -5,6 +6,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateLoader, TranslateModule, @@ -13,8 +15,6 @@ import { import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; import { ErrorComponent } from './error.component'; -import { CommonModule } from '@angular/common'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('ErrorComponent (inline template)', () => { @@ -34,7 +34,7 @@ describe('ErrorComponent (inline template)', () => { useClass: TranslateLoaderMock, }, }), - ErrorComponent + ErrorComponent, ], providers: [TranslateService], }).compileComponents(); // compile template and css diff --git a/src/app/shared/error/error.component.ts b/src/app/shared/error/error.component.ts index b15e4f19d4..900ea67887 100644 --- a/src/app/shared/error/error.component.ts +++ b/src/app/shared/error/error.component.ts @@ -5,15 +5,15 @@ import { import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { AlertType } from '../alert/alert-type'; import { AlertComponent } from '../alert/alert.component'; +import { AlertType } from '../alert/alert-type'; @Component({ - selector: 'ds-error', - styleUrls: ['./error.component.scss'], - templateUrl: './error.component.html', - standalone: true, - imports: [AlertComponent] + selector: 'ds-error', + styleUrls: ['./error.component.scss'], + templateUrl: './error.component.html', + standalone: true, + imports: [AlertComponent], }) export class ErrorComponent { diff --git a/src/app/shared/file-download-link/file-download-link.component.spec.ts b/src/app/shared/file-download-link/file-download-link.component.spec.ts index 1d0283e139..d14ab8ac0d 100644 --- a/src/app/shared/file-download-link/file-download-link.component.spec.ts +++ b/src/app/shared/file-download-link/file-download-link.component.spec.ts @@ -1,7 +1,18 @@ -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { + ActivatedRoute, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { getBitstreamModuleRoute } from '../../app-routing-paths'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; @@ -10,9 +21,8 @@ import { Bitstream } from '../../core/shared/bitstream.model'; import { Item } from '../../core/shared/item.model'; import { URLCombiner } from '../../core/url-combiner/url-combiner'; import { getItemModuleRoute } from '../../item-page/item-page-routing-paths'; -import { RouterLinkDirectiveStub } from '../testing/router-link-directive.stub'; -import { ActivatedRoute, RouterLink } from '@angular/router'; import { ActivatedRouteStub } from '../testing/active-router.stub'; +import { RouterLinkDirectiveStub } from '../testing/router-link-directive.stub'; import { FileDownloadLinkComponent } from './file-download-link.component'; describe('FileDownloadLinkComponent', () => { @@ -47,17 +57,17 @@ describe('FileDownloadLinkComponent', () => { TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), - FileDownloadLinkComponent + FileDownloadLinkComponent, ], providers: [ RouterLinkDirectiveStub, { provide: AuthorizationDataService, useValue: authorizationService }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ] + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], }) .overrideComponent(FileDownloadLinkComponent, { remove: { imports: [RouterLink] }, - add: { imports: [RouterLinkDirectiveStub] } + add: { imports: [RouterLinkDirectiveStub] }, }) .compileComponents(); } diff --git a/src/app/shared/file-download-link/file-download-link.component.ts b/src/app/shared/file-download-link/file-download-link.component.ts index b1a597b0d0..991f5ba864 100644 --- a/src/app/shared/file-download-link/file-download-link.component.ts +++ b/src/app/shared/file-download-link/file-download-link.component.ts @@ -1,23 +1,42 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { combineLatest as observableCombineLatest, Observable, of as observableOf, } from 'rxjs'; +import { + AsyncPipe, + NgClass, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, + Observable, + of as observableOf, +} from 'rxjs'; import { map } from 'rxjs/operators'; -import { getBitstreamDownloadRoute, getBitstreamRequestACopyRoute, } from '../../app-routing-paths'; +import { + getBitstreamDownloadRoute, + getBitstreamRequestACopyRoute, +} from '../../app-routing-paths'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../core/data/feature-authorization/feature-id'; import { Bitstream } from '../../core/shared/bitstream.model'; import { Item } from '../../core/shared/item.model'; -import { AsyncPipe, NgClass, NgIf, NgTemplateOutlet } from '@angular/common'; -import { RouterLink } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; -import { hasValue, isNotEmpty, } from '../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../empty.util'; @Component({ - selector: 'ds-file-download-link', - templateUrl: './file-download-link.component.html', - styleUrls: ['./file-download-link.component.scss'], - standalone: true, - imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule] + selector: 'ds-file-download-link', + templateUrl: './file-download-link.component.html', + styleUrls: ['./file-download-link.component.scss'], + standalone: true, + imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule], }) /** * Component displaying a download link diff --git a/src/app/shared/file-download-link/themed-file-download-link.component.ts b/src/app/shared/file-download-link/themed-file-download-link.component.ts index 29047dc96f..e4085b06f9 100644 --- a/src/app/shared/file-download-link/themed-file-download-link.component.ts +++ b/src/app/shared/file-download-link/themed-file-download-link.component.ts @@ -9,10 +9,10 @@ import { ThemedComponent } from '../theme-support/themed.component'; import { FileDownloadLinkComponent } from './file-download-link.component'; @Component({ - selector: 'ds-themed-file-download-link', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-file-download-link', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', + standalone: true, }) export class ThemedFileDownloadLinkComponent extends ThemedComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts index 374a319d82..5351315b82 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts @@ -1,27 +1,38 @@ -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { CUSTOM_ELEMENTS_SCHEMA, DebugElement, NgZone, SimpleChange } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; import { CUSTOM_ELEMENTS_SCHEMA, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, DebugElement, NgZone, + NgZone, + SimpleChange, SimpleChange, } from '@angular/core'; import { ComponentFixture, + ComponentFixture, + inject, inject, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { FormsModule, + FormsModule, + ReactiveFormsModule, ReactiveFormsModule, UntypedFormControl, + UntypedFormControl, + UntypedFormGroup, UntypedFormGroup, } from '@angular/forms'; import { By } from '@angular/platform-browser'; -import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; +import { + BrowserDynamicTestingModule, + BrowserDynamicTestingModule, +} from '@angular/platform-browser-dynamic/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicCheckboxGroupModel, @@ -56,80 +67,121 @@ import { DynamicNGBootstrapTextAreaComponent, DynamicNGBootstrapTimePickerComponent, } from '@ng-dynamic-forms/ui-ng-bootstrap'; -import { Store } from '@ngrx/store'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgxMaskModule } from 'ngx-mask'; -import { of as observableOf } from 'rxjs'; - -import { DsDynamicFormControlContainerComponent } from './ds-dynamic-form-control-container.component'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; -import { ItemDataService } from '../../../../core/data/item-data.service'; -import { RelationshipDataService } from '../../../../core/data/relationship-data.service'; -import { Item } from '../../../../core/shared/item.model'; -import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; -import { SubmissionObjectDataService } from '../../../../core/submission/submission-object-data.service'; -import { VocabularyOptions } from '../../../../core/submission/vocabularies/models/vocabulary-options.model'; -import { SubmissionService } from '../../../../submission/submission.service'; -import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; -import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { SharedModule } from '../../../shared.module'; -import { FormService } from '../../form.service'; -import { FormBuilderService } from '../form-builder.service'; import { + Store, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; +import { + NgxMaskModule, + NgxMaskModule, +} from 'ngx-mask'; +import { + of as observableOf, + of as observableOf, +} from 'rxjs'; + +import { + APP_CONFIG, + APP_CONFIG, + APP_DATA_SERVICES_MAP, + APP_DYNAMIC_FORM_CONTROL_FN, +} from '../../../../../config/app-config.interface'; +import { + environment, + environment, +} from '../../../../../environments/environment'; +import { + ItemDataService, + ItemDataService, +} from '../../../../core/data/item-data.service'; +import { + RelationshipDataService, + RelationshipDataService, +} from '../../../../core/data/relationship-data.service'; +import { + Item, + Item, +} from '../../../../core/shared/item.model'; +import { + WorkspaceItem, + WorkspaceItem, +} from '../../../../core/submission/models/workspaceitem.model'; +import { + SubmissionObjectDataService, + SubmissionObjectDataService, +} from '../../../../core/submission/submission-object-data.service'; +import { VocabularyOptions } from '../../../../core/submission/vocabularies/models/vocabulary-options.model'; +import { + SubmissionService, + SubmissionService, +} from '../../../../submission/submission.service'; +import { + SelectableListService, + SelectableListService, +} from '../../../object-list/selectable-list/selectable-list.service'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject, +} from '../../../remote-data.utils'; +import { + FormService, + FormService, +} from '../../form.service'; +import { + FormBuilderService, + FormBuilderService, +} from '../form-builder.service'; +import { + DsDynamicFormControlContainerComponent, DsDynamicFormControlContainerComponent, dsDynamicFormControlMapFn, } from './ds-dynamic-form-control-container.component'; -import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; -import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; -import { DsDatePickerComponent } from './models/date-picker/date-picker.component'; +import { dsDynamicFormControlMapFn } from './ds-dynamic-form-control-map-fn'; +import { + DsDynamicTypeBindRelationService, + DsDynamicTypeBindRelationService, +} from './ds-dynamic-type-bind-relation.service'; +import { + DsDynamicFormArrayComponent, + DsDynamicFormArrayComponent, +} from './models/array-group/dynamic-form-array.component'; +import { + DsDatePickerComponent, + DsDatePickerComponent, +} from './models/date-picker/date-picker.component'; import { DynamicDsDatePickerModel } from './models/date-picker/date-picker.model'; -import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; +import { + DsDatePickerInlineComponent, + DsDatePickerInlineComponent, +} from './models/date-picker-inline/dynamic-date-picker-inline.component'; import { DynamicQualdropModel } from './models/ds-dynamic-qualdrop.model'; -import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component'; -import { DsDynamicListComponent } from './models/list/dynamic-list.component'; +import { + DsDynamicFormGroupComponent, + DsDynamicFormGroupComponent, +} from './models/form-group/dynamic-form-group.component'; +import { + DsDynamicListComponent, + DsDynamicListComponent, +} from './models/list/dynamic-list.component'; import { DynamicListCheckboxGroupModel } from './models/list/dynamic-list-checkbox-group.model'; import { DynamicListRadioGroupModel } from './models/list/dynamic-list-radio-group.model'; -import { DsDynamicLookupComponent } from './models/lookup/dynamic-lookup.component'; +import { + DsDynamicLookupComponent, + DsDynamicLookupComponent, +} from './models/lookup/dynamic-lookup.component'; import { DynamicLookupModel } from './models/lookup/dynamic-lookup.model'; import { DynamicLookupNameModel } from './models/lookup/dynamic-lookup-name.model'; import { DsDynamicOneboxComponent } from './models/onebox/dynamic-onebox.component'; import { DynamicOneboxModel } from './models/onebox/dynamic-onebox.model'; -import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components'; -import { DynamicRelationGroupModel } from './models/relation-group/dynamic-relation-group.model'; import { - DsDynamicScrollableDropdownComponent -} from './models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; + DsDynamicRelationGroupComponent, + DsDynamicRelationGroupComponent, +} from './models/relation-group/dynamic-relation-group.components'; +import { DynamicRelationGroupModel } from './models/relation-group/dynamic-relation-group.model'; +import { DsDynamicScrollableDropdownComponent } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; import { DynamicScrollableDropdownModel } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; import { DsDynamicTagComponent } from './models/tag/dynamic-tag.component'; -import { DsDynamicListComponent } from './models/list/dynamic-list.component'; -import { DsDatePickerComponent } from './models/date-picker/date-picker.component'; -import { DsDynamicLookupComponent } from './models/lookup/dynamic-lookup.component'; -import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; -import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component'; -import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components'; -import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; -import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; -import { RelationshipDataService } from '../../../../core/data/relationship-data.service'; -import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; -import { ItemDataService } from '../../../../core/data/item-data.service'; -import { Store } from '@ngrx/store'; -import { SubmissionObjectDataService } from '../../../../core/submission/submission-object-data.service'; -import { Item } from '../../../../core/shared/item.model'; -import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; -import { of as observableOf } from 'rxjs'; -import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; -import { FormService } from '../../form.service'; -import { SubmissionService } from '../../../../submission/submission.service'; -import { FormBuilderService } from '../form-builder.service'; -import { NgxMaskModule } from 'ngx-mask'; -import { - APP_CONFIG, - APP_DATA_SERVICES_MAP, - APP_DYNAMIC_FORM_CONTROL_FN -} from '../../../../../config/app-config.interface'; -import { environment } from '../../../../../environments/environment'; -import { dsDynamicFormControlMapFn } from './ds-dynamic-form-control-map-fn'; import { DynamicTagModel } from './models/tag/dynamic-tag.model'; function getMockDsDynamicTypeBindRelationService(): DsDynamicTypeBindRelationService { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index 802a3a9feb..156f356390 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts @@ -1,3 +1,10 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -18,12 +25,18 @@ import { ViewChild, ViewContainerRef, } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormArray, +import { + FormsModule, + ReactiveFormsModule, + UntypedFormArray, UntypedFormGroup, } from '@angular/forms'; import { + NgbModal, NgbModal, NgbModalRef, + NgbModalRef, + NgbTooltipModule, } from '@ng-bootstrap/ng-bootstrap'; import { DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX, @@ -41,17 +54,6 @@ import { DynamicFormValidationService, DynamicTemplateDirective, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { - ExistingMetadataListElementComponent, - ReorderableRelationship -} from './existing-metadata-list-element/existing-metadata-list-element.component'; -import { hasNoValue, hasValue, isNotEmpty, isNotUndefined } from '../../../empty.util'; -import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model'; -import { find, map, startWith, switchMap, take } from 'rxjs/operators'; -import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; -import { SearchResult } from '../../../search/models/search-result.model'; import { DynamicNGBootstrapCalendarComponent, DynamicNGBootstrapCheckboxComponent, @@ -63,35 +65,50 @@ import { DynamicNGBootstrapTimePickerComponent, } from '@ng-dynamic-forms/ui-ng-bootstrap'; import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { + combineLatest as observableCombineLatest, combineLatest as observableCombineLatest, Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { find, + find, + map, map, startWith, + startWith, switchMap, + switchMap, + take, take, } from 'rxjs/operators'; import { APP_CONFIG, + APP_CONFIG, + APP_DYNAMIC_FORM_CONTROL_FN, AppConfig, + AppConfig, + DynamicFormControlFn, } from '../../../../../config/app-config.interface'; import { AppState } from '../../../../app.reducer'; import { ItemDataService } from '../../../../core/data/item-data.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; -import { RelationshipDataService } from '../../../../core/data/relationship-data.service'; +import { + RelationshipDataService, + RelationshipDataService, +} from '../../../../core/data/relationship-data.service'; import { RemoteData } from '../../../../core/data/remote-data'; import { Collection } from '../../../../core/shared/collection.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { NgbModal, NgbModalRef, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { RelationshipDataService } from '../../../../core/data/relationship-data.service'; -import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; -import { DsDynamicLookupRelationModalComponent } from './relation-lookup-modal/dynamic-lookup-relation-modal.component'; import { Item } from '../../../../core/shared/item.model'; import { Relationship } from '../../../../core/shared/item-relationships/relationship.model'; import { @@ -111,38 +128,53 @@ import { paginatedRelationsToItems } from '../../../../item-page/simple/item-typ import { SubmissionService } from '../../../../submission/submission.service'; import { hasNoValue, + hasNoValue, + hasValue, hasValue, isNotEmpty, + isNotEmpty, + isNotUndefined, isNotUndefined, } from '../../../empty.util'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; import { SelectableListState } from '../../../object-list/selectable-list/selectable-list.reducer'; -import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; -import { SearchResult } from '../../../search/models/search-result.model'; +import { + SelectableListService, + SelectableListService, +} from '../../../object-list/selectable-list/selectable-list.service'; +import { + SearchResult, + SearchResult, +} from '../../../search/models/search-result.model'; import { followLink } from '../../../utils/follow-link-config.model'; -import { itemLinksToFollow } from '../../../utils/relation-query.utils'; +import { + itemLinksToFollow, + itemLinksToFollow, +} from '../../../utils/relation-query.utils'; import { FormService } from '../../form.service'; import { FormBuilderService } from '../form-builder.service'; -import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model'; import { - APP_CONFIG, - APP_DYNAMIC_FORM_CONTROL_FN, - AppConfig, - DynamicFormControlFn -} from '../../../../../config/app-config.interface'; -import { itemLinksToFollow } from '../../../utils/relation-query.utils'; -import { AsyncPipe, NgClass, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; -import { - ExistingRelationListElementComponent -} from './existing-relation-list-element/existing-relation-list-element.component'; -import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model'; + FormFieldMetadataValueObject, + FormFieldMetadataValueObject, +} from '../models/form-field-metadata-value.model'; import { RelationshipOptions } from '../models/relationship-options.model'; import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-constants'; -import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; -import { ReorderableRelationship } from './existing-metadata-list-element/existing-metadata-list-element.component'; +import { + DsDynamicTypeBindRelationService, + DsDynamicTypeBindRelationService, +} from './ds-dynamic-type-bind-relation.service'; +import { + ExistingMetadataListElementComponent, + ReorderableRelationship, + ReorderableRelationship, +} from './existing-metadata-list-element/existing-metadata-list-element.component'; +import { ExistingRelationListElementComponent } from './existing-relation-list-element/existing-relation-list-element.component'; import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; import { CustomSwitchComponent } from './models/custom-switch/custom-switch.component'; -import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model'; +import { + DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH, + DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH, +} from './models/custom-switch/custom-switch.model'; import { DsDatePickerComponent } from './models/date-picker/date-picker.component'; import { DYNAMIC_FORM_CONTROL_TYPE_DSDATEPICKER } from './models/date-picker/date-picker.model'; import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; @@ -162,7 +194,10 @@ import { DsDynamicScrollableDropdownComponent } from './models/scrollable-dropdo import { DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; import { DsDynamicTagComponent } from './models/tag/dynamic-tag.component'; import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './models/tag/dynamic-tag.model'; -import { DsDynamicLookupRelationModalComponent } from './relation-lookup-modal/dynamic-lookup-relation-modal.component'; +import { + DsDynamicLookupRelationModalComponent, + DsDynamicLookupRelationModalComponent, +} from './relation-lookup-modal/dynamic-lookup-relation-modal.component'; export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type | null { switch (model.type) { @@ -244,9 +279,9 @@ export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type< FormsModule, NgbTooltipModule, NgTemplateOutlet, - ExistingRelationListElementComponent + ExistingRelationListElementComponent, ], - standalone: true + standalone: true, }) export class DsDynamicFormControlContainerComponent extends DynamicFormControlContainerComponent implements OnInit, OnChanges, OnDestroy { @ContentChildren(DynamicTemplateDirective) contentTemplateList: QueryList; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn.ts index 2c2e950065..223b44404c 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn.ts @@ -1,3 +1,4 @@ +import { Type } from '@angular/core'; import { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX, @@ -11,10 +12,8 @@ import { DYNAMIC_FORM_CONTROL_TYPE_TIMEPICKER, DynamicDatePickerModel, DynamicFormControl, - DynamicFormControlModel + DynamicFormControlModel, } from '@ng-dynamic-forms/core'; -import { Type } from '@angular/core'; -import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; import { DynamicNGBootstrapCalendarComponent, DynamicNGBootstrapCheckboxComponent, @@ -23,34 +22,32 @@ import { DynamicNGBootstrapRadioGroupComponent, DynamicNGBootstrapSelectComponent, DynamicNGBootstrapTextAreaComponent, - DynamicNGBootstrapTimePickerComponent + DynamicNGBootstrapTimePickerComponent, } from '@ng-dynamic-forms/ui-ng-bootstrap'; -import { DynamicListCheckboxGroupModel } from './models/list/dynamic-list-checkbox-group.model'; -import { DsDynamicListComponent } from './models/list/dynamic-list.component'; -import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; -import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component'; -import { DynamicListRadioGroupModel } from './models/list/dynamic-list-radio-group.model'; -import { DYNAMIC_FORM_CONTROL_TYPE_ONEBOX } from './models/onebox/dynamic-onebox.model'; -import { DsDynamicOneboxComponent } from './models/onebox/dynamic-onebox.component'; -import { - DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN -} from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; -import { - DsDynamicScrollableDropdownComponent -} from './models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; -import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './models/tag/dynamic-tag.model'; -import { DsDynamicTagComponent } from './models/tag/dynamic-tag.component'; + import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-constants'; -import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components'; -import { DYNAMIC_FORM_CONTROL_TYPE_DSDATEPICKER } from './models/date-picker/date-picker.model'; -import { DsDatePickerComponent } from './models/date-picker/date-picker.component'; -import { DYNAMIC_FORM_CONTROL_TYPE_LOOKUP } from './models/lookup/dynamic-lookup.model'; -import { DsDynamicLookupComponent } from './models/lookup/dynamic-lookup.component'; -import { DYNAMIC_FORM_CONTROL_TYPE_LOOKUP_NAME } from './models/lookup/dynamic-lookup-name.model'; -import { DYNAMIC_FORM_CONTROL_TYPE_DISABLED } from './models/disabled/dynamic-disabled.model'; -import { DsDynamicDisabledComponent } from './models/disabled/dynamic-disabled.component'; -import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model'; +import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; import { CustomSwitchComponent } from './models/custom-switch/custom-switch.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model'; +import { DsDatePickerComponent } from './models/date-picker/date-picker.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_DSDATEPICKER } from './models/date-picker/date-picker.model'; +import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; +import { DsDynamicDisabledComponent } from './models/disabled/dynamic-disabled.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_DISABLED } from './models/disabled/dynamic-disabled.model'; +import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component'; +import { DsDynamicListComponent } from './models/list/dynamic-list.component'; +import { DynamicListCheckboxGroupModel } from './models/list/dynamic-list-checkbox-group.model'; +import { DynamicListRadioGroupModel } from './models/list/dynamic-list-radio-group.model'; +import { DsDynamicLookupComponent } from './models/lookup/dynamic-lookup.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_LOOKUP } from './models/lookup/dynamic-lookup.model'; +import { DYNAMIC_FORM_CONTROL_TYPE_LOOKUP_NAME } from './models/lookup/dynamic-lookup-name.model'; +import { DsDynamicOneboxComponent } from './models/onebox/dynamic-onebox.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_ONEBOX } from './models/onebox/dynamic-onebox.model'; +import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components'; +import { DsDynamicScrollableDropdownComponent } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; +import { DsDynamicTagComponent } from './models/tag/dynamic-tag.component'; +import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './models/tag/dynamic-tag.model'; export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type | null { switch (model.type) { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts index 37ea859997..4146fc8e4d 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts @@ -1,8 +1,10 @@ +import { NgForOf } from '@angular/common'; import { ChangeDetectorRef, Component, ContentChildren, - EventEmitter, forwardRef, + EventEmitter, + forwardRef, Input, Output, QueryList, @@ -20,16 +22,15 @@ import { } from '@ng-dynamic-forms/core'; import { DsDynamicFormControlContainerComponent } from './ds-dynamic-form-control-container.component'; -import { NgForOf } from '@angular/common'; @Component({ selector: 'ds-dynamic-form', templateUrl: './ds-dynamic-form.component.html', imports: [ forwardRef(() => DsDynamicFormControlContainerComponent), - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class DsDynamicFormComponent extends DynamicFormComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts index 606a3f058f..03ca4b26cf 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service.ts @@ -31,7 +31,7 @@ import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-cons * Service to manage type binding for submission input fields * Any form component with the typeBindRelations DynamicFormControlRelation property can be controlled this way */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class DsDynamicTypeBindRelationService { constructor(@Optional() @Inject(DYNAMIC_MATCHERS) private dynamicMatchers: DynamicFormControlMatcher[], diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts index 7b22978ba3..bedaacf883 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts @@ -4,6 +4,7 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateLoader, @@ -14,18 +15,15 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model'; import { SubmissionService } from '../../../../../submission/submission.service'; +import { getMockThemeService } from '../../../../mocks/theme-service.mock'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; +import { ItemSearchResultListElementComponent } from '../../../../object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; import { SelectableListService } from '../../../../object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; -import { SubmissionServiceStub } from '../../../../testing/submission-service.stub'; -import { getMockThemeService } from '../../../../mocks/theme-service.mock'; -import { ThemeService } from '../../../../theme-support/theme.service'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../../../testing/active-router.stub'; -import { - ItemSearchResultListElementComponent -} from '../../../../object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { SubmissionServiceStub } from '../../../../testing/submission-service.stub'; import { TranslateLoaderMock } from '../../../../testing/translate-loader.mock'; +import { ThemeService } from '../../../../theme-support/theme.service'; import { RelationshipOptions } from '../../models/relationship-options.model'; import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship.actions'; import { @@ -86,26 +84,26 @@ describe('ExistingMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ExistingMetadataListElementComponent - ], - providers: [ + ExistingMetadataListElementComponent, + ], + providers: [ { provide: SelectableListService, useValue: selectionService }, { provide: Store, useValue: store }, { provide: SubmissionService, useValue: submissionServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(ExistingMetadataListElementComponent, { - remove: { imports: [ItemSearchResultListElementComponent]} + remove: { imports: [ItemSearchResultListElementComponent] }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts index 61ac267e38..41c2d55a10 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts @@ -1,4 +1,8 @@ /* eslint-disable max-classes-per-file */ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -11,6 +15,7 @@ import { import { UntypedFormControl } from '@angular/forms'; import { DynamicFormArrayGroupModel } from '@ng-dynamic-forms/core'; import { Store } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, @@ -30,26 +35,26 @@ import { getAllSucceededRemoteData, getRemoteDataPayload, } from '../../../../../core/shared/operators'; -import { SubmissionObjectEntry } from '../../../../../submission/objects/submission-objects.reducer'; -import { SubmissionService } from '../../../../../submission/submission.service'; +import { + SubmissionObjectEntry, + SubmissionObjectEntry, +} from '../../../../../submission/objects/submission-objects.reducer'; +import { + SubmissionService, + SubmissionService, +} from '../../../../../submission/submission.service'; import { hasValue, isNotEmpty, } from '../../../../empty.util'; +import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; +import { MetadataRepresentationLoaderComponent } from '../../../../metadata-representation/metadata-representation-loader.component'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; import { SelectableListService } from '../../../../object-list/selectable-list/selectable-list.service'; import { FormFieldMetadataValueObject } from '../../models/form-field-metadata-value.model'; import { RelationshipOptions } from '../../models/relationship-options.model'; import { DynamicConcatModel } from '../models/ds-dynamic-concat.model'; import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship.actions'; -import { SubmissionService } from '../../../../../submission/submission.service'; -import { SubmissionObjectEntry } from '../../../../../submission/objects/submission-objects.reducer'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; -import { - MetadataRepresentationLoaderComponent -} from '../../../../metadata-representation/metadata-representation-loader.component'; -import { TranslateModule } from '@ngx-translate/core'; /** * Abstract class that defines objects that can be reordered @@ -171,9 +176,9 @@ export class ReorderableRelationship extends Reorderable { ThemedLoadingComponent, AsyncPipe, MetadataRepresentationLoaderComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class ExistingMetadataListElementComponent implements OnInit, OnChanges, OnDestroy { @Input() listId: string; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts index 1d369715c0..0930fc9b49 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts @@ -5,19 +5,17 @@ import { waitForAsync, } from '@angular/core/testing'; import { Store } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { Item } from '../../../../../core/shared/item.model'; import { Relationship } from '../../../../../core/shared/item-relationships/relationship.model'; import { SubmissionService } from '../../../../../submission/submission.service'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { SelectableListService } from '../../../../object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; import { SubmissionServiceStub } from '../../../../testing/submission-service.stub'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { RelationshipOptions } from '../../models/relationship-options.model'; import { ReorderableRelationship } from '../existing-metadata-list-element/existing-metadata-list-element.component'; import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship.actions'; @@ -73,19 +71,19 @@ describe('ExistingRelationListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - ExistingRelationListElementComponent - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + ExistingRelationListElementComponent, + ], + providers: [ { provide: SelectableListService, useValue: selectionService }, { provide: Store, useValue: store }, { provide: SubmissionService, useClass: SubmissionServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(ExistingRelationListElementComponent, { - remove: { imports: [ListableObjectComponentLoaderComponent]} + remove: { imports: [ListableObjectComponentLoaderComponent] }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts index 86691ca98d..7523bafb00 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts @@ -1,4 +1,8 @@ /* eslint-disable max-classes-per-file */ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -28,16 +32,13 @@ import { hasValue, isNotEmpty, } from '../../../../empty.util'; +import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; +import { ListableObjectComponentLoaderComponent } from '../../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { SelectableListService } from '../../../../object-list/selectable-list/selectable-list.service'; import { RelationshipOptions } from '../../models/relationship-options.model'; import { ReorderableRelationship } from '../existing-metadata-list-element/existing-metadata-list-element.component'; import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship.actions'; -import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../object-collection/shared/listable-object/listable-object-component-loader.component'; /** * Abstract class that defines objects that can be reordered @@ -82,9 +83,9 @@ export abstract class Reorderable { ThemedLoadingComponent, AsyncPipe, ListableObjectComponentLoaderComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class ExistingRelationListElementComponent implements OnInit, OnChanges, OnDestroy { @Input() listId: string; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts index ed9475fe6c..4c45393c92 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts @@ -1,9 +1,26 @@ -import { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop'; -import { Component, EventEmitter, forwardRef, Input, +import { + CdkDrag, + CdkDragDrop, + CdkDragHandle, + CdkDropList, +} from '@angular/cdk/drag-drop'; +import { + NgClass, + NgForOf, + NgTemplateOutlet, +} from '@angular/common'; +import { + Component, + EventEmitter, + forwardRef, + Input, Output, QueryList, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; +import { + ReactiveFormsModule, + UntypedFormGroup, +} from '@angular/forms'; import { DynamicFormArrayComponent, DynamicFormControlCustomEvent, @@ -18,9 +35,8 @@ import { import { Relationship } from '../../../../../../core/shared/item-relationships/relationship.model'; import { hasValue } from '../../../../../empty.util'; -import { DynamicRowArrayModel } from '../ds-dynamic-row-array-model'; -import { NgClass, NgForOf, NgTemplateOutlet } from '@angular/common'; import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-control-container.component'; +import { DynamicRowArrayModel } from '../ds-dynamic-row-array-model'; @Component({ selector: 'ds-dynamic-form-array', @@ -36,7 +52,7 @@ import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-co forwardRef(() => DsDynamicFormControlContainerComponent), NgTemplateOutlet, ], - standalone: true + standalone: true, }) export class DsDynamicFormArrayComponent extends DynamicFormArrayComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts index bd3d2a659d..50fd0a6971 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts @@ -1,5 +1,7 @@ -import { DebugElement} from '@angular/core'; -import { DebugElement } from '@angular/core'; +import { + DebugElement, + DebugElement, +} from '@angular/core'; import { ComponentFixture, inject, @@ -33,14 +35,14 @@ describe('CustomSwitchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), ReactiveFormsModule, NoopAnimationsModule, DynamicFormsCoreModule.forRoot(), - CustomSwitchComponent - ] -}).compileComponents().then(() => { + CustomSwitchComponent, + ], + }).compileComponents().then(() => { fixture = TestBed.createComponent(CustomSwitchComponent); component = fixture.componentInstance; diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.ts index 560ef60f64..5a166a67ad 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.ts @@ -1,19 +1,22 @@ +import { NgClass } from '@angular/common'; import { Component, EventEmitter, Input, Output, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; +import { + ReactiveFormsModule, + UntypedFormGroup, +} from '@angular/forms'; import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; import { DynamicNGBootstrapCheckboxComponent } from '@ng-dynamic-forms/ui-ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { DynamicCustomSwitchModel } from './custom-switch.model'; -import { NgClass } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-custom-switch', @@ -22,9 +25,9 @@ import { TranslateModule } from '@ngx-translate/core'; imports: [ NgClass, ReactiveFormsModule, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Component displaying a custom switch usable in dynamic forms diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.spec.ts index 8cdc5959a3..c3b488ef76 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.spec.ts @@ -34,14 +34,14 @@ describe('DsDatePickerInlineComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ ReactiveFormsModule, NoopAnimationsModule, NgbDatepickerModule, DynamicFormsCoreModule.forRoot(), - DsDatePickerInlineComponent - ] -}).compileComponents().then(() => { + DsDatePickerInlineComponent, + ], + }).compileComponents().then(() => { fixture = TestBed.createComponent(DsDatePickerInlineComponent); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts index 6b7276bdf8..24444f506d 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts @@ -1,17 +1,30 @@ -import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; -import { NgbDatepicker, NgbDatepickerConfig, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component, + Component, + EventEmitter, EventEmitter, Input, + Input, + Output, Output, ViewChild, + ViewChild, } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { + ReactiveFormsModule, + UntypedFormGroup, + UntypedFormGroup, +} from '@angular/forms'; import { + NgbDatepicker, NgbDatepicker, NgbDatepickerConfig, + NgbDatepickerConfig, + NgbDatepickerModule, } from '@ng-bootstrap/ng-bootstrap'; import { DynamicDatePickerModel, @@ -20,7 +33,6 @@ import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; -import { NgClass, NgIf } from '@angular/common'; @Component({ selector: 'ds-dynamic-date-picker-inline', @@ -29,9 +41,9 @@ import { NgClass, NgIf } from '@angular/common'; NgClass, NgbDatepickerModule, ReactiveFormsModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class DsDatePickerInlineComponent extends DynamicFormControlComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts index b262e91e60..1749821458 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts @@ -1,6 +1,10 @@ // Load the implementations that should be tested import { - ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, Renderer2, + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + EventEmitter, + Renderer2, } from '@angular/core'; import { ComponentFixture, @@ -14,21 +18,22 @@ import { UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; +import { TranslateService } from '@ngx-translate/core'; +import { of as observableOf } from 'rxjs'; import { mockDynamicFormLayoutService, mockDynamicFormValidationService, } from '../../../../../testing/dynamic-form-mock-services'; -import { By } from '@angular/platform-browser'; -import { TranslateService } from '@ngx-translate/core'; -import { of as observableOf } from 'rxjs'; - import { createTestComponent } from '../../../../../testing/utils.test'; import { DsDatePickerComponent } from './date-picker.component'; import { DynamicDsDatePickerModel } from './date-picker.model'; @@ -70,16 +75,16 @@ describe('DsDatePickerComponent test suite', () => { get: () => observableOf('test-message'), onLangChange: new EventEmitter(), onTranslationChange: new EventEmitter(), - onDefaultLangChange: new EventEmitter() + onDefaultLangChange: new EventEmitter(), }; TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, DsDatePickerComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, DsDatePickerComponent, { provide: TranslateService, useValue: translateServiceStub }, @@ -367,10 +372,10 @@ describe('DsDatePickerComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [NgbModule], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts index 4e33915589..f96b71b0ae 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts @@ -1,31 +1,48 @@ -import { FormsModule, UntypedFormGroup } from '@angular/forms'; -import { Component, EventEmitter, HostListener, Inject, Input, OnInit, Output, Renderer2 } from '@angular/core'; -import { DynamicDsDatePickerModel } from './date-picker.model'; -import { hasValue } from '../../../../../empty.util'; -import { DOCUMENT } from '@angular/common'; +import { + DOCUMENT, + DOCUMENT, + NgClass, + NgIf, +} from '@angular/common'; import { Component, + Component, + EventEmitter, EventEmitter, HostListener, + HostListener, + Inject, Inject, Input, + Input, + OnInit, OnInit, Output, + Output, + Renderer2, Renderer2, } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { + FormsModule, + UntypedFormGroup, + UntypedFormGroup, +} from '@angular/forms'; import { DynamicFormControlComponent, DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; -import { NgClass, NgIf } from '@angular/common'; -import { NumberPickerComponent } from '../../../../number-picker/number-picker.component'; -import { DOCUMENT } from '@angular/common'; import isEqual from 'lodash/isEqual'; -import { hasValue } from '../../../../../empty.util'; -import { DynamicDsDatePickerModel } from './date-picker.model'; +import { + hasValue, + hasValue, +} from '../../../../../empty.util'; +import { NumberPickerComponent } from '../../../../number-picker/number-picker.component'; +import { + DynamicDsDatePickerModel, + DynamicDsDatePickerModel, +} from './date-picker.model'; export type DatePickerFieldType = '_year' | '_month' | '_day'; @@ -39,9 +56,9 @@ export const DS_DATE_PICKER_SEPARATOR = '-'; NgClass, NgIf, NumberPickerComponent, - FormsModule + FormsModule, ], - standalone: true + standalone: true, }) export class DsDatePickerComponent extends DynamicFormControlComponent implements OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.spec.ts index 47e5456b1d..9e1a70090b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.spec.ts @@ -52,13 +52,13 @@ describe('DsDynamicDisabledComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [FormsModule, TranslateModule.forRoot(), DsDynamicDisabledComponent], - providers: [ + imports: [FormsModule, TranslateModule.forRoot(), DsDynamicDisabledComponent], + providers: [ { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts index 49ef9a2c9a..1d8a152df5 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts @@ -10,9 +10,9 @@ import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import { DynamicDisabledModel } from './dynamic-disabled.model'; -import { TranslateModule } from '@ngx-translate/core'; /** * Component representing a simple disabled input field @@ -21,9 +21,9 @@ import { TranslateModule } from '@ngx-translate/core'; selector: 'ds-dynamic-disabled', templateUrl: './dynamic-disabled.component.html', imports: [ - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Component for displaying a form input with a disabled property diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts index ccd7f7befb..dee7df289b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts @@ -1,8 +1,20 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, forwardRef, Input, +import { + NgClass, + NgForOf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + forwardRef, + Input, Output, QueryList, } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; +import { + ReactiveFormsModule, + UntypedFormGroup, +} from '@angular/forms'; import { DynamicFormControlComponent, DynamicFormControlCustomEvent, @@ -15,7 +27,7 @@ import { DynamicFormValidationService, DynamicTemplateDirective, } from '@ng-dynamic-forms/core'; -import { NgClass, NgForOf } from '@angular/common'; + import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-control-container.component'; @Component({ @@ -28,7 +40,7 @@ import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-co NgForOf, forwardRef(() => DsDynamicFormControlContainerComponent), ], - standalone: true + standalone: true, }) export class DsDynamicFormGroupComponent extends DynamicFormControlComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts index 2e3314064e..182b85ad50 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts @@ -25,16 +25,16 @@ import { } from '@ng-dynamic-forms/core'; import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap'; +import { ConfigurationDataService } from '../../../../../../core/data/configuration-data.service'; +import { ConfigurationProperty } from '../../../../../../core/shared/configuration-property.model'; import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyOptions } from '../../../../../../core/submission/vocabularies/models/vocabulary-options.model'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; +import { createSuccessfulRemoteDataObject$ } from '../../../../../remote-data.utils'; import { mockDynamicFormLayoutService, mockDynamicFormValidationService, } from '../../../../../testing/dynamic-form-mock-services'; -import { ConfigurationDataService } from '../../../../../../core/data/configuration-data.service'; -import { createSuccessfulRemoteDataObject$ } from '../../../../../remote-data.utils'; -import { ConfigurationProperty } from '../../../../../../core/shared/configuration-property.model'; import { createTestComponent } from '../../../../../testing/utils.test'; import { VocabularyServiceStub } from '../../../../../testing/vocabulary-service.stub'; import { FormBuilderService } from '../../../form-builder.service'; @@ -93,25 +93,25 @@ describe('DsDynamicListComponent test suite', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); // waitForAsync beforeEach beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, ReactiveFormsModule, NgbModule, DsDynamicListComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, DsDynamicListComponent, DynamicFormValidationService, @@ -119,10 +119,10 @@ describe('DsDynamicListComponent test suite', () => { { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - { provide: ConfigurationDataService, useValue: configurationDataService } - ], + { provide: ConfigurationDataService, useValue: configurationDataService }, + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -309,10 +309,10 @@ describe('DsDynamicListComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [DsDynamicListComponent] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DsDynamicListComponent], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts index b76fba7526..7ae73c695e 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts @@ -1,19 +1,34 @@ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormGroup, ValidatorFn, ValidationErrors, AbstractControl, ReactiveFormsModule } from '@angular/forms'; +import { + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, + ChangeDetectorRef, + Component, Component, EventEmitter, + EventEmitter, + Input, Input, OnInit, + OnInit, + Output, Output, } from '@angular/core'; import { AbstractControl, + AbstractControl, + ReactiveFormsModule, + UntypedFormGroup, UntypedFormGroup, ValidationErrors, + ValidationErrors, + ValidatorFn, ValidatorFn, } from '@angular/forms'; +import { NgbButtonsModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicCheckboxModel, DynamicFormControlComponent, @@ -22,11 +37,26 @@ import { } from '@ng-dynamic-forms/core'; import findKey from 'lodash/findKey'; -import { PaginatedList } from '../../../../../../core/data/paginated-list.model'; -import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators'; -import { PageInfo } from '../../../../../../core/shared/page-info.model'; -import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; -import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; +import { + PaginatedList, + PaginatedList, +} from '../../../../../../core/data/paginated-list.model'; +import { + getFirstSucceededRemoteDataPayload, + getFirstSucceededRemoteDataPayload, +} from '../../../../../../core/shared/operators'; +import { + PageInfo, + PageInfo, +} from '../../../../../../core/shared/page-info.model'; +import { + VocabularyEntry, + VocabularyEntry, +} from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; +import { + VocabularyService, + VocabularyService, +} from '../../../../../../core/submission/vocabularies/vocabulary.service'; import { hasValue, isNotEmpty, @@ -34,13 +64,6 @@ import { import { FormBuilderService } from '../../../form-builder.service'; import { DynamicListCheckboxGroupModel } from './dynamic-list-checkbox-group.model'; import { DynamicListRadioGroupModel } from './dynamic-list-radio-group.model'; -import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; -import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators'; -import { PaginatedList } from '../../../../../../core/data/paginated-list.model'; -import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; -import { PageInfo } from '../../../../../../core/shared/page-info.model'; -import { NgClass, NgForOf, NgIf } from '@angular/common'; -import { NgbButtonsModule } from '@ng-bootstrap/ng-bootstrap'; export interface ListItem { id: string; @@ -61,9 +84,9 @@ export interface ListItem { NgIf, NgbButtonsModule, NgForOf, - ReactiveFormsModule + ReactiveFormsModule, ], - standalone: true + standalone: true, }) export class DsDynamicListComponent extends DynamicFormControlComponent implements OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts index f425f7b07f..24122373df 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts @@ -162,7 +162,7 @@ describe('Dynamic Lookup component', () => { beforeEach(waitForAsync(() => { vocabularyServiceStub = new VocabularyServiceStub(); TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, @@ -173,17 +173,17 @@ describe('Dynamic Lookup component', () => { DsDynamicLookupComponent, TestComponent, AuthorityConfidenceStateDirective, - ObjNgFor - ], - providers: [ + ObjNgFor, + ], + providers: [ ChangeDetectorRef, DsDynamicLookupComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); beforeEach(() => { @@ -579,15 +579,15 @@ describe('Dynamic Lookup component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - FormsModule, - InfiniteScrollModule, - ReactiveFormsModule, - NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + FormsModule, + InfiniteScrollModule, + ReactiveFormsModule, + NgbModule], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts index 2d60296d4b..7e4bc3a002 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts @@ -1,3 +1,9 @@ +import { + NgClass, + NgForOf, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,12 +13,21 @@ import { OnInit, Output, } from '@angular/core'; -import { FormsModule, UntypedFormGroup } from '@angular/forms'; -import { NgbDropdown, NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + FormsModule, + UntypedFormGroup, +} from '@angular/forms'; +import { + NgbDropdown, + NgbDropdownModule, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { of as observableOf, Subscription, @@ -36,13 +51,10 @@ import { isEmpty, isNotEmpty, } from '../../../../../empty.util'; +import { ObjNgFor } from '../../../../../utils/object-ngfor.pipe'; +import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive'; -import { NgClass, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { ObjNgFor } from '../../../../../utils/object-ngfor.pipe'; import { DynamicLookupNameModel } from './dynamic-lookup-name.model'; /** @@ -63,9 +75,9 @@ import { DynamicLookupNameModel } from './dynamic-lookup-name.model'; InfiniteScrollModule, NgForOf, NgTemplateOutlet, - ObjNgFor + ObjNgFor, ], - standalone: true + standalone: true, }) export class DsDynamicLookupComponent extends DsDynamicVocabularyComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts index 9fd8101450..8cdb1d6718 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts @@ -148,7 +148,7 @@ describe('DsDynamicOneboxComponent test suite', () => { ); init(); TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, @@ -161,17 +161,17 @@ describe('DsDynamicOneboxComponent test suite', () => { AuthorityConfidenceStateDirective, ObjNgFor, VocabularyTreeviewComponent, - ], - providers: [ + ], + providers: [ ChangeDetectorRef, DsDynamicOneboxComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, { provide: NgbModal, useValue: modal }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); }); @@ -471,15 +471,15 @@ describe('DsDynamicOneboxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - FormsModule, - NgbModule, - ReactiveFormsModule, - CdkTreeModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + FormsModule, + NgbModule, + ReactiveFormsModule, + CdkTreeModule], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts index 6a06d6e023..a2be80c4b8 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgForOf, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,21 +13,34 @@ import { Output, ViewChild, } from '@angular/core'; -import { FormsModule, UntypedFormGroup } from '@angular/forms'; +import { + FormsModule, + UntypedFormGroup, +} from '@angular/forms'; import { NgbModal, + NgbModal, + NgbModalRef, NgbModalRef, NgbTypeahead, + NgbTypeahead, + NgbTypeaheadModule, + NgbTypeaheadSelectItemEvent, NgbTypeaheadSelectItemEvent, } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, + Observable, + of as observableOf, of as observableOf, Subject, + Subject, + Subscription, Subscription, } from 'rxjs'; import { @@ -35,14 +54,6 @@ import { take, tap, } from 'rxjs/operators'; -import { Observable, of as observableOf, Subject, Subscription } from 'rxjs'; -import { - NgbModal, - NgbModalRef, - NgbTypeahead, - NgbTypeaheadModule, - NgbTypeaheadSelectItemEvent -} from '@ng-bootstrap/ng-bootstrap'; import { buildPaginatedList, @@ -61,11 +72,9 @@ import { isNotEmpty, isNotNull, } from '../../../../../empty.util'; -import { VocabularyTreeviewModalComponent } from '../../../../vocabulary-treeview-modal/vocabulary-treeview-modal.component'; -import { AsyncPipe, NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; -import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive'; -import { TranslateModule } from '@ngx-translate/core'; import { ObjNgFor } from '../../../../../utils/object-ngfor.pipe'; +import { AuthorityConfidenceStateDirective } from '../../../../directives/authority-confidence-state.directive'; +import { VocabularyTreeviewModalComponent } from '../../../../vocabulary-treeview-modal/vocabulary-treeview-modal.component'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; import { DynamicOneboxModel } from './dynamic-onebox.model'; @@ -87,9 +96,9 @@ import { DynamicOneboxModel } from './dynamic-onebox.model'; TranslateModule, ObjNgFor, NgForOf, - FormsModule + FormsModule, ], - standalone: true + standalone: true, }) export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent implements OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts index 8a99f9165c..81ac8c9f8a 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts @@ -1,65 +1,86 @@ // Load the implementations that should be tested -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { + ChangeDetectorRef, ChangeDetectorRef, Component, + Component, + CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core'; import { ComponentFixture, + ComponentFixture, + inject, inject, TestBed, + TestBed, + waitForAsync, waitForAsync, } from '@angular/core/testing'; import { FormsModule, + FormsModule, + ReactiveFormsModule, ReactiveFormsModule, UntypedFormControl, + UntypedFormControl, + UntypedFormGroup, UntypedFormGroup, } from '@angular/forms'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; - -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModule, + NgbModule, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, + DynamicFormLayoutService, + DynamicFormValidationService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; -import { - Store, - StoreModule, -} from '@ngrx/store'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { NgbModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, + APP_DYNAMIC_FORM_CONTROL_FN, +} from 'src/config/app-config.interface'; +import { environment } from 'src/environments/environment.test'; -import { storeModuleConfig } from '../../../../../../app.reducer'; -import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model'; +import { + FormRowModel, + FormRowModel, +} from '../../../../../../core/config/models/config-submission-form.model'; import { SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model'; -import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; -import { StoreMock } from '../../../../../testing/store.mock'; -import { createTestComponent } from '../../../../../testing/utils.test'; -import { VocabularyServiceStub } from '../../../../../testing/vocabulary-service.stub'; +import { SubmissionObjectDataService } from '../../../../../../core/submission/submission-object-data.service'; +import { + VocabularyService, + VocabularyService, +} from '../../../../../../core/submission/vocabularies/vocabulary.service'; +import { SubmissionService } from '../../../../../../submission/submission.service'; +import { + createTestComponent, + createTestComponent, +} from '../../../../../testing/utils.test'; +import { + VocabularyServiceStub, + VocabularyServiceStub, +} from '../../../../../testing/vocabulary-service.stub'; import { Chips } from '../../../../chips/models/chips.model'; import { FormComponent } from '../../../../form.component'; import { FormService } from '../../../../form.service'; import { FormBuilderService } from '../../../form-builder.service'; import { FormFieldModel } from '../../../models/form-field.model'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; -import { DsDynamicInputModel } from '../ds-dynamic-input.model'; -import { createTestComponent } from '../../../../../testing/utils.test'; -import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; -import { VocabularyServiceStub } from '../../../../../testing/vocabulary-service.stub'; -import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model'; -import { DsDynamicTypeBindRelationService } from '../../ds-dynamic-type-bind-relation.service'; -import { SubmissionObjectDataService } from '../../../../../../core/submission/submission-object-data.service'; -import { SubmissionService } from '../../../../../../submission/submission.service'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP, APP_DYNAMIC_FORM_CONTROL_FN } from 'src/config/app-config.interface'; -import { environment } from 'src/environments/environment.test'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { provideMockStore } from '@ngrx/store/testing'; import { dsDynamicFormControlMapFn } from '../../ds-dynamic-form-control-map-fn'; +import { DsDynamicTypeBindRelationService } from '../../ds-dynamic-type-bind-relation.service'; +import { DsDynamicInputModel } from '../ds-dynamic-input.model'; import { DsDynamicRelationGroupComponent } from './dynamic-relation-group.components'; import { DynamicRelationGroupModel, @@ -84,7 +105,7 @@ const initialState: any = { 'json/patch': {}, 'metaTag': {}, 'route': {}, - } + }, }; function init() { FORM_GROUP_TEST_MODEL_CONFIG = { @@ -162,7 +183,7 @@ describe('DsDynamicRelationGroupComponent test suite', () => { vocabularyServiceStub = new VocabularyServiceStub(); /* TODO make sure these files use mocks instead of real services/components https://github.com/DSpace/dspace-angular/issues/281 */ TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserAnimationsModule, FormsModule, ReactiveFormsModule, @@ -171,8 +192,8 @@ describe('DsDynamicRelationGroupComponent test suite', () => { FormComponent, DsDynamicRelationGroupComponent, TestComponent, - ], - providers: [ + ], + providers: [ ChangeDetectorRef, DsDynamicRelationGroupComponent, DynamicFormValidationService, @@ -180,18 +201,18 @@ describe('DsDynamicRelationGroupComponent test suite', () => { FormBuilderService, FormComponent, FormService, - provideMockStore({initialState}), + provideMockStore({ initialState }), { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DsDynamicTypeBindRelationService, useClass: DsDynamicTypeBindRelationService }, - { provide: SubmissionObjectDataService, useValue: {}}, - { provide: SubmissionService, useValue: {}}, + { provide: SubmissionObjectDataService, useValue: {} }, + { provide: SubmissionService, useValue: {} }, { provide: APP_CONFIG, useValue: environment }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, { provide: APP_DYNAMIC_FORM_CONTROL_FN, useValue: dsDynamicFormControlMapFn }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) - .compileComponents(); + .compileComponents(); })); @@ -372,17 +393,17 @@ describe('DsDynamicRelationGroupComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [ - DsDynamicRelationGroupComponent, - NgIf, - AsyncPipe, - NgbTooltipModule, - TranslateModule, - NgClass, - ] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [ + DsDynamicRelationGroupComponent, + NgIf, + AsyncPipe, + NgbTooltipModule, + TranslateModule, + NgClass, + ], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts index bed63a74b4..e6f5e41888 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,10 +12,10 @@ import { OnDestroy, OnInit, Output, - ViewChild -, + ViewChild, } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormControlComponent, DynamicFormControlModel, @@ -19,6 +24,7 @@ import { DynamicFormValidationService, DynamicInputModel, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import isEqual from 'lodash/isEqual'; import isObject from 'lodash/isObject'; import { @@ -46,7 +52,9 @@ import { isNotEmpty, isNotNull, } from '../../../../../empty.util'; +import { ThemedLoadingComponent } from '../../../../../loading/themed-loading.component'; import { hasOnlyEmptyProperties } from '../../../../../object.util'; +import { ChipsComponent } from '../../../../chips/chips.component'; import { Chips } from '../../../../chips/models/chips.model'; import { ChipsItem } from '../../../../chips/models/chips-item.model'; import { FormComponent } from '../../../../form.component'; @@ -55,11 +63,6 @@ import { FormBuilderService } from '../../../form-builder.service'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; import { PLACEHOLDER_PARENT_METADATA } from '../../ds-dynamic-form-constants'; import { DynamicRelationGroupModel } from './dynamic-relation-group.model'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../loading/themed-loading.component'; -import { ChipsComponent } from '../../../../chips/chips.component'; /** * Component representing a group input field @@ -79,7 +82,7 @@ import { ChipsComponent } from '../../../../chips/chips.component'; ChipsComponent, forwardRef(() => FormComponent), ], - standalone: true + standalone: true, }) export class DsDynamicRelationGroupComponent extends DynamicFormControlComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts index 29b98a01c0..14a8aeaecb 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts @@ -84,7 +84,7 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, @@ -93,17 +93,17 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { NgbModule, TranslateModule.forRoot(), DsDynamicScrollableDropdownComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, DsDynamicScrollableDropdownComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -236,15 +236,15 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - FormsModule, - InfiniteScrollModule, - ReactiveFormsModule, - NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + FormsModule, + InfiniteScrollModule, + ReactiveFormsModule, + NgbModule], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts index 1d2f4d20b4..9a05d7fda7 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts @@ -28,30 +28,36 @@ import { DynamicFormValidationService, } from '@ng-dynamic-forms/core'; import { DynamicFormsNGBootstrapUIModule } from '@ng-dynamic-forms/ui-ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; +import { + VocabularyEntry, + VocabularyEntry, +} from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyOptions } from '../../../../../../core/submission/vocabularies/models/vocabulary-options.model'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; import { mockDynamicFormLayoutService, + mockDynamicFormLayoutService, + mockDynamicFormValidationService, mockDynamicFormValidationService, } from '../../../../../testing/dynamic-form-mock-services'; -import { createTestComponent } from '../../../../../testing/utils.test'; +import { + createTestComponent, + createTestComponent, +} from '../../../../../testing/utils.test'; import { VocabularyServiceStub } from '../../../../../testing/vocabulary-service.stub'; -import { Chips } from '../../../../chips/models/chips.model'; -import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; +import { + Chips, + Chips, +} from '../../../../chips/models/chips.model'; +import { + FormFieldMetadataValueObject, + FormFieldMetadataValueObject, +} from '../../../models/form-field-metadata-value.model'; import { DsDynamicTagComponent } from './dynamic-tag.component'; import { DynamicTagModel } from './dynamic-tag.model'; -import { Chips } from '../../../../chips/models/chips.model'; -import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; -import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; -import { createTestComponent } from '../../../../../testing/utils.test'; -import { - mockDynamicFormLayoutService, - mockDynamicFormValidationService -} from '../../../../../testing/dynamic-form-mock-services'; -import { TranslateModule } from '@ngx-translate/core'; function createKeyUpEvent(key: number) { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ @@ -106,7 +112,7 @@ describe('DsDynamicTagComponent test suite', () => { const vocabularyServiceStub = new VocabularyServiceStub(); init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, @@ -114,17 +120,17 @@ describe('DsDynamicTagComponent test suite', () => { NgbModule, ReactiveFormsModule, DsDynamicTagComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, DsDynamicTagComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -316,14 +322,14 @@ describe('DsDynamicTagComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - FormsModule, - NgbModule, - ReactiveFormsModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + FormsModule, + NgbModule, + ReactiveFormsModule], }) class TestComponent { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts index 59daa9351d..06565dd8a6 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts @@ -1,40 +1,59 @@ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { FormsModule, UntypedFormGroup } from '@angular/forms'; - -import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; -import { Observable, of as observableOf } from 'rxjs'; -import { catchError, debounceTime, distinctUntilChanged, map, merge, switchMap, tap } from 'rxjs/operators'; -import { NgbTypeahead, NgbTypeaheadModule, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf } from '@angular/common'; import { ChangeDetectorRef, + ChangeDetectorRef, + Component, Component, EventEmitter, + EventEmitter, + Input, Input, OnInit, + OnInit, + Output, Output, ViewChild, + ViewChild, } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { + FormsModule, + UntypedFormGroup, + UntypedFormGroup, +} from '@angular/forms'; import { NgbTypeahead, + NgbTypeahead, + NgbTypeaheadModule, + NgbTypeaheadSelectItemEvent, NgbTypeaheadSelectItemEvent, } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, + DynamicFormLayoutService, + DynamicFormValidationService, DynamicFormValidationService, } from '@ng-dynamic-forms/core'; import isEqual from 'lodash/isEqual'; import { Observable, + Observable, + of as observableOf, of as observableOf, } from 'rxjs'; import { catchError, + catchError, + debounceTime, debounceTime, distinctUntilChanged, + distinctUntilChanged, + map, map, merge, + merge, switchMap, + switchMap, + tap, tap, } from 'rxjs/operators'; @@ -51,10 +70,9 @@ import { hasValue, isNotEmpty, } from '../../../../../empty.util'; +import { ChipsComponent } from '../../../../chips/chips.component'; import { Chips } from '../../../../chips/models/chips.model'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; -import { NgIf } from '@angular/common'; -import { ChipsComponent } from '../../../../chips/chips.component'; import { DynamicTagModel } from './dynamic-tag.model'; /** @@ -68,9 +86,9 @@ import { DynamicTagModel } from './dynamic-tag.model'; NgbTypeaheadModule, FormsModule, NgIf, - ChipsComponent + ChipsComponent, ], - standalone: true + standalone: true, }) export class DsDynamicTagComponent extends DsDynamicVocabularyComponent implements OnInit { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts index a69f1740be..4995b36f11 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts @@ -15,12 +15,14 @@ import { NgbModule, } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf, Subscription, } from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../../../../config/app-config.interface'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { ExternalSourceDataService } from '../../../../../core/data/external-source-data.service'; import { LookupRelationService } from '../../../../../core/data/lookup-relation.service'; @@ -42,8 +44,6 @@ import { AddRelationshipAction, RemoveRelationshipAction, } from './relationship.actions'; -import { provideMockStore } from '@ngrx/store/testing'; -import { APP_DATA_SERVICES_MAP } from '../../../../../../config/app-config.interface'; describe('DsDynamicLookupRelationModalComponent', () => { let component: DsDynamicLookupRelationModalComponent; @@ -123,10 +123,10 @@ describe('DsDynamicLookupRelationModalComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, DsDynamicLookupRelationModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, DsDynamicLookupRelationModalComponent], + providers: [ { - provide: SearchConfigurationService, useValue: { + provide: SearchConfigurationService, useValue: { paginatedSearchOptions: observableOf(pSearchOptions), }, }, @@ -141,19 +141,19 @@ describe('DsDynamicLookupRelationModalComponent', () => { { provide: RelationshipTypeDataService, useValue: {} }, { provide: RemoteDataBuildService, useValue: rdbService }, { - provide: Store, useValue: { - // eslint-disable-next-line no-empty, @typescript-eslint/no-empty-function - dispatch: () => { + provide: Store, useValue: { + // eslint-disable-next-line no-empty, @typescript-eslint/no-empty-function + dispatch: () => { }, }, }, { provide: NgZone, useValue: new NgZone({}) }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, NgbActiveModal, - provideMockStore() - ], + provideMockStore(), + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts index d6217d4867..423c714ec3 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts @@ -1,97 +1,142 @@ -import { Component, EventEmitter, NgZone, OnDestroy, OnInit, Output } from '@angular/core'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; -import { NgbActiveModal, NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import { hasValue, isNotEmpty } from '../../../../empty.util'; -import { map, skip, switchMap, take } from 'rxjs/operators'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; -import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component, + Component, + EventEmitter, EventEmitter, NgZone, + NgZone, + OnDestroy, OnDestroy, OnInit, + OnInit, + Output, Output, } from '@angular/core'; -import { Router } from '@angular/router'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { Store } from '@ngrx/store'; +import { + Router, + Router, +} from '@angular/router'; +import { + NgbActiveModal, + NgbActiveModal, + NgbNavModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + Store, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + combineLatest as observableCombineLatest, combineLatest as observableCombineLatest, Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { map, + map, + skip, skip, switchMap, + switchMap, + take, take, } from 'rxjs/operators'; -import { AppState } from '../../../../../app.reducer'; -import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; -import { RequestParam } from '../../../../../core/cache/models/request-param.model'; -import { ExternalSourceDataService } from '../../../../../core/data/external-source-data.service'; -import { FindListOptions } from '../../../../../core/data/find-list-options.model'; -import { LookupRelationService } from '../../../../../core/data/lookup-relation.service'; -import { PaginatedList } from '../../../../../core/data/paginated-list.model'; -import { RelationshipDataService } from '../../../../../core/data/relationship-data.service'; -import { RelationshipTypeDataService } from '../../../../../core/data/relationship-type-data.service'; -import { Context } from '../../../../../core/shared/context.model'; -import { ExternalSource } from '../../../../../core/shared/external-source.model'; +import { + AppState, + AppState, +} from '../../../../../app.reducer'; +import { + RemoteDataBuildService, + RemoteDataBuildService, +} from '../../../../../core/cache/builders/remote-data-build.service'; +import { + RequestParam, + RequestParam, +} from '../../../../../core/cache/models/request-param.model'; +import { + ExternalSourceDataService, + ExternalSourceDataService, +} from '../../../../../core/data/external-source-data.service'; +import { + FindListOptions, + FindListOptions, +} from '../../../../../core/data/find-list-options.model'; +import { + LookupRelationService, + LookupRelationService, +} from '../../../../../core/data/lookup-relation.service'; +import { + PaginatedList, + PaginatedList, +} from '../../../../../core/data/paginated-list.model'; +import { + RelationshipDataService, + RelationshipDataService, +} from '../../../../../core/data/relationship-data.service'; +import { + RelationshipTypeDataService, + RelationshipTypeDataService, +} from '../../../../../core/data/relationship-type-data.service'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; +import { + ExternalSource, + ExternalSource, +} from '../../../../../core/shared/external-source.model'; import { Item } from '../../../../../core/shared/item.model'; -import { RelationshipType } from '../../../../../core/shared/item-relationships/relationship-type.model'; +import { + RelationshipType, + RelationshipType, +} from '../../../../../core/shared/item-relationships/relationship-type.model'; import { getAllSucceededRemoteDataPayload, + getAllSucceededRemoteDataPayload, + getFirstSucceededRemoteDataPayload, getFirstSucceededRemoteDataPayload, } from '../../../../../core/shared/operators'; -import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../../empty.util'; +import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; import { ListableObject } from '../../../../object-collection/shared/listable-object.model'; import { SelectableListState } from '../../../../object-list/selectable-list/selectable-list.reducer'; import { SelectableListService } from '../../../../object-list/selectable-list/selectable-list.service'; import { SearchResult } from '../../../../search/models/search-result.model'; -import { followLink } from '../../../../utils/follow-link-config.model'; +import { + followLink, + followLink, +} from '../../../../utils/follow-link-config.model'; import { RelationshipOptions } from '../../models/relationship-options.model'; +import { ThemedDynamicLookupRelationExternalSourceTabComponent } from './external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component'; import { AddRelationshipAction, RemoveRelationshipAction, UpdateRelationshipNameVariantAction, } from './relationship.actions'; -import { RelationshipDataService } from '../../../../../core/data/relationship-data.service'; -import { RelationshipTypeDataService } from '../../../../../core/data/relationship-type-data.service'; -import { Store } from '@ngrx/store'; -import { AppState } from '../../../../../app.reducer'; -import { Context } from '../../../../../core/shared/context.model'; -import { LookupRelationService } from '../../../../../core/data/lookup-relation.service'; -import { ExternalSource } from '../../../../../core/shared/external-source.model'; -import { ExternalSourceDataService } from '../../../../../core/data/external-source-data.service'; -import { Router } from '@angular/router'; -import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; -import { getAllSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; -import { followLink } from '../../../../utils/follow-link-config.model'; -import { RelationshipType } from '../../../../../core/shared/item-relationships/relationship-type.model'; -import { - ThemedDynamicLookupRelationExternalSourceTabComponent -} from './external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../loading/themed-loading.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { - ThemedDynamicLookupRelationSearchTabComponent -} from './search-tab/themed-dynamic-lookup-relation-search-tab.component'; -import { - DsDynamicLookupRelationSelectionTabComponent -} from './selection-tab/dynamic-lookup-relation-selection-tab.component'; -import { FindListOptions } from '../../../../../core/data/find-list-options.model'; -import { RequestParam } from '../../../../../core/cache/models/request-param.model'; -import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; -import { PaginatedList } from '../../../../../core/data/paginated-list.model'; +import { ThemedDynamicLookupRelationSearchTabComponent } from './search-tab/themed-dynamic-lookup-relation-search-tab.component'; +import { DsDynamicLookupRelationSelectionTabComponent } from './selection-tab/dynamic-lookup-relation-selection-tab.component'; @Component({ selector: 'ds-dynamic-lookup-relation-modal', @@ -100,8 +145,8 @@ import { PaginatedList } from '../../../../../core/data/paginated-list.model'; providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], imports: [ ThemedDynamicLookupRelationExternalSourceTabComponent, @@ -112,9 +157,9 @@ import { PaginatedList } from '../../../../../core/data/paginated-list.model'; ThemedDynamicLookupRelationSearchTabComponent, AsyncPipe, NgForOf, - DsDynamicLookupRelationSelectionTabComponent + DsDynamicLookupRelationSelectionTabComponent, ], - standalone: true + standalone: true, }) /** diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts index fb21f4c0f0..18d273084a 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts @@ -1,5 +1,7 @@ import { EventEmitter, + EventEmitter, + NO_ERRORS_SCHEMA, NO_ERRORS_SCHEMA, } from '@angular/core'; import { @@ -9,16 +11,16 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; +import { + RouterTestingModule, + RouterTestingModule, +} from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { RouterTestingModule } from '@angular/router/testing'; -import { EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core'; -import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; -import { EMPTY, of as observableOf } from 'rxjs'; import { EMPTY, + EMPTY, + of as observableOf, of as observableOf, } from 'rxjs'; @@ -29,25 +31,31 @@ import { ExternalSource } from '../../../../../../core/shared/external-source.mo import { ExternalSourceEntry } from '../../../../../../core/shared/external-source-entry.model'; import { Item } from '../../../../../../core/shared/item.model'; import { ItemType } from '../../../../../../core/shared/item-relationships/item-type.model'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../../core/shared/search/search-configuration.service'; +import { ErrorComponent } from '../../../../../error/error.component'; +import { ThemedLoadingComponent } from '../../../../../loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../../object-collection/object-collection.component'; import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; +import { PageSizeSelectorComponent } from '../../../../../page-size-selector/page-size-selector.component'; import { createFailedRemoteDataObject$, createPendingRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../../../remote-data.utils'; -import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; +import { + PaginatedSearchOptions, + PaginatedSearchOptions, +} from '../../../../../search/models/paginated-search-options.model'; +import { ThemedSearchFormComponent } from '../../../../../search-form/themed-search-form.component'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; import { createPaginatedList } from '../../../../../testing/utils.test'; import { VarDirective } from '../../../../../utils/var.directive'; import { RelationshipOptions } from '../../../models/relationship-options.model'; import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-lookup-relation-external-source-tab.component'; import { ThemedExternalSourceEntryImportModalComponent } from './external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; -import { ThemedSearchFormComponent } from '../../../../../search-form/themed-search-form.component'; -import { PageSizeSelectorComponent } from '../../../../../page-size-selector/page-size-selector.component'; -import { ObjectCollectionComponent } from '../../../../../object-collection/object-collection.component'; -import { ErrorComponent } from '../../../../../error/error.component'; -import { ThemedLoadingComponent } from '../../../../../loading/themed-loading.component'; describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { let component: DsDynamicLookupRelationExternalSourceTabComponent; @@ -57,7 +65,7 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { let selectableListService; let modalService; - const itemType = Object.assign(new ItemType(), {label: 'Person'}); + const itemType = Object.assign(new ItemType(), { label: 'Person' }); const externalSource = { id: 'orcidV2', name: 'orcidV2', @@ -128,8 +136,8 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { paginatedSearchOptions: observableOf(pSearchOptions), }, }, - {provide: ExternalSourceDataService, useValue: externalSourceService}, - {provide: SelectableListService, useValue: selectableListService}, + { provide: ExternalSourceDataService, useValue: externalSourceService }, + { provide: SelectableListService, useValue: selectableListService }, { provide: PaginationService, useValue: new PaginationServiceStub() }, ], schemas: [NO_ERRORS_SCHEMA], @@ -141,9 +149,9 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { PageSizeSelectorComponent, ObjectCollectionComponent, ErrorComponent, - ThemedLoadingComponent - ] - } + ThemedLoadingComponent, + ], + }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts index e63bb364b0..56b39f3910 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts @@ -1,22 +1,35 @@ -import { Component, ComponentRef, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + ComponentRef, ComponentRef, EventEmitter, + EventEmitter, + Input, Input, OnDestroy, + OnDestroy, OnInit, + OnInit, + Output, Output, } from '@angular/core'; import { Router } from '@angular/router'; import { NgbModal, + NgbModal, + NgbModalRef, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, + Observable, + Subscription, Subscription, } from 'rxjs'; import { @@ -28,15 +41,34 @@ import { import { ExternalSourceDataService } from '../../../../../../core/data/external-source-data.service'; import { PaginatedList } from '../../../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../../../core/data/remote-data'; -import { PaginationService } from '../../../../../../core/pagination/pagination.service'; -import { Collection } from '../../../../../../core/shared/collection.model'; +import { + PaginationService, + PaginationService, +} from '../../../../../../core/pagination/pagination.service'; +import { + Collection, + Collection, +} from '../../../../../../core/shared/collection.model'; import { Context } from '../../../../../../core/shared/context.model'; import { ExternalSource } from '../../../../../../core/shared/external-source.model'; import { ExternalSourceEntry } from '../../../../../../core/shared/external-source-entry.model'; -import { Item } from '../../../../../../core/shared/item.model'; -import { ItemType } from '../../../../../../core/shared/item-relationships/item-type.model'; -import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { + Item, + Item, +} from '../../../../../../core/shared/item.model'; +import { + ItemType, + ItemType, +} from '../../../../../../core/shared/item-relationships/item-type.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../../../core/shared/operators'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component'; import { fadeIn, @@ -44,38 +76,32 @@ import { } from '../../../../../animations/fade'; import { hasValue, + hasValue, + hasValueOperator, hasValueOperator, } from '../../../../../empty.util'; -import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; -import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; -import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; -import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; -import { RelationshipOptions } from '../../../models/relationship-options.model'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { - ExternalSourceEntryImportModalComponent -} from './external-source-entry-import-modal/external-source-entry-import-modal.component'; -import { - ThemedExternalSourceEntryImportModalComponent -} from './external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; -import { hasValue, hasValueOperator } from '../../../../../empty.util'; -import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; -import { Item } from '../../../../../../core/shared/item.model'; -import { Collection } from '../../../../../../core/shared/collection.model'; -import { PaginationService } from '../../../../../../core/pagination/pagination.service'; -import { Observable, Subscription } from 'rxjs'; -import { ItemType } from '../../../../../../core/shared/item-relationships/item-type.model'; -import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators'; -import { ThemedSearchFormComponent } from '../../../../../search-form/themed-search-form.component'; -import { PageSizeSelectorComponent } from '../../../../../page-size-selector/page-size-selector.component'; -import { ObjectCollectionComponent } from '../../../../../object-collection/object-collection.component'; -import { VarDirective } from '../../../../../utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { ErrorComponent } from '../../../../../error/error.component'; import { ThemedLoadingComponent } from '../../../../../loading/themed-loading.component'; -import { ExternalSourceEntryImportModalComponent } from './external-source-entry-import-modal/external-source-entry-import-modal.component'; -import { ThemedExternalSourceEntryImportModalComponent } from './external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; +import { ObjectCollectionComponent } from '../../../../../object-collection/object-collection.component'; +import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; +import { + SelectableListService, + SelectableListService, +} from '../../../../../object-list/selectable-list/selectable-list.service'; +import { PageSizeSelectorComponent } from '../../../../../page-size-selector/page-size-selector.component'; +import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; +import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; +import { ThemedSearchFormComponent } from '../../../../../search-form/themed-search-form.component'; +import { VarDirective } from '../../../../../utils/var.directive'; +import { RelationshipOptions } from '../../../models/relationship-options.model'; +import { + ExternalSourceEntryImportModalComponent, + ExternalSourceEntryImportModalComponent, +} from './external-source-entry-import-modal/external-source-entry-import-modal.component'; +import { + ThemedExternalSourceEntryImportModalComponent, + ThemedExternalSourceEntryImportModalComponent, +} from './external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; @Component({ selector: 'ds-dynamic-lookup-relation-external-source-tab', @@ -89,7 +115,7 @@ import { ThemedExternalSourceEntryImportModalComponent } from './external-source ], animations: [ fadeIn, - fadeInOut + fadeInOut, ], imports: [ ThemedSearchFormComponent, @@ -100,9 +126,9 @@ import { ThemedExternalSourceEntryImportModalComponent } from './external-source TranslateModule, ErrorComponent, NgIf, - ThemedLoadingComponent + ThemedLoadingComponent, ], - standalone: true + standalone: true, }) /** * Component rendering the tab content of an external source during submission lookup diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.spec.ts index e4284daae8..c0090f36a3 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.spec.ts @@ -4,6 +4,7 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal, @@ -20,9 +21,8 @@ import { NotificationsService } from '../../../../../../notifications/notificati import { ItemSearchResult } from '../../../../../../object-collection/shared/item-search-result.model'; import { SelectableListService } from '../../../../../../object-list/selectable-list/selectable-list.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../../../remote-data.utils'; -import { createPaginatedList } from '../../../../../../testing/utils.test'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { SearchResultsComponent } from '../../../../../../search/search-results/search-results.component'; +import { createPaginatedList } from '../../../../../../testing/utils.test'; import { RelationshipOptions } from '../../../../models/relationship-options.model'; import { ExternalSourceEntryImportModalComponent, @@ -80,24 +80,24 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - NgbModule, - ExternalSourceEntryImportModalComponent, - NoopAnimationsModule - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + NgbModule, + ExternalSourceEntryImportModalComponent, + NoopAnimationsModule, + ], + providers: [ { provide: LookupRelationService, useValue: lookupRelationService }, { provide: SelectableListService, useValue: selectService }, { provide: NotificationsService, useValue: notificationsService }, { provide: ItemDataService, useValue: itemService }, { provide: NgbActiveModal, useValue: modalStub }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(ExternalSourceEntryImportModalComponent, { - remove: { imports: [SearchResultsComponent]} + remove: { imports: [SearchResultsComponent] }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts index f9304b70b3..7d2464f105 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -8,27 +12,27 @@ import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { switchMap, + switchMap, + take, take, } from 'rxjs/operators'; -import { ItemDataService } from '../../../../../../../core/data/item-data.service'; +import { + ItemDataService, + ItemDataService, +} from '../../../../../../../core/data/item-data.service'; import { LookupRelationService } from '../../../../../../../core/data/lookup-relation.service'; import { PaginatedList } from '../../../../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../../../../core/data/remote-data'; import { Context } from '../../../../../../../core/shared/context.model'; -import { SelectableListService } from '../../../../../../object-list/selectable-list/selectable-list.service'; -import { ListableObject } from '../../../../../../object-collection/shared/listable-object.model'; -import { ItemDataService } from '../../../../../../../core/data/item-data.service'; -import { PaginationComponentOptions } from '../../../../../../pagination/pagination-component-options.model'; -import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../../../../../../core/shared/operators'; -import { switchMap, take } from 'rxjs/operators'; -import { ItemSearchResult } from '../../../../../../object-collection/shared/item-search-result.model'; -import { NotificationsService } from '../../../../../../notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ExternalSourceEntry } from '../../../../../../../core/shared/external-source-entry.model'; import { Item } from '../../../../../../../core/shared/item.model'; import { ItemType } from '../../../../../../../core/shared/item-relationships/item-type.model'; @@ -36,21 +40,37 @@ import { MetadataValue } from '../../../../../../../core/shared/metadata.models' import { Metadata } from '../../../../../../../core/shared/metadata.utils'; import { getFirstSucceededRemoteData, + getFirstSucceededRemoteData, + getRemoteDataPayload, getRemoteDataPayload, } from '../../../../../../../core/shared/operators'; import { SubmissionImportExternalCollectionComponent } from '../../../../../../../submission/import-external/import-external-collection/submission-import-external-collection.component'; import { CollectionListEntry } from '../../../../../../collection-dropdown/collection-dropdown.component'; -import { NotificationsService } from '../../../../../../notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../../../../notifications/notifications.service'; import { CollectionElementLinkType } from '../../../../../../object-collection/collection-element-link.type'; -import { ItemSearchResult } from '../../../../../../object-collection/shared/item-search-result.model'; -import { ListableObject } from '../../../../../../object-collection/shared/listable-object.model'; -import { SelectableListService } from '../../../../../../object-list/selectable-list/selectable-list.service'; -import { PaginationComponentOptions } from '../../../../../../pagination/pagination-component-options.model'; +import { + ItemSearchResult, + ItemSearchResult, +} from '../../../../../../object-collection/shared/item-search-result.model'; +import { + ListableObject, + ListableObject, +} from '../../../../../../object-collection/shared/listable-object.model'; +import { + SelectableListService, + SelectableListService, +} from '../../../../../../object-list/selectable-list/selectable-list.service'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../../../../../pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../../../../../../search/models/paginated-search-options.model'; import { SearchResult } from '../../../../../../search/models/search-result.model'; -import { RelationshipOptions } from '../../../../models/relationship-options.model'; import { SearchResultsComponent } from '../../../../../../search/search-results/search-results.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { RelationshipOptions } from '../../../../models/relationship-options.model'; /** * The possible types of import for the external entry @@ -71,9 +91,9 @@ export enum ImportType { TranslateModule, SearchResultsComponent, NgIf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) /** * Component to display a modal window for importing an external source entry diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts index 62c38f62ab..f9d2137f9b 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component.ts @@ -4,10 +4,10 @@ import { ThemedComponent } from '../../../../../../theme-support/themed.componen import { ExternalSourceEntryImportModalComponent } from './external-source-entry-import-modal.component'; @Component({ - selector: 'ds-themed-external-source-entry-import-modal', - styleUrls: [], - templateUrl: '../../../../../../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-external-source-entry-import-modal', + styleUrls: [], + templateUrl: '../../../../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedExternalSourceEntryImportModalComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts index 2264d2bb58..0673bd41af 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component.ts @@ -15,10 +15,10 @@ import { RelationshipOptions } from '../../../models/relationship-options.model' import { DsDynamicLookupRelationExternalSourceTabComponent } from './dynamic-lookup-relation-external-source-tab.component'; @Component({ - selector: 'ds-themed-dynamic-lookup-relation-external-source-tab', - styleUrls: [], - templateUrl: '../../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-dynamic-lookup-relation-external-source-tab', + styleUrls: [], + templateUrl: '../../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedDynamicLookupRelationExternalSourceTabComponent extends ThemedComponent { protected inAndOutputNames: (keyof DsDynamicLookupRelationExternalSourceTabComponent & keyof this)[] = ['label', 'listId', diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts index c3e7a9bdb0..fdc1f6de01 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts @@ -21,12 +21,12 @@ import { SelectableListService } from '../../../../../object-list/selectable-lis import { createSuccessfulRemoteDataObject$ } from '../../../../../remote-data.utils'; import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; import { SearchObjects } from '../../../../../search/models/search-objects.model'; +import { ThemedSearchComponent } from '../../../../../search/themed-search.component'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; import { relatedRelationships } from '../../../../../testing/related-relationships.mock'; import { VarDirective } from '../../../../../utils/var.directive'; import { RelationshipOptions } from '../../../models/relationship-options.model'; import { DsDynamicLookupRelationSearchTabComponent } from './dynamic-lookup-relation-search-tab.component'; -import { ThemedSearchComponent } from '../../../../../search/themed-search.component'; describe('DsDynamicLookupRelationSearchTabComponent', () => { @@ -98,27 +98,27 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsDynamicLookupRelationSearchTabComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsDynamicLookupRelationSearchTabComponent, VarDirective], + providers: [ { provide: SearchService, useValue: { search: () => createSuccessfulRemoteDataObject$(results) } }, { provide: SelectableListService, useValue: selectableListService, }, { - provide: SearchConfigurationService, useValue: { + provide: SearchConfigurationService, useValue: { paginatedSearchOptions: observableOf(pSearchOptions), }, }, { provide: LookupRelationService, useValue: lookupRelationService }, { provide: PaginationService, useValue: new PaginationServiceStub() }, { provide: RelationshipDataService, useValue: relationshipService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .overrideComponent(DsDynamicLookupRelationSearchTabComponent, { remove: { - imports: [ThemedSearchComponent] - } + imports: [ThemedSearchComponent], + }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index 363267cad6..9fbb1686ff 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -1,16 +1,27 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + EventEmitter, EventEmitter, Input, + Input, + OnDestroy, OnDestroy, OnInit, + OnInit, + Output, Output, } from '@angular/core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, + BehaviorSubject, + Observable, Observable, } from 'rxjs'; import { @@ -22,18 +33,15 @@ import { } from 'rxjs/operators'; import { LookupRelationService } from '../../../../../../core/data/lookup-relation.service'; -import { PaginatedList } from '../../../../../../core/data/paginated-list.model'; +import { + PaginatedList, + PaginatedList, +} from '../../../../../../core/data/paginated-list.model'; import { RelationshipDataService } from '../../../../../../core/data/relationship-data.service'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { Context } from '../../../../../../core/shared/context.model'; import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model'; import { Item } from '../../../../../../core/shared/item.model'; -import { SearchResult } from '../../../../../search/models/search-result.model'; -import { PaginatedList } from '../../../../../../core/data/paginated-list.model'; -import { BehaviorSubject, Observable } from 'rxjs'; -import { RelationshipOptions } from '../../../models/relationship-options.model'; -import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; -import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; import { Relationship } from '../../../../../../core/shared/item-relationships/relationship.model'; import { RelationshipType } from '../../../../../../core/shared/item-relationships/relationship-type.model'; import { @@ -41,21 +49,34 @@ import { getRemoteDataPayload, } from '../../../../../../core/shared/operators'; import { SearchService } from '../../../../../../core/shared/search/search.service'; -import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../my-dspace-page/my-dspace-page.component'; import { hasValue } from '../../../../../empty.util'; import { CollectionElementLinkType } from '../../../../../object-collection/collection-element-link.type'; -import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; +import { + ListableObject, + ListableObject, +} from '../../../../../object-collection/shared/listable-object.model'; import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service'; -import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; +import { + PaginationComponentOptions, + PaginationComponentOptions, +} from '../../../../../pagination/pagination-component-options.model'; import { SearchObjects } from '../../../../../search/models/search-objects.model'; -import { SearchResult } from '../../../../../search/models/search-result.model'; -import { RelationshipOptions } from '../../../models/relationship-options.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../../../../utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { + SearchResult, + SearchResult, +} from '../../../../../search/models/search-result.model'; import { ThemedSearchComponent } from '../../../../../search/themed-search.component'; +import { VarDirective } from '../../../../../utils/var.directive'; +import { + RelationshipOptions, + RelationshipOptions, +} from '../../../models/relationship-options.model'; @Component({ @@ -65,8 +86,8 @@ import { ThemedSearchComponent } from '../../../../../search/themed-search.compo providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], imports: [ AsyncPipe, @@ -74,9 +95,9 @@ import { ThemedSearchComponent } from '../../../../../search/themed-search.compo TranslateModule, NgbDropdownModule, NgIf, - ThemedSearchComponent + ThemedSearchComponent, ], - standalone: true + standalone: true, }) /** diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts index 57fc94a155..cc82967080 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component.ts @@ -18,10 +18,10 @@ import { RelationshipOptions } from '../../../models/relationship-options.model' import { DsDynamicLookupRelationSearchTabComponent } from './dynamic-lookup-relation-search-tab.component'; @Component({ - selector: 'ds-themed-dynamic-lookup-relation-search-tab', - styleUrls: [], - templateUrl: '../../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-dynamic-lookup-relation-search-tab', + styleUrls: [], + templateUrl: '../../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedDynamicLookupRelationSearchTabComponent extends ThemedComponent { protected inAndOutputNames: (keyof DsDynamicLookupRelationSearchTabComponent & keyof this)[] = ['relationship', 'listId', diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts index 82d0747c84..04d29090e0 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts @@ -20,14 +20,14 @@ import { RemoteData } from '../../../../../../core/data/remote-data'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { Item } from '../../../../../../core/shared/item.model'; import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; +import { ObjectCollectionComponent } from '../../../../../../shared/object-collection/object-collection.component'; +import { PageSizeSelectorComponent } from '../../../../../../shared/page-size-selector/page-size-selector.component'; import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; import { ListableObject } from '../../../../../object-collection/shared/listable-object.model'; import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../../remote-data.utils'; import { PaginatedSearchOptions } from '../../../../../search/models/paginated-search-options.model'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; -import { PageSizeSelectorComponent } from '../../../../../../shared/page-size-selector/page-size-selector.component'; -import { ObjectCollectionComponent } from '../../../../../../shared/object-collection/object-collection.component'; import { VarDirective } from '../../../../../utils/var.directive'; import { DsDynamicLookupRelationSelectionTabComponent } from './dynamic-lookup-relation-selection-tab.component'; @@ -78,8 +78,8 @@ describe('DsDynamicLookupRelationSelectionTabComponent', () => { .overrideComponent(DsDynamicLookupRelationSelectionTabComponent, { remove: { imports: [ObjectCollectionComponent, - PageSizeSelectorComponent,] - } + PageSizeSelectorComponent], + }, }) .compileComponents(); })); diff --git a/src/app/shared/form/builder/form-builder.service.ts b/src/app/shared/form/builder/form-builder.service.ts index 613de17834..66c500f23d 100644 --- a/src/app/shared/form/builder/form-builder.service.ts +++ b/src/app/shared/form/builder/form-builder.service.ts @@ -58,7 +58,7 @@ import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './ds-dynamic-form-ui/models/tag/d import { FormFieldMetadataValueObject } from './models/form-field-metadata-value.model'; import { RowParser } from './parsers/row-parser'; -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class FormBuilderService extends DynamicFormService { private typeBindModel: DynamicFormControlModel; diff --git a/src/app/shared/form/chips/chips.component.spec.ts b/src/app/shared/form/chips/chips.component.spec.ts index a1cb8eff40..822687e5f4 100644 --- a/src/app/shared/form/chips/chips.component.spec.ts +++ b/src/app/shared/form/chips/chips.component.spec.ts @@ -38,20 +38,20 @@ describe('ChipsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, SortablejsModule.forRoot({ animation: 150 }), TranslateModule.forRoot(), ChipsComponent, TestComponent, AuthorityConfidenceStateDirective, - ], - providers: [ + ], + providers: [ ChangeDetectorRef, ChipsComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -187,10 +187,10 @@ describe('ChipsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [NgbModule], }) class TestComponent { diff --git a/src/app/shared/form/chips/chips.component.ts b/src/app/shared/form/chips/chips.component.ts index 07acb43487..a4b51c129f 100644 --- a/src/app/shared/form/chips/chips.component.ts +++ b/src/app/shared/form/chips/chips.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,22 +13,33 @@ import { Output, SimpleChanges, } from '@angular/core'; -import { NgbTooltip, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + NgbTooltip, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import isObject from 'lodash/isObject'; -import { BehaviorSubject } from 'rxjs'; -import { Options } from 'sortablejs'; +import { SortablejsModule } from 'ngx-sortablejs'; +import { + BehaviorSubject, + BehaviorSubject, +} from 'rxjs'; +import { + Options, + Options, +} from 'sortablejs'; -import { DragService } from '../../../core/drag.service'; +import { + DragService, + DragService, +} from '../../../core/drag.service'; +import { AuthorityConfidenceStateDirective } from '../directives/authority-confidence-state.directive'; import { Chips } from './models/chips.model'; import { ChipsItem } from './models/chips-item.model'; -import { DragService } from '../../../core/drag.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Options } from 'sortablejs'; -import { BehaviorSubject } from 'rxjs'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { SortablejsModule } from 'ngx-sortablejs'; -import { AuthorityConfidenceStateDirective } from '../directives/authority-confidence-state.directive'; @Component({ selector: 'ds-chips', @@ -36,9 +53,9 @@ import { AuthorityConfidenceStateDirective } from '../directives/authority-confi AsyncPipe, AuthorityConfidenceStateDirective, NgIf, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class ChipsComponent implements OnChanges { diff --git a/src/app/shared/form/directives/authority-confidence-state.directive.ts b/src/app/shared/form/directives/authority-confidence-state.directive.ts index b5b054908c..1c6c627474 100644 --- a/src/app/shared/form/directives/authority-confidence-state.directive.ts +++ b/src/app/shared/form/directives/authority-confidence-state.directive.ts @@ -37,8 +37,8 @@ import { FormFieldMetadataValueObject } from '../builder/models/form-field-metad * Directive to add to the element a bootstrap utility class based on metadata confidence value */ @Directive({ - selector: '[dsAuthorityConfidenceState]', - standalone: true + selector: '[dsAuthorityConfidenceState]', + standalone: true, }) export class AuthorityConfidenceStateDirective implements OnChanges, AfterViewInit { diff --git a/src/app/shared/form/form.component.spec.ts b/src/app/shared/form/form.component.spec.ts index 6fcedec193..f88d63f4c2 100644 --- a/src/app/shared/form/form.component.spec.ts +++ b/src/app/shared/form/form.component.spec.ts @@ -1,7 +1,20 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormArrayModel, @@ -11,18 +24,24 @@ import { DynamicFormValidationService, DynamicInputModel, } from '@ng-dynamic-forms/core'; -import { Store, StoreModule, } from '@ngrx/store'; +import { + Store, + StoreModule, +} from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; -import { storeModuleConfig } from '../../app.reducer'; -import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component'; import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; +import { storeModuleConfig } from '../../app.reducer'; import { StoreMock } from '../testing/store.mock'; import { createTestComponent } from '../testing/utils.test'; +import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component'; import { FormBuilderService } from './builder/form-builder.service'; import { FormFieldMetadataValueObject } from './builder/models/form-field-metadata-value.model'; -import { FormChangeAction, FormStatusChangeAction, } from './form.actions'; +import { + FormChangeAction, + FormStatusChangeAction, +} from './form.actions'; import { FormComponent } from './form.component'; import { FormState } from './form.reducer'; import { FormService } from './form.service'; @@ -158,15 +177,15 @@ describe('FormComponent test suite', () => { FormService, { provide: Store, useClass: StoreMock }, ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) .overrideComponent(FormComponent, { remove: { - imports: [DsDynamicFormComponent] + imports: [DsDynamicFormComponent], }, add: { - changeDetection: ChangeDetectionStrategy.Default - } + changeDetection: ChangeDetectionStrategy.Default, + }, }); })); @@ -456,7 +475,7 @@ describe('FormComponent test suite', () => { FormsModule, ReactiveFormsModule, NgbModule, - DynamicFormsCoreModule] + DynamicFormsCoreModule], }) class TestComponent { diff --git a/src/app/shared/form/form.component.ts b/src/app/shared/form/form.component.ts index f043296138..39985df1a4 100644 --- a/src/app/shared/form/form.component.ts +++ b/src/app/shared/form/form.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -5,14 +9,14 @@ import { Input, OnDestroy, OnInit, - Output,} from '@angular/core'; + Output, +} from '@angular/core'; import { AbstractControl, ReactiveFormsModule, UntypedFormArray, UntypedFormControl, - UntypedFormGroup -, + UntypedFormGroup, } from '@angular/forms'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { @@ -20,8 +24,10 @@ import { DynamicFormControlEvent, DynamicFormControlModel, DynamicFormGroupModel, - DynamicFormLayout, DynamicFormsCoreModule, + DynamicFormLayout, + DynamicFormsCoreModule, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import findIndex from 'lodash/findIndex'; import { Observable, @@ -39,18 +45,19 @@ import { isNotNull, isNull, } from '../empty.util'; +import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component'; import { FormBuilderService } from './builder/form-builder.service'; -import { FormFieldMetadataValueObject } from './builder/models/form-field-metadata-value.model'; +import { + FormFieldMetadataValueObject, + FormFieldMetadataValueObject, +} from './builder/models/form-field-metadata-value.model'; import { FormEntry, + FormEntry, + FormError, FormError, } from './form.reducer'; import { FormService } from './form.service'; -import { FormEntry, FormError } from './form.reducer'; -import { FormFieldMetadataValueObject } from './builder/models/form-field-metadata-value.model'; -import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; /** * The default form component. @@ -68,7 +75,7 @@ import { AsyncPipe, NgIf } from '@angular/common'; NgIf, AsyncPipe, ], - standalone: true + standalone: true, }) export class FormComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/form/form.module.ts b/src/app/shared/form/form.module.ts index 9f4dba772c..b708c7adfb 100644 --- a/src/app/shared/form/form.module.ts +++ b/src/app/shared/form/form.module.ts @@ -1,7 +1,10 @@ import { CdkTreeModule } from '@angular/cdk/tree'; import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { NgbDatepickerModule, NgbTimepickerModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbDatepickerModule, + NgbTimepickerModule, +} from '@ng-bootstrap/ng-bootstrap'; import { DYNAMIC_FORM_CONTROL_MAP_FN, DynamicFormLayoutService, @@ -16,62 +19,31 @@ import { SortablejsModule } from 'ngx-sortablejs'; import { SearchModule } from '../search/search.module'; import { DsDynamicFormComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form.component'; -import { - DsDynamicFormControlContainerComponent -} from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component'; +import { DsDynamicFormControlContainerComponent } from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component'; +import { dsDynamicFormControlMapFn } from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; import { DsDynamicTypeBindRelationService } from './builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; -import { - ExistingMetadataListElementComponent -} from './builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component'; -import { - ExistingRelationListElementComponent -} from './builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component'; -import { - DsDynamicFormArrayComponent -} from './builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component'; +import { ExistingMetadataListElementComponent } from './builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component'; +import { ExistingRelationListElementComponent } from './builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component'; +import { DsDynamicFormArrayComponent } from './builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component'; import { CustomSwitchComponent } from './builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component'; import { DsDatePickerComponent } from './builder/ds-dynamic-form-ui/models/date-picker/date-picker.component'; -import { - DsDatePickerInlineComponent -} from './builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component'; +import { DsDatePickerInlineComponent } from './builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component'; import { DsDynamicDisabledComponent } from './builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component'; -import { - DsDynamicFormGroupComponent -} from './builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component'; +import { DsDynamicFormGroupComponent } from './builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component'; import { DsDynamicListComponent } from './builder/ds-dynamic-form-ui/models/list/dynamic-list.component'; import { DsDynamicLookupComponent } from './builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component'; -import { - DsDynamicLookupRelationModalComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component'; -import { - DsDynamicScrollableDropdownComponent -} from './builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; -import { DsDynamicTagComponent } from './builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component'; import { DsDynamicOneboxComponent } from './builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component'; -import { - DsDynamicRelationGroupComponent -} from './builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components'; -import { - DsDynamicLookupRelationSearchTabComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; -import { - DsDynamicLookupRelationSelectionTabComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component'; -import { - DsDynamicLookupRelationExternalSourceTabComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; -import { - ExternalSourceEntryImportModalComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component'; -import { - ThemedExternalSourceEntryImportModalComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; -import { - ThemedDynamicLookupRelationExternalSourceTabComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component'; -import { - ThemedDynamicLookupRelationSearchTabComponent -} from './builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component'; +import { DsDynamicRelationGroupComponent } from './builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components'; +import { DsDynamicScrollableDropdownComponent } from './builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component'; +import { DsDynamicTagComponent } from './builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component'; +import { DsDynamicLookupRelationModalComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component'; +import { DsDynamicLookupRelationExternalSourceTabComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; +import { ExternalSourceEntryImportModalComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component'; +import { ThemedExternalSourceEntryImportModalComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/themed-external-source-entry-import-modal.component'; +import { ThemedDynamicLookupRelationExternalSourceTabComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/themed-dynamic-lookup-relation-external-source-tab.component'; +import { DsDynamicLookupRelationSearchTabComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; +import { ThemedDynamicLookupRelationSearchTabComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/themed-dynamic-lookup-relation-search-tab.component'; +import { DsDynamicLookupRelationSelectionTabComponent } from './builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component'; import { FormBuilderService } from './builder/form-builder.service'; import { ChipsComponent } from './chips/chips.component'; import { AuthorityConfidenceStateDirective } from './directives/authority-confidence-state.directive'; @@ -80,7 +52,6 @@ import { FormService } from './form.service'; import { NumberPickerComponent } from './number-picker/number-picker.component'; import { VocabularyTreeviewComponent } from './vocabulary-treeview/vocabulary-treeview.component'; import { VocabularyTreeviewModalComponent } from './vocabulary-treeview-modal/vocabulary-treeview-modal.component'; -import { dsDynamicFormControlMapFn } from './builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; const COMPONENTS = [ CustomSwitchComponent, @@ -119,35 +90,35 @@ const DIRECTIVES = [ ]; @NgModule({ - imports: [ - CommonModule, - DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - SearchModule, - TranslateModule, - SortablejsModule, - NgxMaskModule.forRoot(), - NgbDatepickerModule, - NgbTimepickerModule, - CdkTreeModule, - ...COMPONENTS, - ...DIRECTIVES - ], - exports: [ - ...COMPONENTS, - ...DIRECTIVES, - ], - providers: [ - { - provide: DYNAMIC_FORM_CONTROL_MAP_FN, + imports: [ + CommonModule, + DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + SearchModule, + TranslateModule, + SortablejsModule, + NgxMaskModule.forRoot(), + NgbDatepickerModule, + NgbTimepickerModule, + CdkTreeModule, + ...COMPONENTS, + ...DIRECTIVES, + ], + exports: [ + ...COMPONENTS, + ...DIRECTIVES, + ], + providers: [ + { + provide: DYNAMIC_FORM_CONTROL_MAP_FN, useValue: dsDynamicFormControlMapFn, - }, - DynamicFormLayoutService, - DynamicFormService, - DynamicFormValidationService, - FormBuilderService, - DsDynamicTypeBindRelationService, - FormService, + }, + DynamicFormLayoutService, + DynamicFormService, + DynamicFormValidationService, + FormBuilderService, + DsDynamicTypeBindRelationService, + FormService, ], }) export class FormModule { diff --git a/src/app/shared/form/form.service.ts b/src/app/shared/form/form.service.ts index 471c9344b7..1ca844d690 100644 --- a/src/app/shared/form/form.service.ts +++ b/src/app/shared/form/form.service.ts @@ -45,7 +45,7 @@ import { } from './form.reducer'; import { formObjectFromIdSelector } from './selectors'; -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class FormService { constructor( diff --git a/src/app/shared/form/number-picker/number-picker.component.spec.ts b/src/app/shared/form/number-picker/number-picker.component.spec.ts index c4af3c2930..5a1174ecf5 100644 --- a/src/app/shared/form/number-picker/number-picker.component.spec.ts +++ b/src/app/shared/form/number-picker/number-picker.component.spec.ts @@ -33,20 +33,20 @@ describe('NumberPickerComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, NgbModule, TranslateModule.forRoot(), NumberPickerComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, NumberPickerComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -157,13 +157,13 @@ describe('NumberPickerComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule, - NgbModule, - NumberPickerComponent,] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + NgbModule, + NumberPickerComponent], }) class TestComponent { diff --git a/src/app/shared/form/number-picker/number-picker.component.ts b/src/app/shared/form/number-picker/number-picker.component.ts index ab66c2eeac..e268919101 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -1,9 +1,25 @@ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core'; -import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, UntypedFormBuilder } from '@angular/forms'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { NgClass } from '@angular/common'; +import { + ChangeDetectorRef, + Component, + EventEmitter, + Input, + OnInit, + Output, + SimpleChanges, +} from '@angular/core'; +import { + ControlValueAccessor, + FormsModule, + NG_VALUE_ACCESSOR, + UntypedFormBuilder, +} from '@angular/forms'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { isEmpty } from '../../empty.util'; -import { NgClass } from '@angular/common'; @Component({ selector: 'ds-number-picker', @@ -15,9 +31,9 @@ import { NgClass } from '@angular/common'; imports: [ NgClass, FormsModule, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class NumberPickerComponent implements OnInit, ControlValueAccessor { diff --git a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts index 5ed49c1f7e..ab8361aad0 100644 --- a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts @@ -4,8 +4,8 @@ import { } from '@angular/core/testing'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { VocabularyTreeviewComponent } from '../vocabulary-treeview/vocabulary-treeview.component'; +import { VocabularyTreeviewComponent } from '../vocabulary-treeview/vocabulary-treeview.component'; import { VocabularyTreeviewModalComponent } from './vocabulary-treeview-modal.component'; describe('VocabularyTreeviewModalComponent', () => { @@ -19,12 +19,12 @@ describe('VocabularyTreeviewModalComponent', () => { imports: [TranslateModule.forRoot(), VocabularyTreeviewModalComponent], providers: [ { provide: NgbActiveModal, useValue: modalStub }, - ] + ], }) .overrideComponent(VocabularyTreeviewModalComponent, { remove: { - imports: [VocabularyTreeviewComponent] - } + imports: [VocabularyTreeviewComponent], + }, }) .compileComponents(); }); diff --git a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts index 5d8983893f..d195ed36d3 100644 --- a/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts +++ b/src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts @@ -1,10 +1,15 @@ -import { Component, EventEmitter, Input, Output, } from '@angular/core'; +import { + Component, + EventEmitter, + Input, + Output, +} from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; -import { VocabularyTreeviewComponent } from '../vocabulary-treeview/vocabulary-treeview.component'; -import { TranslateModule } from '@ngx-translate/core'; import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model'; +import { VocabularyTreeviewComponent } from '../vocabulary-treeview/vocabulary-treeview.component'; @Component({ selector: 'ds-vocabulary-treeview-modal', @@ -12,9 +17,9 @@ import { VocabularyOptions } from '../../../core/submission/vocabularies/models/ styleUrls: ['./vocabulary-treeview-modal.component.scss'], imports: [ VocabularyTreeviewComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) /** * Component that contains a modal to display a VocabularyTreeviewComponent diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts index 3800cd6b3b..2470123423 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts @@ -1,7 +1,17 @@ import { CdkTreeModule } from '@angular/cdk/tree'; -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { StoreModule } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; @@ -16,12 +26,14 @@ import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vo import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model'; import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { createTestComponent } from '../../testing/utils.test'; import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model'; import { VocabularyTreeviewComponent } from './vocabulary-treeview.component'; import { VocabularyTreeviewService } from './vocabulary-treeview.service'; -import { TreeviewFlatNode, TreeviewNode, } from './vocabulary-treeview-node.model'; +import { + TreeviewFlatNode, + TreeviewNode, +} from './vocabulary-treeview-node.model'; describe('VocabularyTreeviewComponent test suite', () => { @@ -75,24 +87,24 @@ describe('VocabularyTreeviewComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CdkTreeModule, StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot(), VocabularyTreeviewComponent, TestComponent, - NoopAnimationsModule - ], - providers: [ + NoopAnimationsModule, + ], + providers: [ { provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub }, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: NgbActiveModal, useValue: modalStub }, provideMockStore({ initialState }), ChangeDetectorRef, VocabularyTreeviewComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(() => { + }).compileComponents().then(() => { vocabularyTreeviewServiceStub.getData.and.returnValue(observableOf([])); vocabularyTreeviewServiceStub.isLoading.and.returnValue(observableOf(false)); }); @@ -282,10 +294,10 @@ describe('VocabularyTreeviewComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CdkTreeModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CdkTreeModule], }) class TestComponent { diff --git a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts index c2fb5a1744..903a24962b 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -1,8 +1,32 @@ -import { CdkTreeModule, FlatTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, } from '@angular/core'; +import { + CdkTreeModule, + FlatTreeControl, +} from '@angular/cdk/tree'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnChanges, + OnDestroy, + OnInit, + Output, + SimpleChanges, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Observable, Subscription, } from 'rxjs'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + Subscription, +} from 'rxjs'; import { CoreState } from '../../../core/core-state.model'; import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; @@ -11,17 +35,23 @@ import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vo import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model'; import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service'; -import { FormsModule } from '@angular/forms'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; import { AlertComponent } from '../../alert/alert.component'; import { AlertType } from '../../alert/alert-type'; -import { hasValue, isEmpty, isNotEmpty, } from '../../empty.util'; +import { + hasValue, + isEmpty, + isNotEmpty, +} from '../../empty.util'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source'; import { VocabularyTreeFlattener } from './vocabulary-tree-flattener'; import { VocabularyTreeviewService } from './vocabulary-treeview.service'; -import { LOAD_MORE, LOAD_MORE_ROOT, TreeviewFlatNode, TreeviewNode, } from './vocabulary-treeview-node.model'; +import { + LOAD_MORE, + LOAD_MORE_ROOT, + TreeviewFlatNode, + TreeviewNode, +} from './vocabulary-treeview-node.model'; /** * Component that shows a hierarchical vocabulary in a tree view @@ -38,9 +68,9 @@ import { LOAD_MORE, LOAD_MORE_ROOT, TreeviewFlatNode, TreeviewNode, } from './vo TranslateModule, AsyncPipe, ThemedLoadingComponent, - AlertComponent + AlertComponent, ], - standalone: true + standalone: true, }) export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges { diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts index d20705c986..0e06e2b67a 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts @@ -25,13 +25,13 @@ describe('GoogleRecaptchaComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [GoogleRecaptchaComponent], - providers: [ + imports: [GoogleRecaptchaComponent], + providers: [ { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, ], -}) - .compileComponents(); + }) + .compileComponents(); }); diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.ts index 70fec90c24..c459576a68 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { Component, EventEmitter, @@ -15,14 +16,13 @@ import { import { ConfigurationDataService } from '../../core/data/configuration-data.service'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { isNotEmpty } from '../empty.util'; -import { AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-google-recaptcha', - templateUrl: './google-recaptcha.component.html', - styleUrls: ['./google-recaptcha.component.scss'], - standalone: true, - imports: [AsyncPipe] + selector: 'ds-google-recaptcha', + templateUrl: './google-recaptcha.component.html', + styleUrls: ['./google-recaptcha.component.scss'], + standalone: true, + imports: [AsyncPipe], }) export class GoogleRecaptchaComponent implements OnInit { diff --git a/src/app/shared/hover-class.directive.spec.ts b/src/app/shared/hover-class.directive.spec.ts index acb75fb814..7232093fc7 100644 --- a/src/app/shared/hover-class.directive.spec.ts +++ b/src/app/shared/hover-class.directive.spec.ts @@ -11,9 +11,9 @@ import { By } from '@angular/platform-browser'; import { HoverClassDirective } from './hover-class.directive'; @Component({ - template: `
`, - standalone: true, - imports: [HoverClassDirective] + template: `
`, + standalone: true, + imports: [HoverClassDirective], }) class TestComponent { } @@ -25,8 +25,8 @@ describe('HoverClassDirective', () => { beforeEach(() => { fixture = TestBed.configureTestingModule({ - imports: [TestComponent, HoverClassDirective] -}).createComponent(TestComponent); + imports: [TestComponent, HoverClassDirective], + }).createComponent(TestComponent); fixture.detectChanges(); component = fixture.componentInstance; diff --git a/src/app/shared/hover-class.directive.ts b/src/app/shared/hover-class.directive.ts index 42329d70c8..5632518fcc 100644 --- a/src/app/shared/hover-class.directive.ts +++ b/src/app/shared/hover-class.directive.ts @@ -6,8 +6,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[dsHoverClass]', - standalone: true + selector: '[dsHoverClass]', + standalone: true, }) /** * A directive adding a class to an element when hovered over diff --git a/src/app/shared/idle-modal/idle-modal.component.spec.ts b/src/app/shared/idle-modal/idle-modal.component.spec.ts index c600dab9dc..29c13cba5f 100644 --- a/src/app/shared/idle-modal/idle-modal.component.spec.ts +++ b/src/app/shared/idle-modal/idle-modal.component.spec.ts @@ -32,14 +32,14 @@ describe('IdleModalComponent', () => { authServiceStub = jasmine.createSpyObj('authService', ['setIdle']); storeStub = jasmine.createSpyObj('store', ['dispatch']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), IdleModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), IdleModalComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: AuthService, useValue: authServiceStub }, { provide: Store, useValue: storeStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/idle-modal/idle-modal.component.ts b/src/app/shared/idle-modal/idle-modal.component.ts index 8006e7dc6c..b8633147da 100644 --- a/src/app/shared/idle-modal/idle-modal.component.ts +++ b/src/app/shared/idle-modal/idle-modal.component.ts @@ -1,19 +1,24 @@ -import { Component, EventEmitter, OnInit, Output, } from '@angular/core'; +import { + Component, + EventEmitter, + OnInit, + Output, +} from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { environment } from '../../../environments/environment'; import { AppState } from '../../app.reducer'; import { LogOutAction } from '../../core/auth/auth.actions'; -import { TranslateModule } from '@ngx-translate/core'; import { AuthService } from '../../core/auth/auth.service'; import { hasValue } from '../empty.util'; @Component({ - selector: 'ds-idle-modal', - templateUrl: 'idle-modal.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-idle-modal', + templateUrl: 'idle-modal.component.html', + standalone: true, + imports: [TranslateModule], }) export class IdleModalComponent implements OnInit { diff --git a/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts b/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts index 45f8d30c7f..122bc603a3 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts @@ -52,18 +52,18 @@ describe('ImpersonateNavbarComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), - ImpersonateNavbarComponent, VarDirective - ], - providers: [ + ImpersonateNavbarComponent, VarDirective, + ], + providers: [ { provide: AuthService, useValue: authService }, provideMockStore({ initialState }), - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts b/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts index 61912ad155..a6510f8eb2 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts @@ -1,12 +1,18 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, ElementRef, OnInit, } from '@angular/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { select, Store, } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, Subscription, @@ -16,15 +22,12 @@ import { map } from 'rxjs/operators'; import { AppState } from '../../app.reducer'; import { AuthService } from '../../core/auth/auth.service'; import { isAuthenticated } from '../../core/auth/selectors'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-impersonate-navbar', - templateUrl: 'impersonate-navbar.component.html', - standalone: true, - imports: [NgIf, NgbTooltipModule, AsyncPipe, TranslateModule] + selector: 'ds-impersonate-navbar', + templateUrl: 'impersonate-navbar.component.html', + standalone: true, + imports: [NgIf, NgbTooltipModule, AsyncPipe, TranslateModule], }) /** * Navbar component for actions to take concerning impersonating users diff --git a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.spec.ts b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.spec.ts index d15564cd17..5189b44ef0 100644 --- a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.spec.ts +++ b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.spec.ts @@ -14,14 +14,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { DsoInputSuggestionsComponent } from './dso-input-suggestions.component'; -import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { ThemeService } from '../../theme-support/theme.service'; +import { + DSpaceObject, + DSpaceObject, +} from '../../../core/shared/dspace-object.model'; import { getMockThemeService } from '../../mocks/theme-service.mock'; +import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ThemeService } from '../../theme-support/theme.service'; import { ClickOutsideDirective } from '../../utils/click-outside.directive'; import { DebounceDirective } from '../../utils/debounce.directive'; -import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { DsoInputSuggestionsComponent } from './dso-input-suggestions.component'; describe('DsoInputSuggestionsComponent', () => { diff --git a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts index 93069a4473..af3b7cc010 100644 --- a/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts @@ -1,37 +1,44 @@ +import { + AsyncPipe, + NgClass, + NgFor, +} from '@angular/common'; import { Component, forwardRef, Input, } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; +import { + FormsModule, + NG_VALUE_ACCESSOR, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { hasValue } from '../../empty.util'; import { CollectionElementLinkType } from '../../object-collection/collection-element-link.type'; -import { InputSuggestionsComponent } from '../input-suggestions.component'; import { ListableObjectComponentLoaderComponent } from '../../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgClass, NgFor, AsyncPipe } from '@angular/common'; -import { DebounceDirective } from '../../utils/debounce.directive'; import { ClickOutsideDirective } from '../../utils/click-outside.directive'; -import { TranslateModule } from '@ngx-translate/core'; +import { DebounceDirective } from '../../utils/debounce.directive'; +import { InputSuggestionsComponent } from '../input-suggestions.component'; @Component({ - selector: 'ds-dso-input-suggestions', - styleUrls: ['./../input-suggestions.component.scss'], - templateUrl: './dso-input-suggestions.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 - // eslint-disable-next-line @angular-eslint/no-forward-ref - useExisting: forwardRef(() => DsoInputSuggestionsComponent), - multi: true - } - ], - standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, ListableObjectComponentLoaderComponent, AsyncPipe, TranslateModule] + selector: 'ds-dso-input-suggestions', + styleUrls: ['./../input-suggestions.component.scss'], + templateUrl: './dso-input-suggestions.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 + // eslint-disable-next-line @angular-eslint/no-forward-ref + useExisting: forwardRef(() => DsoInputSuggestionsComponent), + multi: true, + }, + ], + standalone: true, + imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, ListableObjectComponentLoaderComponent, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.spec.ts b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.spec.ts index cc338cc1df..bdb3a9234f 100644 --- a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.spec.ts +++ b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.spec.ts @@ -29,10 +29,10 @@ describe('FilterInputSuggestionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, FilterInputSuggestionsComponent], - providers: [], + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, FilterInputSuggestionsComponent], + providers: [], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(FilterInputSuggestionsComponent, { + }).overrideComponent(FilterInputSuggestionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts index af1dc0eeae..addc1999d1 100644 --- a/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts @@ -1,31 +1,41 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { Component, forwardRef, Input, } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; +import { + FormsModule, + NG_VALUE_ACCESSOR, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ClickOutsideDirective } from '../../utils/click-outside.directive'; +import { DebounceDirective } from '../../utils/debounce.directive'; import { InputSuggestionsComponent } from '../input-suggestions.component'; import { InputSuggestion } from '../input-suggestions.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { DebounceDirective } from '../../utils/debounce.directive'; -import { NgIf, NgTemplateOutlet, NgClass, NgFor, AsyncPipe } from '@angular/common'; -import { ClickOutsideDirective } from '../../utils/click-outside.directive'; @Component({ - selector: 'ds-filter-input-suggestions', - styleUrls: ['./../input-suggestions.component.scss'], - templateUrl: './filter-input-suggestions.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 - // eslint-disable-next-line @angular-eslint/no-forward-ref - useExisting: forwardRef(() => FilterInputSuggestionsComponent), - multi: true - } - ], - standalone: true, - imports: [FormsModule, ClickOutsideDirective, NgIf, NgTemplateOutlet, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-filter-input-suggestions', + styleUrls: ['./../input-suggestions.component.scss'], + templateUrl: './filter-input-suggestions.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 + // eslint-disable-next-line @angular-eslint/no-forward-ref + useExisting: forwardRef(() => FilterInputSuggestionsComponent), + multi: true, + }, + ], + standalone: true, + imports: [FormsModule, ClickOutsideDirective, NgIf, NgTemplateOutlet, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/input-suggestions/input-suggestions.component.spec.ts b/src/app/shared/input-suggestions/input-suggestions.component.spec.ts index 8af2960a66..b16380e4db 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.spec.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.spec.ts @@ -31,10 +31,10 @@ describe('InputSuggestionsComponent', () => { }, { displayValue: 'suggestion tres', value: 'suggestion tres' }]; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, InputSuggestionsComponent], - providers: [], + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, InputSuggestionsComponent], + providers: [], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(InputSuggestionsComponent, { + }).overrideComponent(InputSuggestionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/input-suggestions/input-suggestions.component.ts b/src/app/shared/input-suggestions/input-suggestions.component.ts index d220dd56d7..a0717a3259 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgFor, +} from '@angular/common'; import { Component, ElementRef, @@ -10,19 +15,25 @@ import { ViewChild, ViewChildren, } from '@angular/core'; -import { BehaviorSubject } from 'rxjs'; -import { hasValue, isNotEmpty } from '../empty.util'; -import { ControlValueAccessor, FormsModule } from '@angular/forms'; -import { AsyncPipe, NgClass, NgFor } from '@angular/common'; -import { DebounceDirective } from '../utils/debounce.directive'; -import { ClickOutsideDirective } from '../utils/click-outside.directive'; +import { + ControlValueAccessor, + FormsModule, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { BehaviorSubject } from 'rxjs'; + +import { + hasValue, + isNotEmpty, +} from '../empty.util'; +import { ClickOutsideDirective } from '../utils/click-outside.directive'; +import { DebounceDirective } from '../utils/debounce.directive'; @Component({ - selector: 'ds-input-suggestions', - templateUrl: './input-suggestions.component.html', - standalone: true, - imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-input-suggestions', + templateUrl: './input-suggestions.component.html', + standalone: true, + imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.spec.ts b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.spec.ts index 51d52efb54..f806894fee 100644 --- a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.spec.ts +++ b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.spec.ts @@ -34,14 +34,14 @@ describe('ValidationSuggestionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, ReactiveFormsModule, ValidationSuggestionsComponent], - providers: [FormsModule, + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, ReactiveFormsModule, ValidationSuggestionsComponent], + providers: [FormsModule, ReactiveFormsModule, { provide: MetadataFieldDataService, useValue: {} }, { provide: ObjectUpdatesService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ValidationSuggestionsComponent, { + }).overrideComponent(ValidationSuggestionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts index ea5e65d9c9..6160b9ef09 100644 --- a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts +++ b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts @@ -1,38 +1,47 @@ -import { Component, forwardRef, Input, OnInit } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgFor, +} from '@angular/common'; +import { + Component, + forwardRef, + Input, + OnInit, +} from '@angular/core'; import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, - Validators + Validators, } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { MetadatumViewModel } from '../../../core/shared/metadata.models'; +import { ClickOutsideDirective } from '../../utils/click-outside.directive'; +import { DebounceDirective } from '../../utils/debounce.directive'; import { MetadataFieldValidator } from '../../utils/metadatafield-validator.directive'; import { InputSuggestionsComponent } from '../input-suggestions.component'; import { InputSuggestion } from '../input-suggestions.model'; -import { AsyncPipe, NgClass, NgFor } from '@angular/common'; -import { DebounceDirective } from '../../utils/debounce.directive'; -import { ClickOutsideDirective } from '../../utils/click-outside.directive'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-validation-suggestions', - styleUrls: ['./../input-suggestions.component.scss'], - templateUrl: './validation-suggestions.component.html', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 - // eslint-disable-next-line @angular-eslint/no-forward-ref - useExisting: forwardRef(() => ValidationSuggestionsComponent), - multi: true - } - ], - standalone: true, - imports: [FormsModule, ReactiveFormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-validation-suggestions', + styleUrls: ['./../input-suggestions.component.scss'], + templateUrl: './validation-suggestions.component.html', + providers: [ + { + provide: NG_VALUE_ACCESSOR, + // Usage of forwardRef necessary https://github.com/angular/angular.io/issues/1151 + // eslint-disable-next-line @angular-eslint/no-forward-ref + useExisting: forwardRef(() => ValidationSuggestionsComponent), + multi: true, + }, + ], + standalone: true, + imports: [FormsModule, ReactiveFormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/lang-switch/lang-switch.component.spec.ts b/src/app/shared/lang-switch/lang-switch.component.spec.ts index 60f63a05d1..2dce8302ce 100644 --- a/src/app/shared/lang-switch/lang-switch.component.spec.ts +++ b/src/app/shared/lang-switch/lang-switch.component.spec.ts @@ -83,15 +83,15 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: CustomLoader } + imports: [HttpClientTestingModule, TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: CustomLoader }, }), LangSwitchComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - TranslateService, - { provide: LocaleService, useValue: getMockLocaleService() }, + schemas: [NO_ERRORS_SCHEMA], + providers: [ + TranslateService, + { provide: LocaleService, useValue: getMockLocaleService() }, ], -}).compileComponents() + }).compileComponents() .then(() => { translate = TestBed.inject(TranslateService); translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code)); @@ -166,15 +166,15 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: CustomLoader } + imports: [HttpClientTestingModule, TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: CustomLoader }, }), LangSwitchComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - TranslateService, + schemas: [NO_ERRORS_SCHEMA], + providers: [ + TranslateService, { provide: LocaleService, useValue: getMockLocaleService() }, ], -}).compileComponents(); + }).compileComponents(); translate = TestBed.inject(TranslateService); translate.addLangs(mockConfig.languages.filter((MyLangConfig) => MyLangConfig.active === true).map((a) => a.code)); translate.setDefaultLang('en'); diff --git a/src/app/shared/lang-switch/lang-switch.component.ts b/src/app/shared/lang-switch/lang-switch.component.ts index 35868f703b..c29b3f375a 100644 --- a/src/app/shared/lang-switch/lang-switch.component.ts +++ b/src/app/shared/lang-switch/lang-switch.component.ts @@ -1,17 +1,28 @@ -import { Component, ElementRef, OnInit, } from '@angular/core'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + ElementRef, + OnInit, +} from '@angular/core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; + import { LangConfig } from '../../../config/lang-config.interface'; import { environment } from '../../../environments/environment'; import { LocaleService } from '../../core/locale/locale.service'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { NgFor, NgIf } from '@angular/common'; @Component({ - selector: 'ds-lang-switch', - styleUrls: ['lang-switch.component.scss'], - templateUrl: 'lang-switch.component.html', - standalone: true, - imports: [NgIf, NgbDropdownModule, NgFor, TranslateModule] + selector: 'ds-lang-switch', + styleUrls: ['lang-switch.component.scss'], + templateUrl: 'lang-switch.component.html', + standalone: true, + imports: [NgIf, NgbDropdownModule, NgFor, TranslateModule], }) /** diff --git a/src/app/shared/lang-switch/themed-lang-switch.component.ts b/src/app/shared/lang-switch/themed-lang-switch.component.ts index 05d9952c40..2e4d7f50e5 100644 --- a/src/app/shared/lang-switch/themed-lang-switch.component.ts +++ b/src/app/shared/lang-switch/themed-lang-switch.component.ts @@ -10,7 +10,7 @@ import { LangSwitchComponent } from './lang-switch.component'; selector: 'ds-themed-lang-switch', styleUrls: [], templateUrl: '../theme-support/themed.component.html', - standalone: true + standalone: true, }) export class ThemedLangSwitchComponent extends ThemedComponent { diff --git a/src/app/shared/loading/loading.component.spec.ts b/src/app/shared/loading/loading.component.spec.ts index 3ce6294039..e139c57dd0 100644 --- a/src/app/shared/loading/loading.component.spec.ts +++ b/src/app/shared/loading/loading.component.spec.ts @@ -23,17 +23,17 @@ describe('LoadingComponent (inline template)', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - LoadingComponent - ], - providers: [TranslateService], -}).compileComponents(); // compile template and css + LoadingComponent, + ], + providers: [TranslateService], + }).compileComponents(); // compile template and css })); beforeEach(() => { diff --git a/src/app/shared/loading/loading.component.ts b/src/app/shared/loading/loading.component.ts index 9de0efe29b..03846fe394 100644 --- a/src/app/shared/loading/loading.component.ts +++ b/src/app/shared/loading/loading.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, Input, @@ -8,14 +9,13 @@ import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { hasValue } from '../empty.util'; -import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-loading', - styleUrls: ['./loading.component.scss'], - templateUrl: './loading.component.html', - standalone: true, - imports: [NgIf] + selector: 'ds-loading', + styleUrls: ['./loading.component.scss'], + templateUrl: './loading.component.html', + standalone: true, + imports: [NgIf], }) export class LoadingComponent implements OnDestroy, OnInit { diff --git a/src/app/shared/loading/themed-loading.component.ts b/src/app/shared/loading/themed-loading.component.ts index 8a8cbb82ba..983bdadff0 100644 --- a/src/app/shared/loading/themed-loading.component.ts +++ b/src/app/shared/loading/themed-loading.component.ts @@ -12,10 +12,10 @@ import { LoadingComponent } from './loading.component'; * Themed wrapper for LoadingComponent */ @Component({ - selector: 'ds-themed-loading', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-loading', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedLoadingComponent extends ThemedComponent { diff --git a/src/app/shared/log-in/container/log-in-container.component.spec.ts b/src/app/shared/log-in/container/log-in-container.component.spec.ts index 93675523fc..4c2e9eddca 100644 --- a/src/app/shared/log-in/container/log-in-container.component.spec.ts +++ b/src/app/shared/log-in/container/log-in-container.component.spec.ts @@ -22,7 +22,6 @@ import { AuthMethod } from '../../../core/auth/models/auth.method'; import { AuthMethodType } from '../../../core/auth/models/auth.method-type'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { HardRedirectService } from '../../../core/services/hard-redirect.service'; -import { SharedModule } from '../../shared.module'; import { AuthServiceStub } from '../../testing/auth-service.stub'; import { AuthorizationDataServiceStub } from '../../testing/authorization-service.stub'; import { createTestComponent } from '../../testing/utils.test'; @@ -44,24 +43,24 @@ describe('LogInContainerComponent', () => { }); // refine the test module by declaring the test component TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot(authReducer), TranslateModule.forRoot(), RouterTestingModule, TestComponent, - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: HardRedirectService, useValue: hardRedirectService }, LogInContainerComponent, - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}) + }) .compileComponents(); })); @@ -120,12 +119,12 @@ describe('LogInContainerComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule, - RouterTestingModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + RouterTestingModule], }) class TestComponent { diff --git a/src/app/shared/log-in/container/log-in-container.component.ts b/src/app/shared/log-in/container/log-in-container.component.ts index ec42d3c019..bf06f4f07c 100644 --- a/src/app/shared/log-in/container/log-in-container.component.ts +++ b/src/app/shared/log-in/container/log-in-container.component.ts @@ -1,18 +1,26 @@ -import { Component, Injector, Input, OnInit } from '@angular/core'; -import { AuthMethodTypeComponent, rendersAuthMethodType } from '../methods/log-in.methods-decorator'; +import { NgComponentOutlet } from '@angular/common'; +import { + Component, + Injector, + Input, + OnInit, +} from '@angular/core'; import { AuthMethod } from '../../../core/auth/models/auth.method'; -import { NgComponentOutlet } from '@angular/common'; +import { + AuthMethodTypeComponent, + rendersAuthMethodType, +} from '../methods/log-in.methods-decorator'; /** * This component represents a component container for log-in methods available. */ @Component({ - selector: 'ds-log-in-container', - templateUrl: './log-in-container.component.html', - styleUrls: ['./log-in-container.component.scss'], - standalone: true, - imports: [NgComponentOutlet] + selector: 'ds-log-in-container', + templateUrl: './log-in-container.component.html', + styleUrls: ['./log-in-container.component.scss'], + standalone: true, + imports: [NgComponentOutlet], }) export class LogInContainerComponent implements OnInit { diff --git a/src/app/shared/log-in/log-in.component.spec.ts b/src/app/shared/log-in/log-in.component.spec.ts index 66e7d23670..571f8b2625 100644 --- a/src/app/shared/log-in/log-in.component.spec.ts +++ b/src/app/shared/log-in/log-in.component.spec.ts @@ -1,6 +1,17 @@ -import { Component, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; +import { + Component, + CUSTOM_ELEMENTS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; @@ -11,13 +22,16 @@ import { of } from 'rxjs'; import { authReducer } from '../../core/auth/auth.reducer'; import { AuthService } from '../../core/auth/auth.service'; -import { authMethodsMock, AuthServiceStub } from '../testing/auth-service.stub'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { HardRedirectService } from '../../core/services/hard-redirect.service'; import { NativeWindowService } from '../../core/services/window.service'; import { NativeWindowMockFactory } from '../mocks/mock-native-window-ref'; import { getMockThemeService } from '../mocks/theme-service.mock'; import { ActivatedRouteStub } from '../testing/active-router.stub'; +import { + authMethodsMock, + AuthServiceStub, +} from '../testing/auth-service.stub'; import { createTestComponent } from '../testing/utils.test'; import { ThemeService } from '../theme-support/theme.service'; import { LogInComponent } from './log-in.component'; @@ -51,20 +65,20 @@ describe('LogInComponent', () => { // refine the test module by declaring the test component void TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot(authReducer, { - runtimeChecks: { - strictStateImmutability: false, + runtimeChecks: { + strictStateImmutability: false, strictActionImmutability: false, }, }), RouterTestingModule, TranslateModule.forRoot(), - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, // { provide: Router, useValue: new RouterStub() }, @@ -74,11 +88,11 @@ describe('LogInComponent', () => { provideMockStore({ initialState }), { provide: ThemeService, useValue: getMockThemeService() }, LogInComponent, - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}) + }) .compileComponents(); })); @@ -130,12 +144,12 @@ describe('LogInComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule, - RouterTestingModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + RouterTestingModule], }) class TestComponent { diff --git a/src/app/shared/log-in/log-in.component.ts b/src/app/shared/log-in/log-in.component.ts index 003657e4e4..e4d91ca388 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -1,6 +1,22 @@ -import { ChangeDetectionStrategy, Component, Input, OnInit, } from '@angular/core'; -import { select, Store, } from '@ngrx/store'; -import { map, Observable, } from 'rxjs'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Input, + OnInit, +} from '@angular/core'; +import { + select, + Store, +} from '@ngrx/store'; +import { + map, + Observable, +} from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; import { AuthMethod } from '../../core/auth/models/auth.method'; @@ -12,18 +28,17 @@ import { } from '../../core/auth/selectors'; import { CoreState } from '../../core/core-state.model'; import { hasValue } from '../empty.util'; -import { LogInContainerComponent } from './container/log-in-container.component'; import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; +import { LogInContainerComponent } from './container/log-in-container.component'; import { rendersAuthMethodType } from './methods/log-in.methods-decorator'; @Component({ - selector: 'ds-log-in', - templateUrl: './log-in.component.html', - styleUrls: ['./log-in.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [NgIf, ThemedLoadingComponent, NgFor, LogInContainerComponent, AsyncPipe] + selector: 'ds-log-in', + templateUrl: './log-in.component.html', + styleUrls: ['./log-in.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, ThemedLoadingComponent, NgFor, LogInContainerComponent, AsyncPipe], }) export class LogInComponent implements OnInit { diff --git a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.spec.ts b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.spec.ts index 6e9b7f2efb..104bbd21ce 100644 --- a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.spec.ts +++ b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.spec.ts @@ -61,12 +61,12 @@ describe('LogInExternalProviderComponent', () => { beforeEach(waitForAsync(() => { // refine the test module by declaring the test component void TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot(), LogInExternalProviderComponent, - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: 'authMethodProvider', useValue: new AuthMethod(AuthMethodType.Orcid, 0, location) }, { provide: 'isStandalonePage', useValue: true }, @@ -75,11 +75,11 @@ describe('LogInExternalProviderComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: HardRedirectService, useValue: hardRedirectService }, provideMockStore({ initialState }), - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts index 7becfb4bbe..13741f412e 100644 --- a/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts +++ b/src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts @@ -1,24 +1,40 @@ -import { Component, Inject, OnInit, } from '@angular/core'; -import { select, Store, } from '@ngrx/store'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { + select, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; import { AuthService } from '../../../../core/auth/auth.service'; import { AuthMethod } from '../../../../core/auth/models/auth.method'; -import { isAuthenticated, isAuthenticationLoading, } from '../../../../core/auth/selectors'; +import { + isAuthenticated, + isAuthenticationLoading, +} from '../../../../core/auth/selectors'; import { CoreState } from '../../../../core/core-state.model'; import { HardRedirectService } from '../../../../core/services/hard-redirect.service'; -import { NativeWindowRef, NativeWindowService, } from '../../../../core/services/window.service'; +import { + NativeWindowRef, + NativeWindowService, +} from '../../../../core/services/window.service'; import { URLCombiner } from '../../../../core/url-combiner/url-combiner'; -import { TranslateModule } from '@ngx-translate/core'; -import { isEmpty, isNotNull, } from '../../../empty.util'; +import { + isEmpty, + isNotNull, +} from '../../../empty.util'; @Component({ - selector: 'ds-log-in-external-provider', - templateUrl: './log-in-external-provider.component.html', - styleUrls: ['./log-in-external-provider.component.scss'], - standalone: true, - imports: [TranslateModule] + selector: 'ds-log-in-external-provider', + templateUrl: './log-in-external-provider.component.html', + styleUrls: ['./log-in-external-provider.component.scss'], + standalone: true, + imports: [TranslateModule], }) export class LogInExternalProviderComponent implements OnInit { diff --git a/src/app/shared/log-in/methods/log-in.methods-decorator.ts b/src/app/shared/log-in/methods/log-in.methods-decorator.ts index bef490635c..79a53fcb8f 100644 --- a/src/app/shared/log-in/methods/log-in.methods-decorator.ts +++ b/src/app/shared/log-in/methods/log-in.methods-decorator.ts @@ -1,6 +1,6 @@ import { AuthMethodType } from '../../../core/auth/models/auth.method-type'; -import { LogInPasswordComponent } from './password/log-in-password.component'; import { LogInExternalProviderComponent } from './log-in-external-provider/log-in-external-provider.component'; +import { LogInPasswordComponent } from './password/log-in-password.component'; export type AuthMethodTypeComponent = typeof LogInPasswordComponent | @@ -10,7 +10,7 @@ export const AUTH_METHOD_FOR_DECORATOR_MAP = new Map { beforeEach(waitForAsync(() => { // refine the test module by declaring the test component void TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot(), - LogInPasswordComponent - ], - providers: [ + LogInPasswordComponent, + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: 'authMethodProvider', useValue: new AuthMethod(AuthMethodType.Password, 0) }, @@ -67,11 +78,11 @@ describe('LogInPasswordComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: themeService }, provideMockStore({ initialState }), - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.ts b/src/app/shared/log-in/methods/password/log-in-password.component.ts index dc369fe71c..bcc2048dee 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.ts @@ -1,36 +1,68 @@ -import { Component, Inject, OnInit, } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators, } from '@angular/forms'; -import { select, Store, } from '@ngrx/store'; -import { combineLatest, Observable, shareReplay, } from 'rxjs'; -import { filter, map, } from 'rxjs/operators'; -import { AuthenticateAction, ResetAuthenticationMessagesAction } from '../../../../core/auth/auth.actions'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup, + Validators, +} from '@angular/forms'; +import { RouterLink } from '@angular/router'; +import { + select, + Store, +} from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest, + Observable, + shareReplay, +} from 'rxjs'; +import { + filter, + map, +} from 'rxjs/operators'; -import { getAuthenticationError, getAuthenticationInfo, } from '../../../../core/auth/selectors'; -import { isNotEmpty } from '../../../empty.util'; -import { fadeOut } from '../../../animations/fade'; -import { getForgotPasswordRoute, getRegisterRoute, } from '../../../../app-routing-paths'; +import { + getForgotPasswordRoute, + getRegisterRoute, +} from '../../../../app-routing-paths'; +import { + AuthenticateAction, + ResetAuthenticationMessagesAction, +} from '../../../../core/auth/auth.actions'; import { AuthService } from '../../../../core/auth/auth.service'; import { AuthMethod } from '../../../../core/auth/models/auth.method'; +import { + getAuthenticationError, + getAuthenticationInfo, +} from '../../../../core/auth/selectors'; import { CoreState } from '../../../../core/core-state.model'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; -import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; import { HardRedirectService } from '../../../../core/services/hard-redirect.service'; +import { fadeOut } from '../../../animations/fade'; +import { isNotEmpty } from '../../../empty.util'; +import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; /** * /users/sign-in * @class LogInPasswordComponent */ @Component({ - selector: 'ds-log-in-password', - templateUrl: './log-in-password.component.html', - styleUrls: ['./log-in-password.component.scss'], - animations: [fadeOut], - standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgIf, RouterLink, AsyncPipe, TranslateModule, BrowserOnlyPipe] + selector: 'ds-log-in-password', + templateUrl: './log-in-password.component.html', + styleUrls: ['./log-in-password.component.scss'], + animations: [fadeOut], + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgIf, RouterLink, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class LogInPasswordComponent implements OnInit { diff --git a/src/app/shared/log-out/log-out.component.spec.ts b/src/app/shared/log-out/log-out.component.spec.ts index bd8ed0d5ba..59a09c9cca 100644 --- a/src/app/shared/log-out/log-out.component.spec.ts +++ b/src/app/shared/log-out/log-out.component.spec.ts @@ -1,8 +1,19 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { Router } from '@angular/router'; -import { Store, StoreModule, } from '@ngrx/store'; +import { + Store, + StoreModule, +} from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { AppState } from '../../app.reducer'; @@ -33,25 +44,25 @@ describe('LogOutComponent', () => { beforeEach(waitForAsync(() => { // refine the test module by declaring the test component TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot(authReducer, { - runtimeChecks: { - strictStateImmutability: false, + runtimeChecks: { + strictStateImmutability: false, strictActionImmutability: false, }, }), TranslateModule.forRoot(), - LogOutComponent - ], - providers: [ + LogOutComponent, + ], + providers: [ { provide: Router, useValue: routerStub }, - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA, ], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/log-out/log-out.component.ts b/src/app/shared/log-out/log-out.component.ts index 29f167a405..73927a9be6 100644 --- a/src/app/shared/log-out/log-out.component.ts +++ b/src/app/shared/log-out/log-out.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, @@ -7,6 +11,7 @@ import { select, Store, } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { AppState } from '../../app.reducer'; @@ -14,16 +19,14 @@ import { LogOutAction } from '../../core/auth/auth.actions'; import { getLogOutError } from '../../core/auth/selectors'; import { fadeOut } from '../animations/fade'; import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-log-out', - templateUrl: './log-out.component.html', - styleUrls: ['./log-out.component.scss'], - animations: [fadeOut], - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule, BrowserOnlyPipe] + selector: 'ds-log-out', + templateUrl: './log-out.component.html', + styleUrls: ['./log-out.component.scss'], + animations: [fadeOut], + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class LogOutComponent implements OnInit { /** diff --git a/src/app/shared/menu/menu-item.decorator.ts b/src/app/shared/menu/menu-item.decorator.ts index af123c7d04..91a005b1b0 100644 --- a/src/app/shared/menu/menu-item.decorator.ts +++ b/src/app/shared/menu/menu-item.decorator.ts @@ -1,8 +1,8 @@ -import { MenuItemType } from './menu-item-type.model'; import { ExternalLinkMenuItemComponent } from './menu-item/external-link-menu-item.component'; import { LinkMenuItemComponent } from './menu-item/link-menu-item.component'; import { OnClickMenuItemComponent } from './menu-item/onclick-menu-item.component'; import { TextMenuItemComponent } from './menu-item/text-menu-item.component'; +import { MenuItemType } from './menu-item-type.model'; const menuMenuItemComponentMap = new Map(); diff --git a/src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts index a977edeee4..f972568fb2 100644 --- a/src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts +++ b/src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts @@ -27,12 +27,12 @@ describe('ExternalLinkMenuItemComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), ExternalLinkMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), ExternalLinkMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: { text: text, href: link } }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/menu/menu-item/external-link-menu-item.component.ts b/src/app/shared/menu/menu-item/external-link-menu-item.component.ts index 275953f769..69a92023b0 100644 --- a/src/app/shared/menu/menu-item/external-link-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/external-link-menu-item.component.ts @@ -1,11 +1,12 @@ +import { NgClass } from '@angular/common'; import { Component, Inject, - OnInit,} from '@angular/core'; -import { isNotEmpty } from '../../empty.util'; -import { rendersMenuItemForType } from '../menu-item.decorator'; + OnInit, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; -import { NgClass } from '@angular/common'; + +import { isNotEmpty } from '../../empty.util'; import { ExternalLinkMenuItemModel } from './models/external-link.model'; /** @@ -16,7 +17,7 @@ import { ExternalLinkMenuItemModel } from './models/external-link.model'; styleUrls: ['./menu-item.component.scss'], templateUrl: './external-link-menu-item.component.html', standalone: true, - imports: [NgClass, TranslateModule] + imports: [NgClass, TranslateModule], }) export class ExternalLinkMenuItemComponent implements OnInit { item: ExternalLinkMenuItemModel; diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts index 5944b993f2..e31a1d1580 100644 --- a/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts +++ b/src/app/shared/menu/menu-item/link-menu-item.component.spec.ts @@ -1,12 +1,23 @@ -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { + ActivatedRoute, + Router, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { QueryParamsDirectiveStub } from '../../testing/query-params-directive.stub'; import { RouterStub } from '../../testing/router.stub'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { RouterLinkDirectiveStub } from '../../testing/router-link-directive.stub'; import { LinkMenuItemComponent } from './link-menu-item.component'; @@ -34,13 +45,13 @@ describe('LinkMenuItemComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, RouterLinkDirectiveStub, QueryParamsDirectiveStub, - RouterLink + RouterLink, ], schemas: [NO_ERRORS_SCHEMA], }) .overrideComponent(LinkMenuItemComponent, { remove: { imports: [] }, - add: { imports: [RouterLinkDirectiveStub, QueryParamsDirectiveStub] } + add: { imports: [RouterLinkDirectiveStub, QueryParamsDirectiveStub] }, }) .compileComponents(); })); diff --git a/src/app/shared/menu/menu-item/link-menu-item.component.ts b/src/app/shared/menu/menu-item/link-menu-item.component.ts index bbf07e0b69..7eb750d108 100644 --- a/src/app/shared/menu/menu-item/link-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/link-menu-item.component.ts @@ -1,19 +1,27 @@ -import { Component, Inject, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { isNotEmpty } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; import { NgClass } from '@angular/common'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { isNotEmpty } from '../../empty.util'; import { LinkMenuItemModel } from './models/link.model'; /** * Component that renders a menu section of type LINK */ @Component({ - selector: 'ds-link-menu-item', - styleUrls: ['./menu-item.component.scss'], - templateUrl: './link-menu-item.component.html', - standalone: true, - imports: [NgClass, RouterLink, TranslateModule] + selector: 'ds-link-menu-item', + styleUrls: ['./menu-item.component.scss'], + templateUrl: './link-menu-item.component.html', + standalone: true, + imports: [NgClass, RouterLink, TranslateModule], }) export class LinkMenuItemComponent implements OnInit { item: LinkMenuItemModel; diff --git a/src/app/shared/menu/menu-item/onclick-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/onclick-menu-item.component.spec.ts index ea43aec3ab..a73a0cfff2 100644 --- a/src/app/shared/menu/menu-item/onclick-menu-item.component.spec.ts +++ b/src/app/shared/menu/menu-item/onclick-menu-item.component.spec.ts @@ -25,12 +25,12 @@ describe('OnClickMenuItemComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), OnClickMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), OnClickMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: item }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/menu/menu-item/onclick-menu-item.component.ts b/src/app/shared/menu/menu-item/onclick-menu-item.component.ts index 128eb22c3a..9ec1e8d5e0 100644 --- a/src/app/shared/menu/menu-item/onclick-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/onclick-menu-item.component.ts @@ -1,17 +1,21 @@ -import { Component, Inject } from '@angular/core'; -import { OnClickMenuItemModel } from './models/onclick.model'; -import { TranslateModule } from '@ngx-translate/core'; import { NgIf } from '@angular/common'; +import { + Component, + Inject, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { OnClickMenuItemModel } from './models/onclick.model'; /** * Component that renders a menu section of type ONCLICK */ @Component({ - selector: 'ds-onclick-menu-item', - styleUrls: ['./menu-item.component.scss', './onclick-menu-item.component.scss'], - templateUrl: './onclick-menu-item.component.html', - standalone: true, - imports: [NgIf, TranslateModule] + selector: 'ds-onclick-menu-item', + styleUrls: ['./menu-item.component.scss', './onclick-menu-item.component.scss'], + templateUrl: './onclick-menu-item.component.html', + standalone: true, + imports: [NgIf, TranslateModule], }) export class OnClickMenuItemComponent { item: OnClickMenuItemModel; diff --git a/src/app/shared/menu/menu-item/text-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/text-menu-item.component.spec.ts index 6320b58813..7ef44b113d 100644 --- a/src/app/shared/menu/menu-item/text-menu-item.component.spec.ts +++ b/src/app/shared/menu/menu-item/text-menu-item.component.spec.ts @@ -19,12 +19,12 @@ describe('TextMenuItemComponent', () => { const text = 'HELLO'; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), TextMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), TextMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: { text: text } }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/shared/menu/menu-item/text-menu-item.component.ts b/src/app/shared/menu/menu-item/text-menu-item.component.ts index 48b65b12d7..f767745dd8 100644 --- a/src/app/shared/menu/menu-item/text-menu-item.component.ts +++ b/src/app/shared/menu/menu-item/text-menu-item.component.ts @@ -2,19 +2,19 @@ import { Component, Inject, } from '@angular/core'; - import { TranslateModule } from '@ngx-translate/core'; + import { TextMenuItemModel } from './models/text.model'; /** * Component that renders a menu section of type TEXT */ @Component({ - selector: 'ds-text-menu-item', + selector: 'ds-text-menu-item', styleUrls: ['./menu-item.component.scss'], - templateUrl: './text-menu-item.component.html', - standalone: true, - imports: [TranslateModule] + templateUrl: './text-menu-item.component.html', + standalone: true, + imports: [TranslateModule], }) export class TextMenuItemComponent { item: TextMenuItemModel; diff --git a/src/app/shared/menu/menu-section.decorator.ts b/src/app/shared/menu/menu-section.decorator.ts index 5c55331ef6..daf4618e2e 100644 --- a/src/app/shared/menu/menu-section.decorator.ts +++ b/src/app/shared/menu/menu-section.decorator.ts @@ -1,22 +1,13 @@ +import { ExpandableNavbarSectionComponent } from 'src/app/navbar/expandable-navbar-section/expandable-navbar-section.component'; + +import { AdminSidebarSectionComponent } from '../../admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; +import { ExpandableAdminSidebarSectionComponent } from '../../admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; +import { NavbarSectionComponent } from '../../navbar/navbar-section/navbar-section.component'; +import { DsoEditMenuExpandableSectionComponent } from '../dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component'; +import { DsoEditMenuSectionComponent } from '../dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component'; import { hasValue } from '../empty.util'; import { DEFAULT_THEME } from '../object-collection/shared/listable-object/listable-object.decorator'; import { MenuID } from './menu-id.model'; -import { - ExpandableAdminSidebarSectionComponent -} from '../../admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component'; -import { - AdminSidebarSectionComponent -} from '../../admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component'; -import { NavbarSectionComponent } from '../../navbar/navbar-section/navbar-section.component'; -import { - ExpandableNavbarSectionComponent -} from 'src/app/navbar/expandable-navbar-section/expandable-navbar-section.component'; -import { - DsoEditMenuSectionComponent -} from '../dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component'; -import { - DsoEditMenuExpandableSectionComponent -} from '../dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component'; const menuComponentMap = new Map(); diff --git a/src/app/shared/menu/menu-section/menu-section.component.spec.ts b/src/app/shared/menu/menu-section/menu-section.component.spec.ts index 3e4b352b5b..e527e4a247 100644 --- a/src/app/shared/menu/menu-section/menu-section.component.spec.ts +++ b/src/app/shared/menu/menu-section/menu-section.component.spec.ts @@ -31,14 +31,14 @@ describe('MenuSectionComponent', () => { active: false, } as any; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, MenuSectionComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, MenuSectionComponent], + providers: [ { provide: Injector, useValue: {} }, { provide: MenuService, useClass: MenuServiceStub }, { provide: MenuSection, useValue: dummySection }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MenuSectionComponent, { + }).overrideComponent(MenuSectionComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/menu/menu-section/menu-section.component.ts b/src/app/shared/menu/menu-section/menu-section.component.ts index 901a62c537..f59c0b5594 100644 --- a/src/app/shared/menu/menu-section/menu-section.component.ts +++ b/src/app/shared/menu/menu-section/menu-section.component.ts @@ -30,9 +30,9 @@ import { MenuSection } from '../menu-section.model'; * A basic implementation of a menu section's component */ @Component({ - selector: 'ds-menu-section', - template: '', - standalone: true + selector: 'ds-menu-section', + template: '', + standalone: true, }) export class MenuSectionComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/menu/menu.component.spec.ts b/src/app/shared/menu/menu.component.spec.ts index 9dc33e5e5a..2a23d5ed4c 100644 --- a/src/app/shared/menu/menu.component.spec.ts +++ b/src/app/shared/menu/menu.component.spec.ts @@ -130,8 +130,8 @@ describe('MenuComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, MenuComponent, StoreModule.forRoot(authReducer, storeModuleConfig)], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, MenuComponent, StoreModule.forRoot(authReducer, storeModuleConfig)], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, MenuService, diff --git a/src/app/shared/menu/menu.component.ts b/src/app/shared/menu/menu.component.ts index e2651c9ee0..73e8182471 100644 --- a/src/app/shared/menu/menu.component.ts +++ b/src/app/shared/menu/menu.component.ts @@ -37,9 +37,9 @@ import { MenuSectionComponent } from './menu-section/menu-section.component'; * A basic implementation of a MenuComponent */ @Component({ - selector: 'ds-menu', - template: '', - standalone: true + selector: 'ds-menu', + template: '', + standalone: true, }) export class MenuComponent implements OnInit, OnDestroy { /** diff --git a/src/app/shared/menu/menu.module.ts b/src/app/shared/menu/menu.module.ts index 5892f27f34..762c8244ad 100644 --- a/src/app/shared/menu/menu.module.ts +++ b/src/app/shared/menu/menu.module.ts @@ -32,16 +32,16 @@ const PROVIDERS = [ ]; @NgModule({ - imports: [ - ...MODULES, - ...COMPONENTS, - ...ENTRY_COMPONENTS - ], - providers: [ - ...PROVIDERS, - ...ENTRY_COMPONENTS, - ], - exports: [ + imports: [ + ...MODULES, + ...COMPONENTS, + ...ENTRY_COMPONENTS, + ], + providers: [ + ...PROVIDERS, + ...ENTRY_COMPONENTS, + ], + exports: [ ...COMPONENTS, ], }) diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts index 1138f4d7c2..df80edf474 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts @@ -1,6 +1,13 @@ /* eslint-disable max-classes-per-file */ -import { Component, Input, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + Input, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { MetadataFieldWrapperComponent } from './metadata-field-wrapper.component'; @@ -8,33 +15,33 @@ import { MetadataFieldWrapperComponent } from './metadata-field-wrapper.componen selector: 'ds-component-without-content', template: '\n' + '', - standalone: true, - imports: [MetadataFieldWrapperComponent] + standalone: true, + imports: [MetadataFieldWrapperComponent], }) class NoContentComponent { public hideIfNoTextContent = true; } @Component({ - selector: 'ds-component-with-empty-spans', - template: '\n' + + selector: 'ds-component-with-empty-spans', + template: '\n' + ' \n' + ' \n' + '', - standalone: true, - imports: [MetadataFieldWrapperComponent] + standalone: true, + imports: [MetadataFieldWrapperComponent], }) class SpanContentComponent { @Input() hideIfNoTextContent = true; } @Component({ - selector: 'ds-component-with-text', - template: '\n' + + selector: 'ds-component-with-text', + template: '\n' + ' The quick brown fox jumps over the lazy dog\n' + '', - standalone: true, - imports: [MetadataFieldWrapperComponent] + standalone: true, + imports: [MetadataFieldWrapperComponent], }) class TextContentComponent { @Input() hideIfNoTextContent = true; @@ -47,8 +54,8 @@ describe('MetadataFieldWrapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [MetadataFieldWrapperComponent, NoContentComponent, SpanContentComponent, TextContentComponent], -}).compileComponents(); + imports: [MetadataFieldWrapperComponent, NoContentComponent, SpanContentComponent, TextContentComponent], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts index 10cfca5969..af139e78e6 100644 --- a/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts +++ b/src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts @@ -1,19 +1,19 @@ +import { NgIf } from '@angular/common'; import { Component, Input, } from '@angular/core'; -import { NgIf } from '@angular/common'; /** * This component renders any content inside this wrapper. * The wrapper prints a label before the content (if available) */ @Component({ - selector: 'ds-metadata-field-wrapper', - styleUrls: ['./metadata-field-wrapper.component.scss'], - templateUrl: './metadata-field-wrapper.component.html', - standalone: true, - imports: [NgIf] + selector: 'ds-metadata-field-wrapper', + styleUrls: ['./metadata-field-wrapper.component.scss'], + templateUrl: './metadata-field-wrapper.component.html', + standalone: true, + imports: [NgIf], }) export class MetadataFieldWrapperComponent { diff --git a/src/app/shared/metadata-representation/metadata-representation-loader.component.spec.ts b/src/app/shared/metadata-representation/metadata-representation-loader.component.spec.ts index c1513511a4..b21a81e664 100644 --- a/src/app/shared/metadata-representation/metadata-representation-loader.component.spec.ts +++ b/src/app/shared/metadata-representation/metadata-representation-loader.component.spec.ts @@ -47,23 +47,23 @@ describe('MetadataRepresentationLoaderComponent', () => { beforeEach(waitForAsync(() => { themeService = getMockThemeService(themeName); TestBed.configureTestingModule({ - imports: [ + imports: [ MetadataRepresentationLoaderComponent, PlainTextMetadataListElementComponent, DynamicComponentLoaderDirective, ], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + schemas: [NO_ERRORS_SCHEMA], + providers: [ { - provide: METADATA_REPRESENTATION_COMPONENT_FACTORY, + provide: METADATA_REPRESENTATION_COMPONENT_FACTORY, useValue: jasmine.createSpy('getMetadataRepresentationComponent').and.returnValue(PlainTextMetadataListElementComponent), }, { - provide: ThemeService, - useValue: themeService, + provide: ThemeService, + useValue: themeService, }, ], -}).overrideComponent(MetadataRepresentationLoaderComponent, { + }).overrideComponent(MetadataRepresentationLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, entryComponents: [PlainTextMetadataListElementComponent], diff --git a/src/app/shared/metadata-representation/metadata-representation-loader.component.ts b/src/app/shared/metadata-representation/metadata-representation-loader.component.ts index d32275d885..46b13b1440 100644 --- a/src/app/shared/metadata-representation/metadata-representation-loader.component.ts +++ b/src/app/shared/metadata-representation/metadata-representation-loader.component.ts @@ -11,16 +11,14 @@ import { MetadataRepresentationType, } from '../../core/shared/metadata-representation/metadata-representation.model'; import { AbstractComponentLoaderComponent } from '../abstract-component-loader/abstract-component-loader.component'; -import { - MetadataRepresentationListElementComponent -} from '../object-list/metadata-representation-list-element/metadata-representation-list-element.component'; +import { MetadataRepresentationListElementComponent } from '../object-list/metadata-representation-list-element/metadata-representation-list-element.component'; import { ThemeService } from '../theme-support/theme.service'; import { METADATA_REPRESENTATION_COMPONENT_FACTORY } from './metadata-representation.decorator'; @Component({ - selector: 'ds-metadata-representation-loader', - templateUrl: '../abstract-component-loader/abstract-component-loader.component.html', - standalone: true, + selector: 'ds-metadata-representation-loader', + templateUrl: '../abstract-component-loader/abstract-component-loader.component.html', + standalone: true, }) /** * Component for determining what component to use depending on the item's entity type (dspace.entity.type), its metadata representation and, optionally, its context diff --git a/src/app/shared/metadata-representation/metadata-representation.decorator.ts b/src/app/shared/metadata-representation/metadata-representation.decorator.ts index d9b37bf1a0..c34eb0d219 100644 --- a/src/app/shared/metadata-representation/metadata-representation.decorator.ts +++ b/src/app/shared/metadata-representation/metadata-representation.decorator.ts @@ -3,6 +3,9 @@ import { InjectionToken } from '@angular/core'; import { Context } from '../../core/shared/context.model'; import { GenericConstructor } from '../../core/shared/generic-constructor'; import { MetadataRepresentationType } from '../../core/shared/metadata-representation/metadata-representation.model'; +import { OrgUnitItemMetadataListElementComponent } from '../../entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component'; +import { PersonItemMetadataListElementComponent } from '../../entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component'; +import { ProjectItemMetadataListElementComponent } from '../../entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component'; import { hasNoValue, hasValue, @@ -12,24 +15,9 @@ import { DEFAULT_THEME, resolveTheme, } from '../object-collection/shared/listable-object/listable-object.decorator'; -import { - PlainTextMetadataListElementComponent -} from '../object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component'; -import { - BrowseLinkMetadataListElementComponent -} from '../object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component'; -import { - ItemMetadataListElementComponent -} from '../object-list/metadata-representation-list-element/item/item-metadata-list-element.component'; -import { - OrgUnitItemMetadataListElementComponent -} from '../../entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component'; -import { - PersonItemMetadataListElementComponent -} from '../../entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component'; -import { - ProjectItemMetadataListElementComponent -} from '../../entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component'; +import { BrowseLinkMetadataListElementComponent } from '../object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component'; +import { ItemMetadataListElementComponent } from '../object-list/metadata-representation-list-element/item/item-metadata-list-element.component'; +import { PlainTextMetadataListElementComponent } from '../object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component'; export const METADATA_REPRESENTATION_COMPONENT_FACTORY = new InjectionToken<(entityType: string, mdRepresentationType: MetadataRepresentationType, context: Context, theme: string) => GenericConstructor>('getMetadataRepresentationComponent', { providedIn: 'root', @@ -50,29 +38,29 @@ export type MetadataRepresentationComponent = export const METADATA_REPRESENTATION_COMPONENT_DECORATOR_MAP = new Map>>>([ - ['Publication', new Map([ - [MetadataRepresentationType.PlainText, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PlainTextMetadataListElementComponent as any]])]])], - [MetadataRepresentationType.AuthorityControlled, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PlainTextMetadataListElementComponent]])]])], - [MetadataRepresentationType.BrowseLink, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, BrowseLinkMetadataListElementComponent]])]])], - [MetadataRepresentationType.Item, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, ItemMetadataListElementComponent]])]])], + ['Publication', new Map([ + [MetadataRepresentationType.PlainText, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PlainTextMetadataListElementComponent as any]])]])], + [MetadataRepresentationType.AuthorityControlled, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PlainTextMetadataListElementComponent]])]])], + [MetadataRepresentationType.BrowseLink, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, BrowseLinkMetadataListElementComponent]])]])], + [MetadataRepresentationType.Item, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, ItemMetadataListElementComponent]])]])], ])], - ['Person', new Map([ - [MetadataRepresentationType.Item, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PersonItemMetadataListElementComponent]])]])], + ['Person', new Map([ + [MetadataRepresentationType.Item, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, PersonItemMetadataListElementComponent]])]])], ])], - ['OrgUnit', new Map([ - [MetadataRepresentationType.Item, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, OrgUnitItemMetadataListElementComponent]])]])], + ['OrgUnit', new Map([ + [MetadataRepresentationType.Item, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, OrgUnitItemMetadataListElementComponent]])]])], ])], - ['Project', new Map([ - [MetadataRepresentationType.Item, new Map([ - [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, ProjectItemMetadataListElementComponent]])]])], + ['Project', new Map([ + [MetadataRepresentationType.Item, new Map([ + [DEFAULT_CONTEXT, new Map([[DEFAULT_THEME, ProjectItemMetadataListElementComponent]])]])], ])], -]); + ]); /** * Decorator function to store metadata representation mapping * @param entityType The entity type the component represents diff --git a/src/app/shared/mocks/dspace-rest/mocks/response-map.mock.ts b/src/app/shared/mocks/dspace-rest/mocks/response-map.mock.ts index 122dcbd035..e443f80471 100644 --- a/src/app/shared/mocks/dspace-rest/mocks/response-map.mock.ts +++ b/src/app/shared/mocks/dspace-rest/mocks/response-map.mock.ts @@ -7,7 +7,7 @@ export class ResponseMapMock extends Map {} export const MOCK_RESPONSE_MAP: InjectionToken = new InjectionToken('mockResponseMap', { providedIn: 'root', - factory: () => mockResponseMap + factory: () => mockResponseMap, }); /** diff --git a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts index bc9490a535..d4981986a1 100644 --- a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts @@ -51,16 +51,16 @@ describe('ClaimedTaskActionsApproveComponent', () => { beforeEach(waitForAsync(() => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsApproveComponent - ], - providers: [ + ClaimedTaskActionsApproveComponent, + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -68,9 +68,9 @@ describe('ClaimedTaskActionsApproveComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsApproveComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ClaimedTaskActionsApproveComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts index 1c3ed0b2f5..c768522ac4 100644 --- a/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts @@ -1,37 +1,52 @@ -import { Component, Injector } from '@angular/core'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { Observable, of } from 'rxjs'; -import { RemoteData } from '../../../../core/data/remote-data'; -import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, +} from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable, + Observable, + of, of, } from 'rxjs'; -import { RemoteData } from '../../../../core/data/remote-data'; +import { + RemoteData, + RemoteData, +} from '../../../../core/data/remote-data'; import { RequestService } from '../../../../core/data/request.service'; import { - ClaimedApprovedTaskSearchResult -} from '../../../object-collection/shared/claimed-approved-task-search-result.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; + DSpaceObject, + DSpaceObject, +} from '../../../../core/shared/dspace-object.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { ClaimedApprovedTaskSearchResult } from '../../../object-collection/shared/claimed-approved-task-search-result.model'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; +import { + ClaimedApprovedTaskSearchResult, + ClaimedApprovedTaskSearchResult, +} from '../../../object-collection/shared/claimed-approved-task-search-result.model'; +import { + ClaimedTaskActionsAbstractComponent, + ClaimedTaskActionsAbstractComponent, +} from '../abstract/claimed-task-actions-abstract.component'; export const WORKFLOW_TASK_OPTION_APPROVE = 'submit_approve'; @Component({ - selector: 'ds-claimed-task-actions-approve', - styleUrls: ['./claimed-task-actions-approve.component.scss'], - templateUrl: './claimed-task-actions-approve.component.html', - standalone: true, - imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions-approve', + styleUrls: ['./claimed-task-actions-approve.component.scss'], + templateUrl: './claimed-task-actions-approve.component.html', + standalone: true, + imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule], }) /** * Component for displaying and processing the approve action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts index ef5d2da287..7db5b59e21 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts @@ -9,7 +9,10 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -32,11 +35,11 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../remote-data.utils'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; import { VarDirective } from '../../utils/var.directive'; import { ClaimedTaskActionsComponent } from './claimed-task-actions.component'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; let component: ClaimedTaskActionsComponent; let fixture: ComponentFixture; @@ -109,16 +112,16 @@ describe('ClaimedTaskActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsComponent, VarDirective - ], - providers: [ + ClaimedTaskActionsComponent, VarDirective, + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -127,9 +130,9 @@ describe('ClaimedTaskActionsComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce }, { provide: WorkflowActionDataService, useValue: workflowActionService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsComponent, { + }).overrideComponent(ClaimedTaskActionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts index 5d75740565..b18d2bebc9 100644 --- a/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts @@ -1,11 +1,22 @@ +import { + AsyncPipe, + NgFor, +} from '@angular/common'; import { Component, Injector, Input, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; @@ -19,21 +30,19 @@ import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.mode import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { NotificationsService } from '../../notifications/notifications.service'; -import { MyDSpaceActionsComponent } from '../mydspace-actions'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { ClaimedTaskActionsLoaderComponent } from './switcher/claimed-task-actions-loader.component'; -import { NgFor, AsyncPipe } from '@angular/common'; import { VarDirective } from '../../utils/var.directive'; +import { MyDSpaceActionsComponent } from '../mydspace-actions'; +import { ClaimedTaskActionsLoaderComponent } from './switcher/claimed-task-actions-loader.component'; /** * This component represents actions related to ClaimedTask object. */ @Component({ - selector: 'ds-claimed-task-actions', - styleUrls: ['./claimed-task-actions.component.scss'], - templateUrl: './claimed-task-actions.component.html', - standalone: true, - imports: [VarDirective, NgFor, ClaimedTaskActionsLoaderComponent, NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions', + styleUrls: ['./claimed-task-actions.component.scss'], + templateUrl: './claimed-task-actions.component.html', + standalone: true, + imports: [VarDirective, NgFor, ClaimedTaskActionsLoaderComponent, NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule], }) export class ClaimedTaskActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.spec.ts index 965d1f0de0..e0df762b24 100644 --- a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.spec.ts @@ -48,16 +48,16 @@ describe('ClaimedTaskActionsDeclineTaskComponent', () => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsDeclineTaskComponent - ], - providers: [ + ClaimedTaskActionsDeclineTaskComponent, + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -65,9 +65,9 @@ describe('ClaimedTaskActionsDeclineTaskComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsDeclineTaskComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ClaimedTaskActionsDeclineTaskComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts index 0e6b7eb99e..79dbd11057 100644 --- a/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts @@ -1,30 +1,41 @@ -import { Component, Injector } from '@angular/core'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, +} from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable, of as observableOf, } from 'rxjs'; import { RemoteData } from 'src/app/core/data/remote-data'; + import { RequestService } from '../../../../core/data/request.service'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { NotificationsService } from '../../../notifications/notifications.service'; import { ClaimedDeclinedTaskTaskSearchResult } from '../../../object-collection/shared/claimed-declined-task-task-search-result.model'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + ClaimedTaskActionsAbstractComponent, + ClaimedTaskActionsAbstractComponent, +} from '../abstract/claimed-task-actions-abstract.component'; export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task'; @Component({ - selector: 'ds-claimed-task-actions-decline-task', - templateUrl: './claimed-task-actions-decline-task.component.html', - styleUrls: ['./claimed-task-actions-decline-task.component.scss'], - standalone: true, - imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions-decline-task', + templateUrl: './claimed-task-actions-decline-task.component.html', + styleUrls: ['./claimed-task-actions-decline-task.component.scss'], + standalone: true, + imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule], }) /** * Component for displaying and processing the decline task action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.spec.ts index 0893192226..4cf4867373 100644 --- a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.spec.ts @@ -9,11 +9,16 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Router } from '@angular/router'; +import { + ActivatedRoute, + Router, + Router, +} from '@angular/router'; import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -24,11 +29,9 @@ import { getMockRequestService } from '../../../mocks/request.service.mock'; import { getMockSearchService } from '../../../mocks/search-service.mock'; import { NotificationsService } from '../../../notifications/notifications.service'; import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; -import { ActivatedRoute, Router } from '@angular/router'; import { RouterStub } from '../../../testing/router.stub'; import { TranslateLoaderMock } from '../../../testing/translate-loader.mock'; import { ClaimedTaskActionsEditMetadataComponent } from './claimed-task-actions-edit-metadata.component'; -import { ActivatedRouteStub } from 'src/app/shared/testing/active-router.stub'; let component: ClaimedTaskActionsEditMetadataComponent; let fixture: ComponentFixture; @@ -44,16 +47,16 @@ describe('ClaimedTaskActionsEditMetadataComponent', () => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsEditMetadataComponent - ], - providers: [ + ClaimedTaskActionsEditMetadataComponent, + ], + providers: [ { provide: ClaimedTaskDataService, useValue: {} }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -62,9 +65,9 @@ describe('ClaimedTaskActionsEditMetadataComponent', () => { { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsEditMetadataComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ClaimedTaskActionsEditMetadataComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts index e5c88efc9b..be43ed6c64 100644 --- a/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts @@ -1,32 +1,47 @@ -import { Component, Injector } from '@angular/core'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { Router, RouterLink } from '@angular/router'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { SearchService } from '../../../../core/shared/search/search.service'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, + Component, + Injector, Injector, } from '@angular/core'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + Router, + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { RequestService } from '../../../../core/data/request.service'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { SearchService } from '../../../../core/shared/search/search.service'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; +import { + SearchService, + SearchService, +} from '../../../../core/shared/search/search.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../notifications/notifications.service'; +import { + ClaimedTaskActionsAbstractComponent, + ClaimedTaskActionsAbstractComponent, +} from '../abstract/claimed-task-actions-abstract.component'; export const WORKFLOW_TASK_OPTION_EDIT_METADATA = 'submit_edit_metadata'; @Component({ - selector: 'ds-claimed-task-actions-edit-metadata', - styleUrls: ['./claimed-task-actions-edit-metadata.component.scss'], - templateUrl: './claimed-task-actions-edit-metadata.component.html', - standalone: true, - imports: [NgIf, NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions-edit-metadata', + styleUrls: ['./claimed-task-actions-edit-metadata.component.scss'], + templateUrl: './claimed-task-actions-edit-metadata.component.html', + standalone: true, + imports: [NgIf, NgbTooltipModule, RouterLink, AsyncPipe, TranslateModule], }) /** * Component for displaying the edit metadata action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts index 63a6d86242..9fc8f5e289 100644 --- a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.spec.ts @@ -53,11 +53,11 @@ describe('AdvancedClaimedTaskActionRatingComponent', () => { searchService = new SearchServiceStub(); await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - AdvancedClaimedTaskActionRatingComponent - ], - providers: [ + AdvancedClaimedTaskActionRatingComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: NotificationsService, useValue: notificationService }, @@ -65,9 +65,9 @@ describe('AdvancedClaimedTaskActionRatingComponent', () => { { provide: Router, useValue: router }, { provide: SearchService, useValue: searchService }, Location, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts index c783539b2e..75fc0072d9 100644 --- a/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts @@ -1,16 +1,21 @@ -import { Component, Injector } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Component, + Component, + Injector, Injector, } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -18,19 +23,21 @@ import { ADVANCED_WORKFLOW_ACTION_RATING, ADVANCED_WORKFLOW_TASK_OPTION_RATING, } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component'; -import { NotificationsService } from '../../../notifications/notifications.service'; +import { + NotificationsService, + NotificationsService, +} from '../../../notifications/notifications.service'; import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * Advanced Workflow button that redirect to the {@link AdvancedWorkflowActionRatingComponent} */ @Component({ - selector: 'ds-advanced-claimed-task-action-rating-reviewer', - templateUrl: './advanced-claimed-task-action-rating.component.html', - styleUrls: ['./advanced-claimed-task-action-rating.component.scss'], - standalone: true, - imports: [NgbTooltipModule, TranslateModule] + selector: 'ds-advanced-claimed-task-action-rating-reviewer', + templateUrl: './advanced-claimed-task-action-rating.component.html', + styleUrls: ['./advanced-claimed-task-action-rating.component.scss'], + standalone: true, + imports: [NgbTooltipModule, TranslateModule], }) export class AdvancedClaimedTaskActionRatingComponent extends AdvancedClaimedTaskActionsAbstractComponent { diff --git a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.spec.ts index 5ea4f4d06c..fb1f42879f 100644 --- a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.spec.ts @@ -61,18 +61,18 @@ describe('ClaimedTaskActionsRejectComponent', () => { beforeEach(waitForAsync(() => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, ReactiveFormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsRejectComponent - ], - providers: [ + ClaimedTaskActionsRejectComponent, + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, Injector, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -82,9 +82,9 @@ describe('ClaimedTaskActionsRejectComponent', () => { { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, UntypedFormBuilder, NgbModal, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsRejectComponent, { + }).overrideComponent(ClaimedTaskActionsRejectComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); fixture = TestBed.createComponent(ClaimedTaskActionsRejectComponent); diff --git a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts index 001e9e9577..b81b82b26f 100644 --- a/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts @@ -1,49 +1,64 @@ -import { Component, Injector, OnInit } from '@angular/core'; -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; - -import { NgbModal, NgbModalRef, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { + Component, Component, Injector, + Injector, + OnInit, OnInit, } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, UntypedFormBuilder, UntypedFormGroup, + UntypedFormGroup, + Validators, Validators, } from '@angular/forms'; import { Router } from '@angular/router'; import { + NgbModal, NgbModal, NgbModalRef, + NgbModalRef, + NgbTooltipModule, } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable, of, } from 'rxjs'; + import { RemoteData } from '../../../../core/data/remote-data'; import { RequestService } from '../../../../core/data/request.service'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { - ClaimedDeclinedTaskSearchResult -} from '../../../object-collection/shared/claimed-declined-task-search-result.model'; -import { AsyncPipe, NgIf } from '@angular/common'; import { SearchService } from '../../../../core/shared/search/search.service'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { ClaimedDeclinedTaskSearchResult } from '../../../object-collection/shared/claimed-declined-task-search-result.model'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; +import { + ClaimedDeclinedTaskSearchResult, + ClaimedDeclinedTaskSearchResult, +} from '../../../object-collection/shared/claimed-declined-task-search-result.model'; +import { + ClaimedTaskActionsAbstractComponent, + ClaimedTaskActionsAbstractComponent, +} from '../abstract/claimed-task-actions-abstract.component'; export const WORKFLOW_TASK_OPTION_REJECT = 'submit_reject'; @Component({ - selector: 'ds-claimed-task-actions-reject', - styleUrls: ['./claimed-task-actions-reject.component.scss'], - templateUrl: './claimed-task-actions-reject.component.html', - standalone: true, - imports: [NgbTooltipModule, NgIf, FormsModule, ReactiveFormsModule, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions-reject', + styleUrls: ['./claimed-task-actions-reject.component.scss'], + templateUrl: './claimed-task-actions-reject.component.html', + standalone: true, + imports: [NgbTooltipModule, NgIf, FormsModule, ReactiveFormsModule, AsyncPipe, TranslateModule], }) /** * Component for displaying and processing the reject action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.spec.ts index da0a393c12..915e1ad4f5 100644 --- a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.spec.ts @@ -49,16 +49,16 @@ describe('ClaimedTaskActionsReturnToPoolComponent', () => { beforeEach(waitForAsync(() => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ClaimedTaskActionsReturnToPoolComponent - ], - providers: [ + ClaimedTaskActionsReturnToPoolComponent, + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -66,9 +66,9 @@ describe('ClaimedTaskActionsReturnToPoolComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskActionsReturnToPoolComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ClaimedTaskActionsReturnToPoolComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts index d7bc7d5055..d6d18ed7be 100644 --- a/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts @@ -1,29 +1,42 @@ -import { Component, Injector } from '@angular/core'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { Observable } from 'rxjs'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, +} from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { Observable } from 'rxjs'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + Observable, +} from 'rxjs'; import { take } from 'rxjs/operators'; + import { RemoteData } from '../../../../core/data/remote-data'; import { RequestService } from '../../../../core/data/request.service'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { PoolTaskDataService } from '../../../../core/tasks/pool-task-data.service'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + ClaimedTaskActionsAbstractComponent, + ClaimedTaskActionsAbstractComponent, +} from '../abstract/claimed-task-actions-abstract.component'; export const WORKFLOW_TASK_OPTION_RETURN_TO_POOL = 'return_to_pool'; @Component({ - selector: 'ds-claimed-task-actions-return-to-pool', - styleUrls: ['./claimed-task-actions-return-to-pool.component.scss'], - templateUrl: './claimed-task-actions-return-to-pool.component.html', - standalone: true, - imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-claimed-task-actions-return-to-pool', + styleUrls: ['./claimed-task-actions-return-to-pool.component.scss'], + templateUrl: './claimed-task-actions-return-to-pool.component.html', + standalone: true, + imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule], }) /** * Component for displaying and processing the return to pool action on a workflow task item diff --git a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts index eb36ef6831..4b12b9bd9a 100644 --- a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts @@ -1,15 +1,19 @@ -import { Component, Injector } from '@angular/core'; import { - AdvancedClaimedTaskActionsAbstractComponent -} from '../abstract/advanced-claimed-task-actions-abstract.component'; -import { ActivatedRoute, Router } from '@angular/router'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; + Component, + Injector, +} from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { RequestService } from '../../../../core/data/request.service'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -17,20 +21,24 @@ import { ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER, ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER, } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { AdvancedClaimedTaskActionsAbstractComponent } from '../abstract/advanced-claimed-task-actions-abstract.component'; -import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; +import { + NotificationsService, + NotificationsService, +} from '../../../notifications/notifications.service'; +import { + AdvancedClaimedTaskActionsAbstractComponent, + AdvancedClaimedTaskActionsAbstractComponent, +} from '../abstract/advanced-claimed-task-actions-abstract.component'; /** * Advanced Workflow button that redirect to the {@link AdvancedWorkflowActionSelectReviewerComponent} */ @Component({ - selector: 'ds-advanced-claimed-task-action-select-reviewer', - templateUrl: './advanced-claimed-task-action-select-reviewer.component.html', - styleUrls: ['./advanced-claimed-task-action-select-reviewer.component.scss'], - standalone: true, - imports: [NgbTooltipModule, TranslateModule] + selector: 'ds-advanced-claimed-task-action-select-reviewer', + templateUrl: './advanced-claimed-task-action-select-reviewer.component.html', + styleUrls: ['./advanced-claimed-task-action-select-reviewer.component.scss'], + standalone: true, + imports: [NgbTooltipModule, TranslateModule], }) export class AdvancedClaimedTaskActionSelectReviewerComponent extends AdvancedClaimedTaskActionsAbstractComponent { diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.ts index 51bda7cf25..13961db9e1 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.ts @@ -1,36 +1,34 @@ +import { + ADVANCED_WORKFLOW_TASK_OPTION_RATING, + AdvancedWorkflowActionRatingComponent, +} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component'; +import { + ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER, + AdvancedWorkflowActionSelectReviewerComponent, +} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component'; import { hasNoValue } from '../../../empty.util'; import { ClaimedTaskActionsApproveComponent, - WORKFLOW_TASK_OPTION_APPROVE + WORKFLOW_TASK_OPTION_APPROVE, } from '../approve/claimed-task-actions-approve.component'; import { ClaimedTaskActionsDeclineTaskComponent, - WORKFLOW_TASK_OPTION_DECLINE_TASK + WORKFLOW_TASK_OPTION_DECLINE_TASK, } from '../decline-task/claimed-task-actions-decline-task.component'; import { ClaimedTaskActionsEditMetadataComponent, - WORKFLOW_TASK_OPTION_EDIT_METADATA + WORKFLOW_TASK_OPTION_EDIT_METADATA, } from '../edit-metadata/claimed-task-actions-edit-metadata.component'; -import { - ADVANCED_WORKFLOW_TASK_OPTION_RATING, - AdvancedWorkflowActionRatingComponent -} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component'; import { AdvancedClaimedTaskActionRatingComponent } from '../rating/advanced-claimed-task-action-rating.component'; import { ClaimedTaskActionsRejectComponent, - WORKFLOW_TASK_OPTION_REJECT + WORKFLOW_TASK_OPTION_REJECT, } from '../reject/claimed-task-actions-reject.component'; import { ClaimedTaskActionsReturnToPoolComponent, - WORKFLOW_TASK_OPTION_RETURN_TO_POOL + WORKFLOW_TASK_OPTION_RETURN_TO_POOL, } from '../return-to-pool/claimed-task-actions-return-to-pool.component'; -import { - ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER, - AdvancedWorkflowActionSelectReviewerComponent -} from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component'; -import { - AdvancedClaimedTaskActionSelectReviewerComponent -} from '../select-reviewer/advanced-claimed-task-action-select-reviewer.component'; +import { AdvancedClaimedTaskActionSelectReviewerComponent } from '../select-reviewer/advanced-claimed-task-action-select-reviewer.component'; export type WorkflowTaskOptionComponent = typeof ClaimedTaskActionsApproveComponent | @@ -52,12 +50,12 @@ export const WORKFLOW_TASK_OPTION_DECORATOR_MAP = new Map([ [ADVANCED_WORKFLOW_TASK_OPTION_RATING, AdvancedWorkflowActionRatingComponent], - [ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER, AdvancedWorkflowActionSelectReviewerComponent] + [ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER, AdvancedWorkflowActionSelectReviewerComponent], ]); /** diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts index 05a1b0488d..0ab1821b20 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts @@ -8,17 +8,21 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { ThemeService } from 'src/app/shared/theme-support/theme.service'; + import { RequestService } from '../../../../core/data/request.service'; import { Item } from '../../../../core/shared/item.model'; import { SearchService } from '../../../../core/shared/search/search.service'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { ClaimedTaskDataService } from '../../../../core/tasks/claimed-task-data.service'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { PoolTaskDataService } from '../../../../core/tasks/pool-task-data.service'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { DynamicComponentLoaderDirective } from '../../../abstract-component-loader/dynamic-component-loader.directive'; import { getMockRequestService } from '../../../mocks/request.service.mock'; import { getMockSearchService } from '../../../mocks/search-service.mock'; @@ -76,13 +80,13 @@ describe('ClaimedTaskActionsLoaderComponent', () => { themeService = getMockThemeService('dspace'); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), + imports: [TranslateModule.forRoot(), ClaimedTaskActionsLoaderComponent, ClaimedTaskActionsEditMetadataComponent, DynamicComponentLoaderDirective, ], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + schemas: [NO_ERRORS_SCHEMA], + providers: [ { provide: ClaimedTaskDataService, useValue: {} }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -92,8 +96,8 @@ describe('ClaimedTaskActionsLoaderComponent', () => { { provide: PoolTaskDataService, useValue: {} }, { provide: ThemeService, useValue: themeService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], -}).overrideComponent(ClaimedTaskActionsLoaderComponent, { + ], + }).overrideComponent(ClaimedTaskActionsLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, entryComponents: [ClaimedTaskActionsEditMetadataComponent], diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts index 174869c1b9..bda1c765b0 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts @@ -3,15 +3,13 @@ import { EventEmitter, Input, Output, -Type, } from '@angular/core'; +} from '@angular/core'; import { GenericConstructor } from '../../../../core/shared/generic-constructor'; import { Item } from '../../../../core/shared/item.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; -import { - AbstractComponentLoaderComponent -} from '../../../abstract-component-loader/abstract-component-loader.component'; +import { AbstractComponentLoaderComponent } from '../../../abstract-component-loader/abstract-component-loader.component'; import { MyDSpaceActionsResult } from '../../mydspace-actions'; import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; import { getComponentByWorkflowTaskOption } from './claimed-task-actions-decorator'; diff --git a/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts b/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts index fa5a2e7b3f..066ec3df29 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.spec.ts @@ -8,7 +8,10 @@ import { TestBed, waitForAsync, } from '@angular/core/testing'; -import { Router, RouterLink } from '@angular/router'; +import { + Router, + RouterLink, +} from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -71,26 +74,26 @@ const requestServce = getMockRequestService(); describe('ItemActionsComponent', () => { beforeEach(waitForAsync(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ItemActionsComponent - ], - providers: [ + ItemActionsComponent, + ], + providers: [ { provide: Injector, useValue: {} }, { provide: Router, useValue: new RouterStub() }, { provide: ItemDataService, useValue: mockDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemActionsComponent, { - remove: {imports: [RouterLink]}, + }).overrideComponent(ItemActionsComponent, { + remove: { imports: [RouterLink] }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/item/item-actions.component.ts b/src/app/shared/mydspace-actions/item/item-actions.component.ts index 4bbf670566..469637b32e 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.ts @@ -1,12 +1,24 @@ -import { Component, Injector, Input, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + Injector, + Input, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; + import { ItemDataService } from '../../../core/data/item-data.service'; import { RequestService } from '../../../core/data/request.service'; import { Item } from '../../../core/shared/item.model'; import { SearchService } from '../../../core/shared/search/search.service'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { NotificationsService } from '../../notifications/notifications.service'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; @@ -14,11 +26,11 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; * This component represents mydspace actions related to Item object. */ @Component({ - selector: 'ds-item-actions', - styleUrls: ['./item-actions.component.scss'], - templateUrl: './item-actions.component.html', - standalone: true, - imports: [NgbTooltipModule, RouterLink, TranslateModule] + selector: 'ds-item-actions', + styleUrls: ['./item-actions.component.scss'], + templateUrl: './item-actions.component.html', + standalone: true, + imports: [NgbTooltipModule, RouterLink, TranslateModule], }) export class ItemActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/mydspace-actions/mydspace-actions.module.ts b/src/app/shared/mydspace-actions/mydspace-actions.module.ts index c7e5c86fc8..4ac0f19c03 100644 --- a/src/app/shared/mydspace-actions/mydspace-actions.module.ts +++ b/src/app/shared/mydspace-actions/mydspace-actions.module.ts @@ -7,15 +7,12 @@ */ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; + import { ClaimedTaskActionsApproveComponent } from './claimed-task/approve/claimed-task-actions-approve.component'; import { ClaimedTaskActionsComponent } from './claimed-task/claimed-task-actions.component'; -import { - ClaimedTaskActionsEditMetadataComponent -} from './claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component'; +import { ClaimedTaskActionsEditMetadataComponent } from './claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component'; import { ClaimedTaskActionsRejectComponent } from './claimed-task/reject/claimed-task-actions-reject.component'; -import { - ClaimedTaskActionsReturnToPoolComponent -} from './claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component'; +import { ClaimedTaskActionsReturnToPoolComponent } from './claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component'; import { ClaimedTaskActionsLoaderComponent } from './claimed-task/switcher/claimed-task-actions-loader.component'; import { ItemActionsComponent } from './item/item-actions.component'; import { PoolTaskActionsComponent } from './pool-task/pool-task-actions.component'; @@ -43,16 +40,16 @@ const DECLARATIONS = [ * This module contains Item actions used in MyDSpace */ @NgModule({ - imports: [ - CommonModule, - ...DECLARATIONS - ], - providers: [ - ...ENTRY_COMPONENTS, - ], - exports: [ - ...DECLARATIONS, - ] + imports: [ + CommonModule, + ...DECLARATIONS, + ], + providers: [ + ...ENTRY_COMPONENTS, + ], + exports: [ + ...DECLARATIONS, + ], }) export class MyDSpaceActionsModule { diff --git a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts index 6599e599fc..1d0d231503 100644 --- a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts +++ b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts @@ -8,7 +8,10 @@ import { fakeAsync, TestBed, } from '@angular/core/testing'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -31,10 +34,10 @@ import { createFailedRemoteDataObject, createSuccessfulRemoteDataObject, } from '../remote-data.utils'; +import { ActivatedRouteStub } from '../testing/active-router.stub'; import { NotificationsServiceStub } from '../testing/notifications-service.stub'; import { RouterStub } from '../testing/router.stub'; import { PoolTaskActionsComponent } from './pool-task/pool-task-actions.component'; -import { ActivatedRouteStub } from '../testing/active-router.stub'; let mockDataService: PoolTaskDataService; let mockClaimedTaskDataService: ClaimedTaskDataService; @@ -89,16 +92,16 @@ describe('MyDSpaceReloadableActionsComponent', () => { mockDataService = new PoolTaskDataService(null, null, null, null); mockClaimedTaskDataService = new ClaimedTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - PoolTaskActionsComponent - ], - providers: [ + PoolTaskActionsComponent, + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -106,10 +109,10 @@ describe('MyDSpaceReloadableActionsComponent', () => { { provide: ClaimedTaskDataService, useValue: mockClaimedTaskDataService }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PoolTaskActionsComponent, { + }).overrideComponent(PoolTaskActionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts index 8e245db141..c469b91cc4 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts @@ -1,8 +1,22 @@ -import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ChangeDetectionStrategy, + Injector, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { RequestService } from '../../../core/data/request.service'; @@ -19,10 +33,10 @@ import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; import { NotificationsService } from '../../notifications/notifications.service'; import { PoolTaskSearchResult } from '../../object-collection/shared/pool-task-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; import { PoolTaskActionsComponent } from './pool-task-actions.component'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; let mockDataService: PoolTaskDataService; let mockClaimedTaskDataService: ClaimedTaskDataService; @@ -77,16 +91,16 @@ describe('PoolTaskActionsComponent', () => { mockDataService = new PoolTaskDataService(null, null, null, null); mockClaimedTaskDataService = new ClaimedTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - PoolTaskActionsComponent - ], - providers: [ + PoolTaskActionsComponent, + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -95,9 +109,9 @@ describe('PoolTaskActionsComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PoolTaskActionsComponent, { + }).overrideComponent(PoolTaskActionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts index b86d644486..35b75b3aa1 100644 --- a/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts +++ b/src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts @@ -1,9 +1,27 @@ -import { Component, Injector, Input, OnDestroy } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; - +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, + Input, + OnDestroy, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { switchMap, take } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + switchMap, + take, +} from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; @@ -16,8 +34,6 @@ import { PoolTask } from '../../../core/tasks/models/pool-task-object.model'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; import { PoolTaskDataService } from '../../../core/tasks/pool-task-data.service'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { NotificationsService } from '../../notifications/notifications.service'; import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actions'; @@ -25,11 +41,11 @@ import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actio * This component represents mydspace actions related to PoolTask object. */ @Component({ - selector: 'ds-pool-task-actions', - styleUrls: ['./pool-task-actions.component.scss'], - templateUrl: './pool-task-actions.component.html', - standalone: true, - imports: [NgbTooltipModule, NgIf, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-pool-task-actions', + styleUrls: ['./pool-task-actions.component.scss'], + templateUrl: './pool-task-actions.component.html', + standalone: true, + imports: [NgbTooltipModule, NgIf, RouterLink, AsyncPipe, TranslateModule], }) export class PoolTaskActionsComponent extends MyDSpaceReloadableActionsComponent implements OnDestroy { diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts index 3c2517a05b..1662a946d7 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts @@ -9,7 +9,10 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateLoader, TranslateModule, @@ -26,10 +29,10 @@ import { getMockSearchService } from '../../mocks/search-service.mock'; import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; import { NotificationsService } from '../../notifications/notifications.service'; import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; import { WorkflowitemActionsComponent } from './workflowitem-actions.component'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; let component: WorkflowitemActionsComponent; let fixture: ComponentFixture; @@ -77,16 +80,16 @@ mockObject = Object.assign(new WorkflowItem(), { item: observableOf(rd), id: '12 describe('WorkflowitemActionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - WorkflowitemActionsComponent - ], - providers: [ + WorkflowitemActionsComponent, + ], + providers: [ { provide: Injector, useValue: {} }, { provide: Router, useValue: new RouterStub() }, { provide: WorkflowItemDataService, useValue: mockDataService }, @@ -94,9 +97,9 @@ describe('WorkflowitemActionsComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkflowitemActionsComponent, { + }).overrideComponent(WorkflowitemActionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts index 3246ae0cc2..47972e6b5e 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts @@ -3,15 +3,21 @@ import { Injector, Input, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { RequestService } from '../../../core/data/request.service'; import { SearchService } from '../../../core/shared/search/search.service'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { NotificationsService } from '../../notifications/notifications.service'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; @@ -19,11 +25,11 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; * This component represents actions related to WorkflowItem object. */ @Component({ - selector: 'ds-workflowitem-actions', - styleUrls: ['./workflowitem-actions.component.scss'], - templateUrl: './workflowitem-actions.component.html', - standalone: true, - imports: [NgbTooltipModule, RouterLink, TranslateModule] + selector: 'ds-workflowitem-actions', + styleUrls: ['./workflowitem-actions.component.scss'], + templateUrl: './workflowitem-actions.component.html', + standalone: true, + imports: [NgbTooltipModule, RouterLink, TranslateModule], }) export class WorkflowitemActionsComponent extends MyDSpaceActionsComponent { diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts index 98471cd745..fa66730981 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts @@ -1,9 +1,19 @@ -import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ChangeDetectionStrategy, + Injector, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Router } from '@angular/router'; +import { + ActivatedRoute, + Router, + Router, +} from '@angular/router'; import { NgbModal, NgbModule, @@ -17,7 +27,10 @@ import { of as observableOf } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { RequestService } from '../../../core/data/request.service'; -import { EPerson } from '../../../core/eperson/models/eperson.model'; +import { + EPerson, + EPerson, +} from '../../../core/eperson/models/eperson.model'; import { Item } from '../../../core/shared/item.model'; import { SearchService } from '../../../core/shared/search/search.service'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; @@ -31,10 +44,10 @@ import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../remote-data.utils'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; import { WorkspaceitemActionsComponent } from './workspaceitem-actions.component'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; let component: WorkspaceitemActionsComponent; let fixture: ComponentFixture; @@ -168,18 +181,18 @@ describe('WorkspaceitemActionsComponent', () => { authorizationService = jasmine.createSpyObj('authorizationService', { isAuthorized: observableOf(true), }); - await TestBed.configureTestingModule({ - imports: [ + await TestBed.configureTestingModule({ + imports: [ NgbModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - WorkspaceitemActionsComponent - ], - providers: [ + WorkspaceitemActionsComponent, + ], + providers: [ Injector, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -190,9 +203,9 @@ describe('WorkspaceitemActionsComponent', () => { { provide: AuthorizationDataService, useValue: authorizationService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, NgbModal, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkspaceitemActionsComponent, { + }).overrideComponent(WorkspaceitemActionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index 313e6a9c6b..64dfd9f7aa 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -1,12 +1,25 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Injector, Input, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { NgbModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService, TranslateModule } from '@ngx-translate/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -28,7 +41,6 @@ import { SearchService } from '../../../core/shared/search/search.service'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { WorkspaceitemDataService } from '../../../core/submission/workspaceitem-data.service'; import { getWorkspaceItemViewRoute } from '../../../workspaceitems-edit-page/workspaceitems-edit-page-routing-paths'; -import { NgIf, AsyncPipe } from '@angular/common'; import { NotificationsService } from '../../notifications/notifications.service'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; @@ -36,11 +48,11 @@ import { MyDSpaceActionsComponent } from '../mydspace-actions'; * This component represents actions related to WorkspaceItem object. */ @Component({ - selector: 'ds-workspaceitem-actions', - styleUrls: ['./workspaceitem-actions.component.scss'], - templateUrl: './workspaceitem-actions.component.html', - standalone: true, - imports: [NgbTooltipModule, RouterLink, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-workspaceitem-actions', + styleUrls: ['./workspaceitem-actions.component.scss'], + templateUrl: './workspaceitem-actions.component.html', + standalone: true, + imports: [NgbTooltipModule, RouterLink, NgIf, AsyncPipe, TranslateModule], }) export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent implements OnInit { diff --git a/src/app/shared/ng-for-track-by-id.directive.ts b/src/app/shared/ng-for-track-by-id.directive.ts index a82e14cec9..d36df6a6e8 100644 --- a/src/app/shared/ng-for-track-by-id.directive.ts +++ b/src/app/shared/ng-for-track-by-id.directive.ts @@ -7,9 +7,9 @@ import { import { DSpaceObject } from '../core/shared/dspace-object.model'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: '[ngForTrackById]', - standalone: true + // eslint-disable-next-line @angular-eslint/directive-selector + selector: '[ngForTrackById]', + standalone: true, }) export class NgForTrackByIdDirective { diff --git a/src/app/shared/notifications/notification/notification.component.spec.ts b/src/app/shared/notifications/notification/notification.component.spec.ts index 01b61f140c..5b44ad40a4 100644 --- a/src/app/shared/notifications/notification/notification.component.spec.ts +++ b/src/app/shared/notifications/notification/notification.component.spec.ts @@ -51,25 +51,25 @@ describe('NotificationComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, BrowserAnimationsModule, StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - NotificationComponent - ], - providers: [ + NotificationComponent, + ], + providers: [ { provide: Store, useValue: store }, ChangeDetectorRef, NotificationsService, TranslateService, ], -}).compileComponents(); // compile template and css + }).compileComponents(); // compile template and css })); diff --git a/src/app/shared/notifications/notification/notification.component.ts b/src/app/shared/notifications/notification/notification.component.ts index dcedc1a2af..7e71fa3996 100644 --- a/src/app/shared/notifications/notification/notification.component.ts +++ b/src/app/shared/notifications/notification/notification.component.ts @@ -1,4 +1,11 @@ import { trigger } from '@angular/animations'; +import { + AsyncPipe, + NgClass, + NgIf, + NgStyle, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -66,27 +73,26 @@ import { isNotEmpty } from '../../empty.util'; import { INotification } from '../models/notification.model'; import { NotificationAnimationsStatus } from '../models/notification-animations-type'; import { NotificationsService } from '../notifications.service'; -import { NgIf, NgStyle, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-notification', - encapsulation: ViewEncapsulation.None, - animations: [ - trigger('enterLeave', [ - fadeInEnter, fadeInState, fadeOutLeave, fadeOutState, - fromBottomEnter, fromBottomInState, fromBottomLeave, fromBottomOutState, - fromRightEnter, fromRightInState, fromRightLeave, fromRightOutState, - fromLeftEnter, fromLeftInState, fromLeftLeave, fromLeftOutState, - fromTopEnter, fromTopInState, fromTopLeave, fromTopOutState, - rotateInState, rotateEnter, rotateOutState, rotateLeave, + selector: 'ds-notification', + encapsulation: ViewEncapsulation.None, + animations: [ + trigger('enterLeave', [ + fadeInEnter, fadeInState, fadeOutLeave, fadeOutState, + fromBottomEnter, fromBottomInState, fromBottomLeave, fromBottomOutState, + fromRightEnter, fromRightInState, fromRightLeave, fromRightOutState, + fromLeftEnter, fromLeftInState, fromLeftLeave, fromLeftOutState, + fromTopEnter, fromTopInState, fromTopLeave, fromTopOutState, + rotateInState, rotateEnter, rotateOutState, rotateLeave, scaleInState, scaleEnter, scaleOutState, scaleLeave, ]), - ], - templateUrl: './notification.component.html', - styleUrls: ['./notification.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [NgIf, NgStyle, NgClass, NgTemplateOutlet, AsyncPipe] + ], + templateUrl: './notification.component.html', + styleUrls: ['./notification.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, NgStyle, NgClass, NgTemplateOutlet, AsyncPipe], }) export class NotificationComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts index 8ed2a5a752..8a4ea204ac 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts @@ -35,22 +35,22 @@ describe('NotificationsBoardComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, BrowserAnimationsModule, StoreModule.forRoot({ notificationsReducer }, { - runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false, - }, + runtimeChecks: { + strictStateImmutability: false, + strictActionImmutability: false, + }, }), - NotificationsBoardComponent, NotificationComponent - ], - providers: [ + NotificationsBoardComponent, NotificationComponent, + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, - ChangeDetectorRef - ], -}).compileComponents(); // compile template and css + ChangeDetectorRef, + ], + }).compileComponents(); // compile template and css })); beforeEach(inject([NotificationsService, Store], (service: NotificationsService, store: Store) => { diff --git a/src/app/shared/notifications/notifications-board/notifications-board.component.ts b/src/app/shared/notifications/notifications-board/notifications-board.component.ts index 24732d1671..51d60368ab 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.ts @@ -1,3 +1,7 @@ +import { + NgClass, + NgFor, +} from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -20,20 +24,19 @@ import { import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces'; import { AppState } from '../../../app.reducer'; import { INotification } from '../models/notification.model'; +import { NotificationComponent } from '../notification/notification.component'; import { NotificationsState } from '../notifications.reducers'; import { NotificationsService } from '../notifications.service'; import { notificationsStateSelector } from '../selectors'; -import { NotificationComponent } from '../notification/notification.component'; -import { NgClass, NgFor } from '@angular/common'; @Component({ - selector: 'ds-notifications-board', - encapsulation: ViewEncapsulation.None, - templateUrl: './notifications-board.component.html', - styleUrls: ['./notifications-board.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [NgClass, NgFor, NotificationComponent] + selector: 'ds-notifications-board', + encapsulation: ViewEncapsulation.None, + templateUrl: './notifications-board.component.html', + styleUrls: ['./notifications-board.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgClass, NgFor, NotificationComponent], }) export class NotificationsBoardComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/notifications/notifications.reducers.spec.ts b/src/app/shared/notifications/notifications.reducers.spec.ts index 2995917bb6..87e5069930 100644 --- a/src/app/shared/notifications/notifications.reducers.spec.ts +++ b/src/app/shared/notifications/notifications.reducers.spec.ts @@ -29,15 +29,15 @@ describe('Notifications reducer', () => { beforeEach(async () => { TestBed.configureTestingModule({ - providers: [ + providers: [ NotificationsService, ChangeDetectorRef, - ], - imports: [ + ], + imports: [ StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), - NotificationComponent, NotificationsBoardComponent - ], -}); + NotificationComponent, NotificationsBoardComponent, + ], + }); options = new NotificationOptions( 0, diff --git a/src/app/shared/notifications/notifications.service.spec.ts b/src/app/shared/notifications/notifications.service.spec.ts index e54d4fcc9b..86ecdb663b 100644 --- a/src/app/shared/notifications/notifications.service.spec.ts +++ b/src/app/shared/notifications/notifications.service.spec.ts @@ -36,22 +36,22 @@ describe('NotificationsService test', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - NotificationComponent, NotificationsBoardComponent - ], - providers: [ + NotificationComponent, NotificationsBoardComponent, + ], + providers: [ { provide: Store, useValue: store }, NotificationsService, TranslateService, ], -}); + }); service = TestBed.inject(NotificationsService); })); diff --git a/src/app/shared/object-collection/object-collection.component.spec.ts b/src/app/shared/object-collection/object-collection.component.spec.ts index a4c3e7d145..f712e8e6fc 100644 --- a/src/app/shared/object-collection/object-collection.component.spec.ts +++ b/src/app/shared/object-collection/object-collection.component.spec.ts @@ -9,17 +9,17 @@ import { ActivatedRoute, Router, } from '@angular/router'; +import { provideMockStore } from '@ngrx/store/testing'; import { of as observableOf } from 'rxjs'; import { ViewMode } from '../../core/shared/view-mode.model'; -import { RouterStub } from '../testing/router.stub'; -import { ObjectCollectionComponent } from './object-collection.component'; -import { provideMockStore } from '@ngrx/store/testing'; -import { ThemeService } from '../theme-support/theme.service'; import { getMockThemeService } from '../mocks/theme-service.mock'; import { ObjectDetailComponent } from '../object-detail/object-detail.component'; import { ObjectGridComponent } from '../object-grid/object-grid.component'; import { ThemedObjectListComponent } from '../object-list/themed-object-list.component'; +import { RouterStub } from '../testing/router.stub'; +import { ThemeService } from '../theme-support/theme.service'; +import { ObjectCollectionComponent } from './object-collection.component'; describe('ObjectCollectionComponent', () => { let fixture: ComponentFixture; @@ -40,16 +40,16 @@ describe('ObjectCollectionComponent', () => { { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useClass: RouterStub }, { provide: ThemeService, useValue: getMockThemeService() }, - provideMockStore() + provideMockStore(), ], schemas: [NO_ERRORS_SCHEMA], }) - .overrideComponent(ObjectCollectionComponent, { - remove: { - imports: [ ThemedObjectListComponent, ObjectGridComponent, ObjectDetailComponent] - } - }) - .compileComponents(); // compile template and css + .overrideComponent(ObjectCollectionComponent, { + remove: { + imports: [ ThemedObjectListComponent, ObjectGridComponent, ObjectDetailComponent], + }, + }) + .compileComponents(); // compile template and css })); diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index 1c029ae1f5..2b21c339af 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -1,4 +1,9 @@ -import { AsyncPipe, isPlatformBrowser, NgClass, NgIf } from '@angular/common'; +import { + AsyncPipe, + isPlatformBrowser, + NgClass, + NgIf, +} from '@angular/common'; import { ChangeDetectorRef, Component, @@ -10,34 +15,43 @@ import { Output, PLATFORM_ID, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { Observable } from 'rxjs'; -import { distinctUntilChanged, map, } from 'rxjs/operators'; +import { + distinctUntilChanged, + map, +} from 'rxjs/operators'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { Context } from '../../core/shared/context.model'; import { PageInfo } from '../../core/shared/page-info.model'; import { ViewMode } from '../../core/shared/view-mode.model'; import { isEmpty } from '../empty.util'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { setPlaceHolderAttributes } from '../utils/object-list-utils'; -import { CollectionElementLinkType } from './collection-element-link.type'; import { ObjectDetailComponent } from '../object-detail/object-detail.component'; import { ObjectGridComponent } from '../object-grid/object-grid.component'; import { ThemedObjectListComponent } from '../object-list/themed-object-list.component'; +import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; +import { setPlaceHolderAttributes } from '../utils/object-list-utils'; +import { CollectionElementLinkType } from './collection-element-link.type'; import { ListableObject } from './shared/listable-object.model'; /** * Component that can render a list of listable objects in different view modes */ @Component({ - selector: 'ds-viewable-collection', - styleUrls: ['./object-collection.component.scss'], - templateUrl: './object-collection.component.html', - standalone: true, - imports: [NgIf, ThemedObjectListComponent, NgClass, ObjectGridComponent, ObjectDetailComponent, AsyncPipe] + selector: 'ds-viewable-collection', + styleUrls: ['./object-collection.component.scss'], + templateUrl: './object-collection.component.html', + standalone: true, + imports: [NgIf, ThemedObjectListComponent, NgClass, ObjectGridComponent, ObjectDetailComponent, AsyncPipe], }) export class ObjectCollectionComponent implements OnInit { /** diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts index 1604b10fc7..8d3a9a6a37 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts @@ -6,9 +6,9 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { TranslateModule } from '@ngx-translate/core'; -import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service'; import { environment } from 'src/environments/environment'; +import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service'; import { Item } from '../../../../../core/shared/item.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; import { TruncatePipe } from '../../../../utils/truncate.pipe'; @@ -62,12 +62,12 @@ describe('ItemAccessStatusBadgeComponent', () => { function initTestBed() { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), AccessStatusBadgeComponent, TruncatePipe], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + imports: [TranslateModule.forRoot(), AccessStatusBadgeComponent, TruncatePipe], + schemas: [NO_ERRORS_SCHEMA], + providers: [ { provide: AccessStatusDataService, useValue: accessStatusDataService }, ], -}).compileComponents(); + }).compileComponents(); } function initFixtureAndComponent() { diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index c5baf6a9ff..ef2beadf46 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -1,7 +1,12 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -17,17 +22,15 @@ import { environment } from 'src/environments/environment'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; import { Item } from '../../../../../core/shared/item.model'; import { ITEM } from '../../../../../core/shared/item.resource-type'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf, AsyncPipe } from '@angular/common'; import { hasValue } from '../../../../empty.util'; import { AccessStatusObject } from './access-status.model'; @Component({ - selector: 'ds-access-status-badge', - templateUrl: './access-status-badge.component.html', - styleUrls: ['./access-status-badge.component.scss'], - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + selector: 'ds-access-status-badge', + templateUrl: './access-status-badge.component.html', + styleUrls: ['./access-status-badge.component.scss'], + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule], }) /** * Component rendering the access status of an item as a badge diff --git a/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts index 19da26dae5..7c7526641b 100644 --- a/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component.ts @@ -11,10 +11,10 @@ import { AccessStatusBadgeComponent } from './access-status-badge.component'; * Themed wrapper for AccessStatusBadgeComponent */ @Component({ - selector: 'ds-themed-access-status-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-access-status-badge', + styleUrls: [], + templateUrl: '../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedAccessStatusBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/badges.component.spec.ts b/src/app/shared/object-collection/shared/badges/badges.component.spec.ts index 3c78a62650..907bb7efdc 100644 --- a/src/app/shared/object-collection/shared/badges/badges.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/badges.component.spec.ts @@ -14,11 +14,11 @@ describe('BadgesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [BadgesComponent], - providers: [{ provide: ThemeService, useValue: getMockThemeService() }], + imports: [BadgesComponent], + providers: [{ provide: ThemeService, useValue: getMockThemeService() }], schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/object-collection/shared/badges/badges.component.ts b/src/app/shared/object-collection/shared/badges/badges.component.ts index 3d0d2aaca8..fa63a92d1f 100644 --- a/src/app/shared/object-collection/shared/badges/badges.component.ts +++ b/src/app/shared/object-collection/shared/badges/badges.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { Component, Input, @@ -6,10 +7,9 @@ import { Context } from 'src/app/core/shared/context.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { ThemedAccessStatusBadgeComponent } from './access-status-badge/themed-access-status-badge.component'; -import { ThemedTypeBadgeComponent } from './type-badge/themed-type-badge.component'; import { ThemedMyDSpaceStatusBadgeComponent } from './my-dspace-status-badge/themed-my-dspace-status-badge.component'; -import { NgIf } from '@angular/common'; import { ThemedStatusBadgeComponent } from './status-badge/themed-status-badge.component'; +import { ThemedTypeBadgeComponent } from './type-badge/themed-type-badge.component'; /** * List of MyDSpace Status Contexts @@ -28,11 +28,11 @@ const MY_DSPACE_STATUS_CONTEXTS = [ * Component that renders all the badges for a listable object */ @Component({ - selector: 'ds-badges', - templateUrl: './badges.component.html', - styleUrls: ['./badges.component.scss'], - standalone: true, - imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent] + selector: 'ds-badges', + templateUrl: './badges.component.html', + styleUrls: ['./badges.component.scss'], + standalone: true, + imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], }) export class BadgesComponent { /** diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts index ed81b6376a..1d53a9d763 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts @@ -35,17 +35,17 @@ mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rd describe('MyDSpaceItemStatusComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - MyDSpaceStatusBadgeComponent - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MyDSpaceStatusBadgeComponent, { + MyDSpaceStatusBadgeComponent, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(MyDSpaceStatusBadgeComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts index cfbd42aa30..a41edd2c2c 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts @@ -3,18 +3,18 @@ import { Input, OnInit, } from '@angular/core'; -import { Context } from 'src/app/core/shared/context.model'; import { TranslateModule } from '@ngx-translate/core'; +import { Context } from 'src/app/core/shared/context.model'; /** * This component represents a badge with mydspace item status */ @Component({ - selector: 'ds-my-dspace-status-badge', - styleUrls: ['./my-dspace-status-badge.component.scss'], - templateUrl: './my-dspace-status-badge.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-my-dspace-status-badge', + styleUrls: ['./my-dspace-status-badge.component.scss'], + templateUrl: './my-dspace-status-badge.component.html', + standalone: true, + imports: [TranslateModule], }) export class MyDSpaceStatusBadgeComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts index 98d4a1324a..c022783075 100644 --- a/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component.ts @@ -11,10 +11,10 @@ import { MyDSpaceStatusBadgeComponent } from './my-dspace-status-badge.component * Themed wrapper for MyDSpaceStatusBadge */ @Component({ - selector: 'ds-themed-my-dspace-status-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-my-dspace-status-badge', + styleUrls: [], + templateUrl: '../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedMyDSpaceStatusBadgeComponent extends ThemedComponent { @Input() context: Context; diff --git a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.spec.ts index 44ba3635bc..7671adea69 100644 --- a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.spec.ts @@ -25,9 +25,9 @@ let notPrivateItem = Object.assign(new Item(), { isDiscoverable: true }); describe('ItemStatusBadgeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), StatusBadgeComponent, TruncatePipe], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(StatusBadgeComponent, { + imports: [TranslateModule.forRoot(), StatusBadgeComponent, TruncatePipe], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(StatusBadgeComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); init(); diff --git a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts index 0352e6da4d..5b9c52e767 100644 --- a/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts @@ -1,19 +1,19 @@ +import { NgIf } from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; import { hasValue } from '../../../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-status-badge', - templateUrl: './status-badge.component.html', - standalone: true, - imports: [NgIf, TranslateModule] + selector: 'ds-status-badge', + templateUrl: './status-badge.component.html', + standalone: true, + imports: [NgIf, TranslateModule], }) /** * Component rendering the status of an item as a badge diff --git a/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts b/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts index f38ebec0a7..68e1522995 100644 --- a/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component.ts @@ -11,10 +11,10 @@ import { StatusBadgeComponent } from './status-badge.component'; * Themed wrapper for StatusBadgeComponent */ @Component({ - selector: 'ds-themed-status-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-status-badge', + styleUrls: [], + templateUrl: '../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedStatusBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/themed-badges.component.ts b/src/app/shared/object-collection/shared/badges/themed-badges.component.ts index 9446d92fb7..34e5259fe7 100644 --- a/src/app/shared/object-collection/shared/badges/themed-badges.component.ts +++ b/src/app/shared/object-collection/shared/badges/themed-badges.component.ts @@ -12,10 +12,10 @@ import { BadgesComponent } from './badges.component'; * Themed wrapper for BadgesComponent */ @Component({ - selector: 'ds-themed-badges', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-badges', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedBadgesComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts b/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts index 4adc4ff132..7829bf2166 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component.ts @@ -11,10 +11,10 @@ import { TypeBadgeComponent } from './type-badge.component'; * Themed wrapper for TypeBadgeComponent */ @Component({ - selector: 'ds-themed-type-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-type-badge', + styleUrls: [], + templateUrl: '../../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedTypeBadgeComponent extends ThemedComponent { @Input() object: DSpaceObject; diff --git a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts index e196af5a13..8fc0d9762b 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts @@ -47,9 +47,9 @@ const mockItemWithoutEntityType = Object.assign(new Item(), { describe('ItemTypeBadgeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), TypeBadgeComponent, TruncatePipe], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(TypeBadgeComponent, { + imports: [TranslateModule.forRoot(), TypeBadgeComponent, TruncatePipe], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(TypeBadgeComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts index d9dae6f3e7..6293b03709 100644 --- a/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts +++ b/src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts @@ -1,16 +1,22 @@ -import { Component, Input, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { getResourceTypeValueFor } from '../../../../../core/cache/object-cache.reducer'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; -import { hasValue, isEmpty, } from '../../../../empty.util'; +import { + hasValue, + isEmpty, +} from '../../../../empty.util'; @Component({ - selector: 'ds-type-badge', - templateUrl: './type-badge.component.html', - standalone: true, - imports: [NgIf, TranslateModule] + selector: 'ds-type-badge', + templateUrl: './type-badge.component.html', + standalone: true, + imports: [NgIf, TranslateModule], }) /** * Component rendering the type of an item as a badge diff --git a/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts b/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts index 3e2511a504..6862559ba3 100644 --- a/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts +++ b/src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts @@ -4,15 +4,15 @@ import { Input, Output, } from '@angular/core'; - -import { ListableObject } from '../listable-object.model'; import { TranslateModule } from '@ngx-translate/core'; +import { ListableObject } from '../listable-object.model'; + @Component({ - selector: 'ds-importable-list-item-control', - templateUrl: './importable-list-item-control.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-importable-list-item-control', + templateUrl: './importable-list-item-control.component.html', + standalone: true, + imports: [TranslateModule], }) /** * Component adding an import button to a list item diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts index cd73facea8..495450be75 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts @@ -1,28 +1,38 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { provideMockStore } from '@ngrx/store/testing'; -import { TranslateModule } from '@ngx-translate/core'; - -import { Context } from '../../../../core/shared/context.model'; -import { GenericConstructor } from '../../../../core/shared/generic-constructor'; -import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { DynamicComponentLoaderDirective } from '../../../abstract-component-loader/dynamic-component-loader.directive'; import { - ItemListElementComponent -} from '../../../object-list/item-list-element/item-types/item/item-list-element.component'; -import { ThemeService } from '../../../theme-support/theme.service'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP } from '../../../../../config/app-config.interface'; + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; -import { of } from 'rxjs'; +import { provideMockStore } from '@ngrx/store/testing'; import { REQUEST } from '@nguniversal/express-engine/tokens'; -import { AuthRequestServiceStub } from 'src/app/shared/testing/auth-request-service.stub'; +import { TranslateModule } from '@ngx-translate/core'; +import { of } from 'rxjs'; import { AuthRequestService } from 'src/app/core/auth/auth-request.service'; -import { CookieServiceMock } from 'src/app/shared/mocks/cookie.service.mock'; import { CookieService } from 'src/app/core/services/cookie.service'; import { HardRedirectService } from 'src/app/core/services/hard-redirect.service'; +import { CookieServiceMock } from 'src/app/shared/mocks/cookie.service.mock'; import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; +import { AuthRequestServiceStub } from 'src/app/shared/testing/auth-request-service.stub'; + +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, +} from '../../../../../config/app-config.interface'; +import { Context } from '../../../../core/shared/context.model'; +import { GenericConstructor } from '../../../../core/shared/generic-constructor'; import { ListableModule } from '../../../../core/shared/listable.module'; +import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { DynamicComponentLoaderDirective } from '../../../abstract-component-loader/dynamic-component-loader.directive'; +import { ItemListElementComponent } from '../../../object-list/item-list-element/item-types/item/item-list-element.component'; +import { ThemeService } from '../../../theme-support/theme.service'; import { ListableObject } from '../listable-object.model'; import { ListableObjectComponentLoaderComponent } from './listable-object-component-loader.component'; @@ -53,7 +63,7 @@ describe('ListableObjectComponentLoaderComponent', () => { ListableObjectComponentLoaderComponent, ListableModule, ItemListElementComponent, - DynamicComponentLoaderDirective + DynamicComponentLoaderDirective, ], schemas: [NO_ERRORS_SCHEMA], providers: [ @@ -63,8 +73,8 @@ describe('ListableObjectComponentLoaderComponent', () => { { provide: REQUEST, useValue: {} }, { provide: ActivatedRoute, - useValue: { data: of({ dso: { payload: {} } }), params: of({}) } - }, + useValue: { data: of({ dso: { payload: {} } }), params: of({}) }, + }, provideMockStore({}), { provide: ThemeService, useValue: getMockThemeService('dspace') }, { provide: APP_CONFIG, useValue: { browseBy: { showThumbnails: true } } }, @@ -73,7 +83,7 @@ describe('ListableObjectComponentLoaderComponent', () => { }).overrideComponent(ListableObjectComponentLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, - } + }, }).compileComponents(); })); diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts index ccd56e0dbf..484c28c018 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts @@ -18,10 +18,10 @@ import { ListableObject } from '../listable-object.model'; import { getListableObjectComponent } from './listable-object.decorator'; @Component({ - selector: 'ds-listable-object-component-loader', - styleUrls: ['./listable-object-component-loader.component.scss'], - templateUrl: '../../../abstract-component-loader/abstract-component-loader.component.html', - standalone: true, + selector: 'ds-listable-object-component-loader', + styleUrls: ['./listable-object-component-loader.component.scss'], + templateUrl: '../../../abstract-component-loader/abstract-component-loader.component.html', + standalone: true, }) /** * Component for determining what component to use depending on the item's entity type (dspace.entity.type) diff --git a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts index 8fb71c2c03..9836736b76 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts @@ -1,6 +1,22 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { EMPTY, Observable, } from 'rxjs'; -import { map, mergeMap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + EMPTY, + Observable, +} from 'rxjs'; +import { + map, + mergeMap, +} from 'rxjs/operators'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; @@ -10,19 +26,16 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { isNotEmpty } from '../../../empty.util'; import { followLink } from '../../../utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; /** * This component represents a badge with collection information. */ @Component({ - selector: 'ds-item-collection', - styleUrls: ['./item-collection.component.scss'], - templateUrl: './item-collection.component.html', - standalone: true, - imports: [NgIf, RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-item-collection', + styleUrls: ['./item-collection.component.scss'], + templateUrl: './item-collection.component.html', + standalone: true, + imports: [NgIf, RouterLink, AsyncPipe, TranslateModule], }) export class ItemCollectionComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts index 84a8806f44..26388cde60 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts @@ -37,20 +37,20 @@ mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rd describe('ItemSubmitterComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - ItemSubmitterComponent - ], - providers: [ + ItemSubmitterComponent, + ], + providers: [ { provide: LinkService, useValue: getMockLinkService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemSubmitterComponent, { + }).overrideComponent(ItemSubmitterComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts index 73d7a245c3..5f71640359 100644 --- a/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts +++ b/src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts @@ -1,8 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, OnInit, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { EMPTY, Observable, @@ -20,18 +25,16 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { isNotEmpty } from '../../../empty.util'; import { followLink } from '../../../utils/follow-link-config.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf, AsyncPipe } from '@angular/common'; /** * This component represents a badge with submitter information. */ @Component({ - selector: 'ds-item-submitter', - styleUrls: ['./item-submitter.component.scss'], - templateUrl: './item-submitter.component.html', - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + selector: 'ds-item-submitter', + styleUrls: ['./item-submitter.component.scss'], + templateUrl: './item-submitter.component.html', + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule], }) export class ItemSubmitterComponent implements OnInit { diff --git a/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts b/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts index e2d7d6fd8f..9da5a40d08 100644 --- a/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts +++ b/src/app/shared/object-collection/shared/object-collection-element/abstract-listable-element.component.ts @@ -13,9 +13,9 @@ import { CollectionElementLinkType } from '../../collection-element-link.type'; import { ListableObject } from '../listable-object.model'; @Component({ - selector: 'ds-abstract-object-element', - template: ``, - standalone: true + selector: 'ds-abstract-object-element', + template: ``, + standalone: true, }) export class AbstractListableElementComponent { diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts index ce44dec20a..8ed4a593ec 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts @@ -53,15 +53,15 @@ describe('SelectableListItemControlComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [FormsModule, SelectableListItemControlComponent, VarDirective, TranslateModule.forRoot()], - providers: [ + imports: [FormsModule, SelectableListItemControlComponent, VarDirective, TranslateModule.forRoot()], + providers: [ { - provide: SelectableListService, + provide: SelectableListService, useValue: selectionService, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts index 62ceec8a7f..4a923f7e16 100644 --- a/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts +++ b/src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, @@ -5,11 +9,9 @@ import { OnInit, Output, } from '@angular/core'; -import { Observable } from 'rxjs'; import { FormsModule } from '@angular/forms'; -import { NgIf, AsyncPipe } from '@angular/common'; -import { VarDirective } from '../../../utils/var.directive'; import { TranslateModule } from '@ngx-translate/core'; +import { Observable } from 'rxjs'; import { map, skip, @@ -17,14 +19,15 @@ import { } from 'rxjs/operators'; import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; +import { VarDirective } from '../../../utils/var.directive'; import { ListableObject } from '../listable-object.model'; @Component({ - selector: 'ds-selectable-list-item-control', - // styleUrls: ['./selectable-list-item-control.component.scss'], - templateUrl: './selectable-list-item-control.component.html', - standalone: true, - imports: [VarDirective, NgIf, FormsModule, AsyncPipe, TranslateModule] + selector: 'ds-selectable-list-item-control', + // styleUrls: ['./selectable-list-item-control.component.scss'], + templateUrl: './selectable-list-item-control.component.html', + standalone: true, + imports: [VarDirective, NgIf, FormsModule, AsyncPipe, TranslateModule], }) /** * Component for rendering list item that has a control (checkbox or radio button) because it's selectable diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts index 88f5a2b1a8..56efce18ce 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts @@ -77,14 +77,14 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('ClaimedTaskSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, VarDirective, ClaimedTaskSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, VarDirective, ClaimedTaskSearchResultDetailElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: LinkService, useValue: linkService }, { provide: ObjectCacheService, useValue: objectCacheServiceMock }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedTaskSearchResultDetailElementComponent, { + }).overrideComponent(ClaimedTaskSearchResultDetailElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts index 993bb95199..e3d3b89e12 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnDestroy, @@ -12,45 +16,57 @@ import { mergeMap, tap, } from 'rxjs/operators'; -import { Context } from 'src/app/core/shared/context.model'; +import { + Context, + Context, +} from 'src/app/core/shared/context.model'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { LinkService } from '../../../../core/cache/builders/link.service'; -import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; +import { + LinkService, + LinkService, +} from '../../../../core/cache/builders/link.service'; +import { + ObjectCacheService, + ObjectCacheService, +} from '../../../../core/cache/object-cache.service'; import { RemoteData } from '../../../../core/data/remote-data'; -import { Item } from '../../../../core/shared/item.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { + Item, + Item, +} from '../../../../core/shared/item.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../empty.util'; +import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component'; import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { followLink } from '../../../utils/follow-link-config.model'; -import { LinkService } from '../../../../core/cache/builders/link.service'; -import { Item } from '../../../../core/shared/item.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { hasValue, isNotEmpty } from '../../../empty.util'; -import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; -import { Context } from 'src/app/core/shared/context.model'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component'; import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; -import { NgIf, AsyncPipe } from '@angular/common'; import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; /** * This component renders claimed task object for the search result in the detail view. */ @Component({ - selector: 'ds-claimed-task-search-result-detail-element', - styleUrls: ['../search-result-detail-element.component.scss'], - templateUrl: './claimed-task-search-result-detail-element.component.html', - standalone: true, - imports: [NgIf, ItemDetailPreviewComponent, ClaimedTaskActionsComponent, AsyncPipe] + selector: 'ds-claimed-task-search-result-detail-element', + styleUrls: ['../search-result-detail-element.component.scss'], + templateUrl: './claimed-task-search-result-detail-element.component.html', + standalone: true, + imports: [NgIf, ItemDetailPreviewComponent, ClaimedTaskActionsComponent, AsyncPipe], }) @listableObjectComponent(ClaimedTaskSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts index ff5051263b..93a244a95a 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts @@ -56,21 +56,21 @@ const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), { describe('ItemDetailPreviewFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - ItemDetailPreviewFieldComponent, TruncatePipe - ], - providers: [ + ItemDetailPreviewFieldComponent, TruncatePipe, + ], + providers: [ { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemDetailPreviewFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemDetailPreviewFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts index 61caa6a111..b49759d009 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts @@ -1,23 +1,26 @@ +import { + NgFor, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../../../core/shared/item.model'; import { Metadata } from '../../../../../core/shared/metadata.utils'; -import { SearchResult } from '../../../../search/models/search-result.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf, NgFor } from '@angular/common'; import { MetadataFieldWrapperComponent } from '../../../../metadata-field-wrapper/metadata-field-wrapper.component'; +import { SearchResult } from '../../../../search/models/search-result.model'; /** * This component show values for the given item metadata */ @Component({ - selector: 'ds-item-detail-preview-field', - templateUrl: './item-detail-preview-field.component.html', - standalone: true, - imports: [MetadataFieldWrapperComponent, NgIf, NgFor, TranslateModule] + selector: 'ds-item-detail-preview-field', + templateUrl: './item-detail-preview-field.component.html', + standalone: true, + imports: [MetadataFieldWrapperComponent, NgIf, NgFor, TranslateModule], }) export class ItemDetailPreviewFieldComponent { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts index e6688bcf31..b7eb800764 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts @@ -16,6 +16,7 @@ import { } from '@ngx-translate/core'; import { Observable } from 'rxjs'; +import { AuthService } from '../../../../core/auth/auth.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; @@ -29,7 +30,12 @@ import { Bitstream } from '../../../../core/shared/bitstream.model'; import { FileService } from '../../../../core/shared/file.service'; import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service'; import { Item } from '../../../../core/shared/item.model'; +import { SearchService } from '../../../../core/shared/search/search.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; import { NotificationsService } from '../../../notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../remote-data.utils'; @@ -41,12 +47,6 @@ import { TruncatePipe } from '../../../utils/truncate.pipe'; import { VarDirective } from '../../../utils/var.directive'; import { ItemDetailPreviewComponent } from './item-detail-preview.component'; import { ItemDetailPreviewFieldComponent } from './item-detail-preview-field/item-detail-preview-field.component'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { SearchService } from '../../../../core/shared/search/search.service'; -import { SearchServiceStub } from '../../../../shared/testing/search-service.stub'; function getMockFileService(): FileService { return jasmine.createSpyObj('FileService', { @@ -99,17 +99,17 @@ describe('ItemDetailPreviewComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - ItemDetailPreviewComponent, ItemDetailPreviewFieldComponent, TruncatePipe, FileSizePipe, VarDirective - ], - providers: [ + ItemDetailPreviewComponent, ItemDetailPreviewFieldComponent, TruncatePipe, FileSizePipe, VarDirective, + ], + providers: [ { provide: FileService, useValue: getMockFileService() }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: ObjectCacheService, useValue: {} }, @@ -126,9 +126,9 @@ describe('ItemDetailPreviewComponent', () => { { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: SearchService, useValue: new SearchServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemDetailPreviewComponent, { + }).overrideComponent(ItemDetailPreviewComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts index 933957c4dd..5b46138af2 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts @@ -1,4 +1,13 @@ -import { Component, Input, } from '@angular/core'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { first } from 'rxjs/operators'; @@ -10,33 +19,27 @@ import { FileService } from '../../../../core/shared/file.service'; import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service'; import { Item } from '../../../../core/shared/item.model'; import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators'; -import { fadeInOut } from '../../../animations/fade'; -import { SearchResult } from '../../../search/models/search-result.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { FileSizePipe } from '../../../utils/file-size-pipe'; -import { - ItemSubmitterComponent -} from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; -import { ItemDetailPreviewFieldComponent } from './item-detail-preview-field/item-detail-preview-field.component'; -import { VarDirective } from '../../../utils/var.directive'; +import { ThemedItemPageTitleFieldComponent } from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { fadeInOut } from '../../../animations/fade'; import { MetadataFieldWrapperComponent } from '../../../metadata-field-wrapper/metadata-field-wrapper.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; +import { ItemSubmitterComponent } from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; +import { SearchResult } from '../../../search/models/search-result.model'; +import { FileSizePipe } from '../../../utils/file-size-pipe'; +import { VarDirective } from '../../../utils/var.directive'; +import { ItemDetailPreviewFieldComponent } from './item-detail-preview-field/item-detail-preview-field.component'; /** * This component show metadata for the given item object in the detail view. */ @Component({ - selector: 'ds-item-detail-preview', - styleUrls: ['./item-detail-preview.component.scss'], - templateUrl: './item-detail-preview.component.html', - animations: [fadeInOut], - standalone: true, - imports: [NgIf, ThemedBadgesComponent, ThemedItemPageTitleFieldComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, VarDirective, NgFor, ItemDetailPreviewFieldComponent, ItemSubmitterComponent, AsyncPipe, FileSizePipe, TranslateModule] + selector: 'ds-item-detail-preview', + styleUrls: ['./item-detail-preview.component.scss'], + templateUrl: './item-detail-preview.component.html', + animations: [fadeInOut], + standalone: true, + imports: [NgIf, ThemedBadgesComponent, ThemedItemPageTitleFieldComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, VarDirective, NgFor, ItemDetailPreviewFieldComponent, ItemSubmitterComponent, AsyncPipe, FileSizePipe, TranslateModule], }) export class ItemDetailPreviewComponent { /** diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts index bfcf06ce63..c53d883269 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts @@ -9,8 +9,9 @@ import { } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; -import { Context } from '../../../../core/shared/context.model'; + import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; @@ -57,12 +58,12 @@ mockResultObject.indexableObject = Object.assign(new Item(), { describe('ItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, ItemSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, ItemSearchResultDetailElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemSearchResultDetailElementComponent, { + }).overrideComponent(ItemSearchResultDetailElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts index 166c0fc969..29ff35e895 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts @@ -3,21 +3,21 @@ import { Component } from '@angular/core'; import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; -import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component'; import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; +import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; /** * This component renders item object for the search result in the detail view. */ @Component({ - selector: 'ds-item-search-result-detail-element', - styleUrls: ['../search-result-detail-element.component.scss', './item-search-result-detail-element.component.scss'], - templateUrl: './item-search-result-detail-element.component.html', - standalone: true, - imports: [ItemDetailPreviewComponent, ItemActionsComponent] + selector: 'ds-item-search-result-detail-element', + styleUrls: ['../search-result-detail-element.component.scss', './item-search-result-detail-element.component.scss'], + templateUrl: './item-search-result-detail-element.component.html', + standalone: true, + imports: [ItemDetailPreviewComponent, ItemActionsComponent], }) @listableObjectComponent(ItemSearchResult, ViewMode.DetailedListElement, Context.Workspace) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts index a8a87912ac..a4808a8360 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts @@ -1,5 +1,15 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + flush, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -8,6 +18,7 @@ import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; +import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; @@ -16,7 +27,6 @@ import { getMockLinkService } from '../../../mocks/link-service.mock'; import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { VarDirective } from '../../../utils/var.directive'; -import { Context } from '../../../../core/shared/context.model'; import { PoolSearchResultDetailElementComponent } from './pool-search-result-detail-element.component'; let component: PoolSearchResultDetailElementComponent; @@ -68,17 +78,17 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('PoolSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, VarDirective, PoolSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, VarDirective, PoolSearchResultDetailElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: (mockResultObject) }, { provide: 'indexElementProvider', useValue: (compIndex) }, { provide: LinkService, useValue: linkService }, { provide: ObjectCacheService, useValue: objectCacheServiceMock }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PoolSearchResultDetailElementComponent, { - add: { changeDetection: ChangeDetectionStrategy.Default } + }).overrideComponent(PoolSearchResultDetailElementComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts index f44a9deb8a..80341b5137 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts @@ -1,6 +1,21 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { BehaviorSubject, EMPTY, Observable, } from 'rxjs'; -import { mergeMap, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + BehaviorSubject, + EMPTY, + Observable, +} from 'rxjs'; +import { + mergeMap, + tap, +} from 'rxjs/operators'; import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -12,24 +27,26 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; -import { hasValue, isNotEmpty, } from '../../../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../../empty.util'; +import { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model'; import { followLink } from '../../../utils/follow-link-config.model'; -import { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; -import { AsyncPipe, NgIf } from '@angular/common'; import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; /** * This component renders pool task object for the search result in the detail view. */ @Component({ - selector: 'ds-pool-search-result-detail-element', - styleUrls: ['../search-result-detail-element.component.scss'], - templateUrl: './pool-search-result-detail-element.component.html', - standalone: true, - imports: [NgIf, ItemDetailPreviewComponent, PoolTaskActionsComponent, AsyncPipe] + selector: 'ds-pool-search-result-detail-element', + styleUrls: ['../search-result-detail-element.component.scss'], + templateUrl: './pool-search-result-detail-element.component.html', + standalone: true, + imports: [NgIf, ItemDetailPreviewComponent, PoolTaskActionsComponent, AsyncPipe], }) @listableObjectComponent(PoolTaskSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts index 2764d69b32..5dcac20189 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts @@ -1,20 +1,21 @@ -import { Component, OnInit, } from '@angular/core'; +import { + Component, + OnInit, +} from '@angular/core'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { Metadata } from '../../../core/shared/metadata.utils'; import { hasValue } from '../../empty.util'; -import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { SearchResult } from '../../search/models/search-result.model'; /** * Component representing Search Results with ViewMode.DetailedElement */ @Component({ - selector: 'ds-search-result-detail-element', - template: ``, - standalone: true + selector: 'ds-search-result-detail-element', + template: ``, + standalone: true, }) export class SearchResultDetailElementComponent, K extends DSpaceObject> extends AbstractListableElementComponent implements OnInit { diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts index bbea68529c..87de14c7aa 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts @@ -65,15 +65,15 @@ mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: obs describe('WorkflowItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, WorkflowItemSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkflowItemSearchResultDetailElementComponent], + providers: [ { provide: 'objectElementProvider', useValue: (mockResultObject) }, { provide: 'indexElementProvider', useValue: (compIndex) }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkflowItemSearchResultDetailElementComponent, { + }).overrideComponent(WorkflowItemSearchResultDetailElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts index 57dbce9970..cd28223013 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts @@ -10,22 +10,22 @@ import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { isNotUndefined } from '../../../empty.util'; +import { WorkflowitemActionsComponent } from '../../../mydspace-actions/workflowitem/workflowitem-actions.component'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model'; import { followLink } from '../../../utils/follow-link-config.model'; -import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; -import { WorkflowitemActionsComponent } from '../../../mydspace-actions/workflowitem/workflowitem-actions.component'; import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; +import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; /** * This component renders workflowitem object for the search result in the detail view. */ @Component({ - selector: 'ds-workflow-item-search-result-detail-element', - styleUrls: ['../search-result-detail-element.component.scss'], - templateUrl: './workflow-item-search-result-detail-element.component.html', - standalone: true, - imports: [ItemDetailPreviewComponent, WorkflowitemActionsComponent] + selector: 'ds-workflow-item-search-result-detail-element', + styleUrls: ['../search-result-detail-element.component.scss'], + templateUrl: './workflow-item-search-result-detail-element.component.html', + standalone: true, + imports: [ItemDetailPreviewComponent, WorkflowitemActionsComponent], }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts index 8aac5dc5e5..a8ba3289b0 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts @@ -13,6 +13,7 @@ import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; +import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; @@ -20,7 +21,6 @@ import { getMockLinkService } from '../../../mocks/link-service.mock'; import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { WorkspaceItemSearchResultDetailElementComponent } from './workspace-item-search-result-detail-element.component'; -import { Context } from '../../../../core/shared/context.model'; let component: WorkspaceItemSearchResultDetailElementComponent; let fixture: ComponentFixture; @@ -66,15 +66,15 @@ mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: ob describe('WorkspaceItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, WorkspaceItemSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkspaceItemSearchResultDetailElementComponent], + providers: [ { provide: 'objectElementProvider', useValue: (mockResultObject) }, { provide: 'indexElementProvider', useValue: (compIndex) }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkspaceItemSearchResultDetailElementComponent, { + }).overrideComponent(WorkspaceItemSearchResultDetailElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts index 6a9f7892c9..5c51e3464f 100644 --- a/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts +++ b/src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts @@ -10,22 +10,22 @@ import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; import { isNotUndefined } from '../../../empty.util'; +import { WorkspaceitemActionsComponent } from '../../../mydspace-actions/workspaceitem/workspaceitem-actions.component'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { WorkspaceItemSearchResult } from '../../../object-collection/shared/workspace-item-search-result.model'; import { followLink } from '../../../utils/follow-link-config.model'; -import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; -import { WorkspaceitemActionsComponent } from '../../../mydspace-actions/workspaceitem/workspaceitem-actions.component'; import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; +import { SearchResultDetailElementComponent } from '../search-result-detail-element.component'; /** * This component renders workspace item object for the search result in the detail view. */ @Component({ - selector: 'ds-workspace-item-search-result-detail-element', - styleUrls: ['../search-result-detail-element.component.scss', './workspace-item-search-result-detail-element.component.scss'], - templateUrl: './workspace-item-search-result-detail-element.component.html', - standalone: true, - imports: [ItemDetailPreviewComponent, WorkspaceitemActionsComponent] + selector: 'ds-workspace-item-search-result-detail-element', + styleUrls: ['../search-result-detail-element.component.scss', './workspace-item-search-result-detail-element.component.scss'], + templateUrl: './workspace-item-search-result-detail-element.component.html', + standalone: true, + imports: [ItemDetailPreviewComponent, WorkspaceitemActionsComponent], }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.DetailedListElement) diff --git a/src/app/shared/object-detail/object-detail.component.spec.ts b/src/app/shared/object-detail/object-detail.component.spec.ts index adb232a217..8f8e5f7a6e 100644 --- a/src/app/shared/object-detail/object-detail.component.spec.ts +++ b/src/app/shared/object-detail/object-detail.component.spec.ts @@ -19,12 +19,12 @@ import { import { buildPaginatedList } from '../../core/data/paginated-list.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { PageInfo } from '../../core/shared/page-info.model'; +import { ThemedLoadingComponent } from '../loading/themed-loading.component'; import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; +import { ListableObjectComponentLoaderComponent } from '../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { PaginationComponent } from '../pagination/pagination.component'; import { createSuccessfulRemoteDataObject } from '../remote-data.utils'; import { ObjectDetailComponent } from './object-detail.component'; -import { PaginationComponent } from '../pagination/pagination.component'; -import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { ListableObjectComponentLoaderComponent } from '../object-collection/shared/listable-object/listable-object-component-loader.component'; describe('ObjectDetailComponent', () => { let comp: ObjectDetailComponent; diff --git a/src/app/shared/object-detail/object-detail.component.ts b/src/app/shared/object-detail/object-detail.component.ts index 1effed795a..0c3098e941 100644 --- a/src/app/shared/object-detail/object-detail.component.ts +++ b/src/app/shared/object-detail/object-detail.component.ts @@ -1,35 +1,46 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation, } from '@angular/core'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + Input, + Output, + ViewEncapsulation, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { Context } from '../../core/shared/context.model'; import { ViewMode } from '../../core/shared/view-mode.model'; import { fadeIn } from '../animations/fade'; +import { ErrorComponent } from '../error/error.component'; +import { ThemedLoadingComponent } from '../loading/themed-loading.component'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../loading/themed-loading.component'; -import { ErrorComponent } from '../error/error.component'; -import { - ListableObjectComponentLoaderComponent -} from '../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgFor, NgIf } from '@angular/common'; +import { ListableObjectComponentLoaderComponent } from '../object-collection/shared/listable-object/listable-object-component-loader.component'; import { PaginationComponent } from '../pagination/pagination.component'; +import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; /** * This component renders a paginated set of results in the detail view. */ @Component({ - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - selector: 'ds-object-detail', - styleUrls: ['./object-detail.component.scss'], - templateUrl: './object-detail.component.html', - animations: [fadeIn], - standalone: true, - imports: [PaginationComponent, NgIf, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, TranslateModule] + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, + selector: 'ds-object-detail', + styleUrls: ['./object-detail.component.scss'], + templateUrl: './object-detail.component.html', + animations: [fadeIn], + standalone: true, + imports: [PaginationComponent, NgIf, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, TranslateModule], }) export class ObjectDetailComponent { /** diff --git a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.spec.ts b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.spec.ts index cc8e7a4d69..27bcf0fe4e 100644 --- a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.spec.ts @@ -8,17 +8,17 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { AuthService } from '../../../core/auth/auth.service'; +import { LinkService } from '../../../core/cache/builders/link.service'; +import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; +import { Collection } from '../../../core/shared/collection.model'; +import { AuthServiceMock } from '../../mocks/auth.service.mock'; +import { getMockThemeService } from '../../mocks/theme-service.mock'; import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { ThemeService } from '../../theme-support/theme.service'; -import { getMockThemeService } from '../../mocks/theme-service.mock'; -import { AuthService } from '../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../mocks/auth.service.mock'; -import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; - -import { LinkService } from '../../../core/cache/builders/link.service'; -import { Collection } from '../../../core/shared/collection.model'; import { CollectionGridElementComponent } from './collection-grid-element.component'; let collectionGridElementComponent: CollectionGridElementComponent; @@ -53,20 +53,20 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CollectionGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - CollectionGridElementComponent - ], - providers: [ + CollectionGridElementComponent, + ], + providers: [ { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }, { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CollectionGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CollectionGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts index d4939a6da6..11aab0c4f9 100644 --- a/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts +++ b/src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts @@ -1,38 +1,45 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { LinkService } from '../../../core/cache/builders/link.service'; -import { Collection } from '../../../core/shared/collection.model'; import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; +import { + LinkService, + LinkService, +} from '../../../core/cache/builders/link.service'; +import { Collection } from '../../../core/shared/collection.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; +import { ThemedThumbnailComponent } from '../../../thumbnail/themed-thumbnail.component'; import { hasNoValue, hasValue, } from '../../empty.util'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; -import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { + AbstractListableElementComponent, + AbstractListableElementComponent, +} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { followLink } from '../../utils/follow-link-config.model'; -import { LinkService } from '../../../core/cache/builders/link.service'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedThumbnailComponent } from '../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe } from '@angular/common'; /** * Component representing a grid element for collection */ @Component({ - selector: 'ds-collection-grid-element', - styleUrls: ['./collection-grid-element.component.scss'], - templateUrl: './collection-grid-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule] + selector: 'ds-collection-grid-element', + styleUrls: ['./collection-grid-element.component.scss'], + templateUrl: './collection-grid-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule], }) @listableObjectComponent(Collection, ViewMode.GridElement) export class CollectionGridElementComponent extends AbstractListableElementComponent< diff --git a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.spec.ts b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.spec.ts index 4831daff3a..28fbb99159 100644 --- a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.spec.ts @@ -8,12 +8,12 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateModule } from '@ngx-translate/core'; import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; +import { TranslateModule } from '@ngx-translate/core'; import { LinkService } from '../../../core/cache/builders/link.service'; import { Community } from '../../../core/shared/community.model'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { CommunityGridElementComponent } from './community-grid-element.component'; let communityGridElementComponent: CommunityGridElementComponent; @@ -48,17 +48,17 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CommunityGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - CommunityGridElementComponent - ], - providers: [ + CommunityGridElementComponent, + ], + providers: [ { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }, { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CommunityGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CommunityGridElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts index d01fbb6b0d..3287903546 100644 --- a/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts +++ b/src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts @@ -1,39 +1,47 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { LinkService } from '../../../core/cache/builders/link.service'; -import { Community } from '../../../core/shared/community.model'; import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; +import { + LinkService, + LinkService, +} from '../../../core/cache/builders/link.service'; +import { Community } from '../../../core/shared/community.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; +import { ThemedThumbnailComponent } from '../../../thumbnail/themed-thumbnail.component'; import { hasNoValue, + hasNoValue, + hasValue, hasValue, } from '../../empty.util'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; -import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { + AbstractListableElementComponent, + AbstractListableElementComponent, +} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { followLink } from '../../utils/follow-link-config.model'; -import { LinkService } from '../../../core/cache/builders/link.service'; -import { hasNoValue, hasValue } from '../../empty.util'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedThumbnailComponent } from '../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe } from '@angular/common'; /** * Component representing a grid element for a community */ @Component({ - selector: 'ds-community-grid-element', - styleUrls: ['./community-grid-element.component.scss'], - templateUrl: './community-grid-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule] + selector: 'ds-community-grid-element', + styleUrls: ['./community-grid-element.component.scss'], + templateUrl: './community-grid-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThemedThumbnailComponent, AsyncPipe, TranslateModule], }) @listableObjectComponent(Community, ViewMode.GridElement) diff --git a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts index fe03557382..65447b428a 100644 --- a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts @@ -62,13 +62,13 @@ describe('ItemGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatePipe, ItemGridElementComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatePipe, ItemGridElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemGridElementComponent, { + }).overrideComponent(ItemGridElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts index 05e0eda8cd..e10ba86a9f 100644 --- a/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts +++ b/src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts @@ -2,26 +2,20 @@ import { Component } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - ItemSearchResultGridElementComponent -} from '../../../search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; import { focusShadow } from '../../../../animations/focus'; +import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { ItemSearchResultGridElementComponent } from '../../../search-result-grid-element/item-search-result/item/item-search-result-grid-element.component'; @listableObjectComponent('Publication', ViewMode.GridElement) @listableObjectComponent(Item, ViewMode.GridElement) @Component({ - selector: 'ds-item-grid-element', - styleUrls: ['./item-grid-element.component.scss'], - templateUrl: './item-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [ItemSearchResultGridElementComponent] + selector: 'ds-item-grid-element', + styleUrls: ['./item-grid-element.component.scss'], + templateUrl: './item-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [ItemSearchResultGridElementComponent], }) /** * The component for displaying a grid element for an item of the type Publication diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index d7ee55b5ea..f4b23340e8 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,39 +12,53 @@ import { Output, ViewEncapsulation, } from '@angular/core'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, } from 'rxjs'; -import { distinctUntilChanged, map, startWith, } from 'rxjs/operators'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Observable, +} from 'rxjs'; +import { + distinctUntilChanged, + map, + startWith, +} from 'rxjs/operators'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { Context } from '../../core/shared/context.model'; import { ViewMode } from '../../core/shared/view-mode.model'; import { fadeIn } from '../animations/fade'; -import { hasNoValue, hasValue, } from '../empty.util'; -import { HostWindowService, WidthCategory, } from '../host-window.service'; -import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; -import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../loading/themed-loading.component'; +import { + hasNoValue, + hasValue, +} from '../empty.util'; import { ErrorComponent } from '../error/error.component'; import { - ListableObjectComponentLoaderComponent -} from '../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; + HostWindowService, + WidthCategory, +} from '../host-window.service'; +import { ThemedLoadingComponent } from '../loading/themed-loading.component'; +import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +import { ListableObject } from '../object-collection/shared/listable-object.model'; +import { ListableObjectComponentLoaderComponent } from '../object-collection/shared/listable-object/listable-object-component-loader.component'; import { PaginationComponent } from '../pagination/pagination.component'; +import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; @Component({ - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - selector: 'ds-object-grid', - styleUrls: ['./object-grid.component.scss'], - templateUrl: './object-grid.component.html', - animations: [fadeIn], - standalone: true, - imports: [PaginationComponent, NgIf, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe] + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, + selector: 'ds-object-grid', + styleUrls: ['./object-grid.component.scss'], + templateUrl: './object-grid.component.html', + animations: [fadeIn], + standalone: true, + imports: [PaginationComponent, NgIf, NgFor, ListableObjectComponentLoaderComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class ObjectGridComponent implements OnInit { diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts index abb45c5046..4080759fdb 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts @@ -9,15 +9,26 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Store } from '@ngrx/store'; -import { TranslateModule } from '@ngx-translate/core'; +import { ActivatedRoute } from '@angular/router'; +import { provideMockStore } from '@ngrx/store/testing'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { LinkService } from '../../../../core/cache/builders/link.service'; +import { AuthService } from '../../../../core/auth/auth.service'; +import { + LinkService, + LinkService, +} from '../../../../core/cache/builders/link.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; +import { + BitstreamFormatDataService, + BitstreamFormatDataService, +} from '../../../../core/data/bitstream-format-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; import { DefaultChangeAnalyzer } from '../../../../core/data/default-change-analyzer.service'; import { DSOChangeAnalyzer } from '../../../../core/data/dso-change-analyzer.service'; @@ -26,17 +37,11 @@ import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service import { UUIDService } from '../../../../core/shared/uuid.service'; import { NotificationsService } from '../../../notifications/notifications.service'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; +import { AuthServiceStub } from '../../../testing/auth-service.stub'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../utils/truncate.pipe'; import { CollectionSearchResultGridElementComponent } from './collection-search-result-grid-element.component'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; -import { LinkService } from '../../../../core/cache/builders/link.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../testing/active-router.stub'; -import { provideMockStore } from '@ngrx/store/testing'; -import { AuthService } from '../../../../core/auth/auth.service'; -import { AuthServiceStub } from '../../../testing/auth-service.stub'; let collectionSearchResultGridElementComponent: CollectionSearchResultGridElementComponent; let fixture: ComponentFixture; @@ -77,12 +82,12 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CollectionSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), TruncatePipe, - CollectionSearchResultGridElementComponent - ], - providers: [ + CollectionSearchResultGridElementComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }, @@ -100,10 +105,10 @@ describe('CollectionSearchResultGridElementComponent', () => { { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamFormatDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, - provideMockStore({}) - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CollectionSearchResultGridElementComponent, { + provideMockStore({}), + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CollectionSearchResultGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts index 217bc597d8..8700541a6c 100644 --- a/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts @@ -1,34 +1,37 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { Collection } from '../../../../core/shared/collection.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; import { hasNoValue, hasValue, } from '../../../empty.util'; +import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { SearchResultGridElementComponent } from '../search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-collection-search-result-grid-element', - styleUrls: ['../search-result-grid-element.component.scss', 'collection-search-result-grid-element.component.scss'], - templateUrl: 'collection-search-result-grid-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule] + selector: 'ds-collection-search-result-grid-element', + styleUrls: ['../search-result-grid-element.component.scss', 'collection-search-result-grid-element.component.scss'], + templateUrl: 'collection-search-result-grid-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule], }) /** * Component representing a grid element for a collection search result diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts index d81a3d97fb..cb34442b70 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts @@ -9,36 +9,42 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; -import { TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { LinkService } from '../../../../core/cache/builders/link.service'; +import { AuthService } from '../../../../core/auth/auth.service'; +import { + LinkService, + LinkService, +} from '../../../../core/cache/builders/link.service'; import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; +import { + BitstreamFormatDataService, + BitstreamFormatDataService, +} from '../../../../core/data/bitstream-format-data.service'; import { CommunityDataService } from '../../../../core/data/community-data.service'; import { DefaultChangeAnalyzer } from '../../../../core/data/default-change-analyzer.service'; import { DSOChangeAnalyzer } from '../../../../core/data/dso-change-analyzer.service'; import { Community } from '../../../../core/shared/community.model'; import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service'; import { UUIDService } from '../../../../core/shared/uuid.service'; +import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; +import { StoreMock } from '../../../../shared/testing/store.mock'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { NotificationsService } from '../../../notifications/notifications.service'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../utils/truncate.pipe'; import { CommunitySearchResultGridElementComponent } from './community-search-result-grid-element.component'; -import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; -import { LinkService } from '../../../../core/cache/builders/link.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../testing/active-router.stub'; -import { StoreMock } from '../../../../shared/testing/store.mock'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { AuthServiceMock } from '../../../../shared/mocks/auth.service.mock'; -import { AuthService } from '../../../../core/auth/auth.service'; let communitySearchResultGridElementComponent: CommunitySearchResultGridElementComponent; let fixture: ComponentFixture; @@ -79,12 +85,12 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CommunitySearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), TruncatePipe, - CommunitySearchResultGridElementComponent - ], - providers: [ + CommunitySearchResultGridElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }, { provide: ObjectCacheService, useValue: {} }, @@ -103,9 +109,9 @@ describe('CommunitySearchResultGridElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: AuthService, useValue: new AuthServiceMock() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CommunitySearchResultGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CommunitySearchResultGridElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts index b186266502..e83182b33a 100644 --- a/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts @@ -1,37 +1,40 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { Community } from '../../../../core/shared/community.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; import { hasNoValue, hasValue, } from '../../../empty.util'; +import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { SearchResultGridElementComponent } from '../search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-community-search-result-grid-element', - styleUrls: [ - '../search-result-grid-element.component.scss', - 'community-search-result-grid-element.component.scss', - ], - templateUrl: 'community-search-result-grid-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule] + selector: 'ds-community-search-result-grid-element', + styleUrls: [ + '../search-result-grid-element.component.scss', + 'community-search-result-grid-element.component.scss', + ], + templateUrl: 'community-search-result-grid-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, AsyncPipe, TranslateModule], }) /** * Component representing a grid element for a community search result diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts index df29cb4b19..317c8f0990 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts @@ -9,6 +9,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { @@ -32,11 +33,10 @@ import { UUIDService } from '../../../../../core/shared/uuid.service'; import { NotificationsService } from '../../../../notifications/notifications.service'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; +import { ActivatedRouteStub } from '../../../../testing/active-router.stub'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../../utils/truncate.pipe'; import { ItemSearchResultGridElementComponent } from './item-search-result-grid-element.component'; -import { ActivatedRouteStub } from '../../../../testing/active-router.stub'; -import { ActivatedRoute } from '@angular/router'; const mockItemWithMetadata: ItemSearchResult = new ItemSearchResult(); mockItemWithMetadata.hitHighlights = {}; @@ -226,29 +226,29 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - TruncatePipe, - component - ], - providers: [ - { provide: TruncatableService, useValue: truncatableServiceStub }, - { provide: ObjectCacheService, useValue: {} }, - { provide: UUIDService, useValue: {} }, - { provide: Store, useValue: {} }, - { provide: RemoteDataBuildService, useValue: {} }, - { provide: CommunityDataService, useValue: {} }, - { provide: HALEndpointService, useValue: {} }, - { provide: HttpClient, useValue: {} }, - { provide: DSOChangeAnalyzer, useValue: {} }, - { provide: NotificationsService, useValue: {} }, - { provide: DefaultChangeAnalyzer, useValue: {} }, - { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + TruncatePipe, + component, + ], + providers: [ + { provide: TruncatableService, useValue: truncatableServiceStub }, + { provide: ObjectCacheService, useValue: {} }, + { provide: UUIDService, useValue: {} }, + { provide: Store, useValue: {} }, + { provide: RemoteDataBuildService, useValue: {} }, + { provide: CommunityDataService, useValue: {} }, + { provide: HALEndpointService, useValue: {} }, + { provide: HttpClient, useValue: {} }, + { provide: DSOChangeAnalyzer, useValue: {} }, + { provide: NotificationsService, useValue: {} }, + { provide: DefaultChangeAnalyzer, useValue: {} }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(component, { + }).overrideComponent(component, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts index b644fa4b9e..c9c56daff1 100644 --- a/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts @@ -1,32 +1,36 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { getItemPageRoute } from '../../../../../item-page/item-page-routing-paths'; +import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; import { focusShadow } from '../../../../animations/focus'; +import { ThemedBadgesComponent } from '../../../../object-collection/shared/badges/themed-badges.component'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; -import { TruncatableService } from '../../../../truncatable/truncatable.service'; -import { SearchResultGridElementComponent } from '../../search-result-grid-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { TruncatablePartComponent } from '../../../../truncatable/truncatable-part/truncatable-part.component'; import { TruncatableComponent } from '../../../../truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../../object-collection/shared/badges/themed-badges.component'; -import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { NgIf, NgFor, AsyncPipe } from '@angular/common'; +import { TruncatableService } from '../../../../truncatable/truncatable.service'; +import { TruncatablePartComponent } from '../../../../truncatable/truncatable-part/truncatable-part.component'; +import { SearchResultGridElementComponent } from '../../search-result-grid-element.component'; @listableObjectComponent('PublicationSearchResult', ViewMode.GridElement) @listableObjectComponent(ItemSearchResult, ViewMode.GridElement) @Component({ - selector: 'ds-item-search-result-grid-element', - styleUrls: ['./item-search-result-grid-element.component.scss'], - templateUrl: './item-search-result-grid-element.component.html', - animations: [focusShadow], - standalone: true, - imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-item-search-result-grid-element', + styleUrls: ['./item-search-result-grid-element.component.scss'], + templateUrl: './item-search-result-grid-element.component.html', + animations: [focusShadow], + standalone: true, + imports: [NgIf, RouterLink, ThemedThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe, TranslateModule], }) /** * The component for displaying a grid element for an item search result of the type Publication diff --git a/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.ts b/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.ts index d18b85f7a4..e8b999fb9f 100644 --- a/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.ts +++ b/src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.ts @@ -14,9 +14,9 @@ import { SearchResult } from '../../search/models/search-result.model'; import { TruncatableService } from '../../truncatable/truncatable.service'; @Component({ - selector: 'ds-search-result-grid-element', - template: ``, - standalone: true + selector: 'ds-search-result-grid-element', + template: ``, + standalone: true, }) export class SearchResultGridElementComponent, K extends DSpaceObject> extends AbstractListableElementComponent implements OnInit { /** diff --git a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts index 04ed4ea963..b566ad7d7f 100644 --- a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts +++ b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts @@ -8,7 +8,6 @@ import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { DSONameServiceMock } from '../../mocks/dso-name.service.mock'; -import { SharedModule } from '../../shared.module'; import { BitstreamListItemComponent } from './bitstream-list-item.component'; describe('BitstreamListItemComponent', () => { @@ -17,10 +16,10 @@ describe('BitstreamListItemComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule, RouterTestingModule, BitstreamListItemComponent], - providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }], -}) - .compileComponents(); + imports: [CommonModule, TranslateModule, RouterTestingModule, BitstreamListItemComponent], + providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }], + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.ts b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.ts index b43739d314..d0a299b0fa 100644 --- a/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.ts +++ b/src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.ts @@ -9,9 +9,9 @@ import { AbstractListableElementComponent } from '../../object-collection/shared @listableObjectComponent(Bitstream, ViewMode.ListElement, Context.Bitstream) @Component({ - selector: 'ds-bitstream-list-item', - template: ` {{object.name}} `, - styleUrls: ['./bitstream-list-item.component.scss'], - standalone: true + selector: 'ds-bitstream-list-item', + template: ` {{object.name}} `, + styleUrls: ['./bitstream-list-item.component.scss'], + standalone: true, }) export class BitstreamListItemComponent extends AbstractListableElementComponent{} diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts index de900b62c9..48887d59c3 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts @@ -8,6 +8,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @@ -15,7 +16,6 @@ import { PaginationService } from '../../../core/pagination/pagination.service'; import { RouteService } from '../../../core/services/route.service'; import { BrowseEntry } from '../../../core/shared/browse-entry.model'; import { DSONameServiceMock } from '../../mocks/dso-name.service.mock'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { TruncatePipe } from '../../utils/truncate.pipe'; import { BrowseEntryListElementComponent } from './browse-entry-list-element.component'; @@ -45,16 +45,16 @@ describe('BrowseEntryListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TruncatePipe, BrowseEntryListElementComponent], - providers: [ + imports: [TruncatePipe, BrowseEntryListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: { mockValue } }, { provide: PaginationService, useValue: paginationService }, { provide: RouteService, useValue: routeService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(BrowseEntryListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(BrowseEntryListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts index c23adb8fb4..6a5a3bebb5 100644 --- a/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts +++ b/src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts @@ -1,15 +1,21 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, OnInit, } from '@angular/core'; -import { Params, RouterLink } from '@angular/router'; +import { + Params, + RouterLink, +} from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { RouteService } from 'src/app/core/services/route.service'; import { BBM_PAGINATION_ID } from '../../../browse-by/browse-by-metadata/browse-by-metadata.component'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { NgIf, AsyncPipe } from '@angular/common'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { BrowseEntry } from '../../../core/shared/browse-entry.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; @@ -17,11 +23,11 @@ import { listableObjectComponent } from '../../object-collection/shared/listable import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; @Component({ - selector: 'ds-browse-entry-list-element', - styleUrls: ['./browse-entry-list-element.component.scss'], - templateUrl: './browse-entry-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, AsyncPipe] + selector: 'ds-browse-entry-list-element', + styleUrls: ['./browse-entry-list-element.component.scss'], + templateUrl: './browse-entry-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, AsyncPipe], }) /** diff --git a/src/app/shared/object-list/bundle-list-element/bundle-list-element.component.ts b/src/app/shared/object-list/bundle-list-element/bundle-list-element.component.ts index 8a74683d49..1f9d0b435d 100644 --- a/src/app/shared/object-list/bundle-list-element/bundle-list-element.component.ts +++ b/src/app/shared/object-list/bundle-list-element/bundle-list-element.component.ts @@ -1,18 +1,20 @@ -import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { Bundle } from '../../../core/shared/bundle.model'; import { Component } from '@angular/core'; -import { Bundle } from '../../../core/shared/bundle.model'; +import { + Bundle, + Bundle, +} from '../../../core/shared/bundle.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; -import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { + AbstractListableElementComponent, + AbstractListableElementComponent, +} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; @Component({ - selector: 'ds-bundle-list-element', - templateUrl: './bundle-list-element.component.html', - standalone: true + selector: 'ds-bundle-list-element', + templateUrl: './bundle-list-element.component.html', + standalone: true, }) /** * This component is automatically used to create a list view for Bundle objects diff --git a/src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts b/src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts index bffb0c8543..6d360c3f5e 100644 --- a/src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts +++ b/src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts @@ -8,11 +8,11 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Collection } from '../../../core/shared/collection.model'; import { DSONameServiceMock } from '../../mocks/dso-name.service.mock'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { CollectionListElementComponent } from './collection-list-element.component'; @@ -67,14 +67,14 @@ const mockCollectionWithoutAbstract: Collection = Object.assign(new Collection() describe('CollectionListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CollectionListElementComponent], - providers: [ + imports: [CollectionListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CollectionListElementComponent, { + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CollectionListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts index 99e555f707..c6a6fe2f1a 100644 --- a/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts +++ b/src/app/shared/object-list/collection-list-element/collection-list-element.component.ts @@ -1,21 +1,21 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Collection } from '../../../core/shared/collection.model'; -import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; -import { RouterLink } from '@angular/router'; -import { NgIf } from '@angular/common'; -import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { + AbstractListableElementComponent, + AbstractListableElementComponent, +} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; @Component({ - selector: 'ds-collection-list-element', - styleUrls: ['./collection-list-element.component.scss'], - templateUrl: './collection-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink] + selector: 'ds-collection-list-element', + styleUrls: ['./collection-list-element.component.scss'], + templateUrl: './collection-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink], }) /** * Component representing list element for a collection diff --git a/src/app/shared/object-list/community-list-element/community-list-element.component.spec.ts b/src/app/shared/object-list/community-list-element/community-list-element.component.spec.ts index 15505d532e..cb34d6719c 100644 --- a/src/app/shared/object-list/community-list-element/community-list-element.component.spec.ts +++ b/src/app/shared/object-list/community-list-element/community-list-element.component.spec.ts @@ -8,11 +8,11 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Community } from '../../../core/shared/community.model'; import { DSONameServiceMock } from '../../mocks/dso-name.service.mock'; -import { ActivatedRoute } from '@angular/router'; import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { CommunityListElementComponent } from './community-list-element.component'; @@ -44,14 +44,14 @@ const mockCommunityWithoutAbstract: Community = Object.assign(new Community(), { describe('CommunityListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommunityListElementComponent], - providers: [ + imports: [CommunityListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }, - { provide: ActivatedRoute, useValue: new ActivatedRouteStub() } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CommunityListElementComponent, { + { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CommunityListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/community-list-element/community-list-element.component.ts b/src/app/shared/object-list/community-list-element/community-list-element.component.ts index 8435e803a1..9b0dc1d240 100644 --- a/src/app/shared/object-list/community-list-element/community-list-element.component.ts +++ b/src/app/shared/object-list/community-list-element/community-list-element.component.ts @@ -1,22 +1,22 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { Community } from '../../../core/shared/community.model'; -import { - AbstractListableElementComponent -} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; -import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { RouterLink } from '@angular/router'; -import { NgIf } from '@angular/common'; +import { + AbstractListableElementComponent, + AbstractListableElementComponent, +} from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; @Component({ - selector: 'ds-community-list-element', - styleUrls: ['./community-list-element.component.scss'], - templateUrl: './community-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink] + selector: 'ds-community-list-element', + styleUrls: ['./community-list-element.component.scss'], + templateUrl: './community-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink], }) /** * Component representing a list element for a community diff --git a/src/app/shared/object-list/identifier-data/identifier-data.component.ts b/src/app/shared/object-list/identifier-data/identifier-data.component.ts index 1388454ad1..ecc0bd1ca3 100644 --- a/src/app/shared/object-list/identifier-data/identifier-data.component.ts +++ b/src/app/shared/object-list/identifier-data/identifier-data.component.ts @@ -1,4 +1,12 @@ -import { Component, Input, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { Item } from 'src/app/core/shared/item.model'; @@ -6,8 +14,6 @@ import { Item } from 'src/app/core/shared/item.model'; import { IdentifierDataService } from '../../../core/data/identifier-data.service'; import { hasValue } from '../../empty.util'; import { IdentifierData } from './identifier-data.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-identifier-data', @@ -15,9 +21,9 @@ import { AsyncPipe, NgIf } from '@angular/common'; imports: [ TranslateModule, AsyncPipe, - NgIf + NgIf, ], - standalone: true + standalone: true, }) /** * Component rendering an identifier, eg. DOI or handle diff --git a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts index 8427e8d782..597b3cfae1 100644 --- a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts +++ b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts @@ -7,22 +7,22 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; - -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { Item } from '../../../../../core/shared/item.model'; -import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; import { APP_CONFIG } from 'src/config/app-config.interface'; import { environment } from 'src/environments/environment.test'; -import { ThemeService } from '../../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; + import { AuthService } from '../../../../../core/auth/auth.service'; -import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; +import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service'; +import { Item } from '../../../../../core/shared/item.model'; +import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock'; import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock'; +import { ActivatedRouteStub } from '../../../../../shared/testing/active-router.stub'; +import { ThemeService } from '../../../../../shared/theme-support/theme.service'; +import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../../utils/truncate.pipe'; import { ItemListElementComponent } from './item-list-element.component'; @@ -69,8 +69,8 @@ describe('ItemListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), ItemListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), ItemListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: mockTruncatableService }, { provide: APP_CONFIG, useValue: environment }, @@ -78,9 +78,9 @@ describe('ItemListElementComponent', () => { { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: AuthService, useValue: new AuthServiceMock() }, { provide: AuthorizationDataService, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemListElementComponent, { + }).overrideComponent(ItemListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.ts b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.ts index bef2f10c57..bb4dd66936 100644 --- a/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.ts +++ b/src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.ts @@ -2,24 +2,18 @@ import { Component } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../object-collection/shared/listable-object/listable-object.decorator'; -import { - AbstractListableElementComponent -} from '../../../../object-collection/shared/object-collection-element/abstract-listable-element.component'; -import { - ItemSearchResultListElementComponent -} from '../../../search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; +import { AbstractListableElementComponent } from '../../../../object-collection/shared/object-collection-element/abstract-listable-element.component'; +import { ItemSearchResultListElementComponent } from '../../../search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; @listableObjectComponent('Publication', ViewMode.ListElement) @listableObjectComponent(Item, ViewMode.ListElement) @Component({ - selector: 'ds-item-list-element', - styleUrls: ['./item-list-element.component.scss'], - templateUrl: './item-list-element.component.html', - standalone: true, - imports: [ItemSearchResultListElementComponent] + selector: 'ds-item-list-element', + styleUrls: ['./item-list-element.component.scss'], + templateUrl: './item-list-element.component.html', + standalone: true, + imports: [ItemSearchResultListElementComponent], }) /** * The component for displaying a list element for an item of the type Publication diff --git a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.spec.ts b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.spec.ts index 2c8c1e1221..b7d22c2243 100644 --- a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.spec.ts +++ b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.spec.ts @@ -15,11 +15,11 @@ describe('ListableNotificationObjectComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ListableNotificationObjectComponent - ] -}).compileComponents(); + ListableNotificationObjectComponent, + ], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts index ef14ae2ae3..356ed950d3 100644 --- a/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts +++ b/src/app/shared/object-list/listable-notification-object/listable-notification-object.component.ts @@ -1,11 +1,11 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; import { AbstractListableElementComponent } from '../../object-collection/shared/object-collection-element/abstract-listable-element.component'; import { ListableNotificationObject } from './listable-notification-object.model'; import { LISTABLE_NOTIFICATION_OBJECT } from './listable-notification-object.resource-type'; -import { TranslateModule } from '@ngx-translate/core'; /** * The component for displaying a notifications inside an object list @@ -13,11 +13,11 @@ import { TranslateModule } from '@ngx-translate/core'; @listableObjectComponent(ListableNotificationObject, ViewMode.ListElement) @listableObjectComponent(LISTABLE_NOTIFICATION_OBJECT.value, ViewMode.ListElement) @Component({ - selector: 'ds-listable-notification-object', - templateUrl: './listable-notification-object.component.html', - styleUrls: ['./listable-notification-object.component.scss'], - standalone: true, - imports: [TranslateModule] + selector: 'ds-listable-notification-object', + templateUrl: './listable-notification-object.component.html', + styleUrls: ['./listable-notification-object.component.scss'], + standalone: true, + imports: [TranslateModule], }) export class ListableNotificationObjectComponent extends AbstractListableElementComponent { } diff --git a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts index adb64981e1..b75f8b318e 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts @@ -35,9 +35,9 @@ describe('BrowseLinkMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { void TestBed.configureTestingModule({ - imports: [BrowseLinkMetadataListElementComponent], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(BrowseLinkMetadataListElementComponent, { + imports: [BrowseLinkMetadataListElementComponent], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(BrowseLinkMetadataListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts index bba2ff166e..974b37c129 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts @@ -1,14 +1,15 @@ -import { Component } from '@angular/core'; -import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; -import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; -import { RouterLink } from '@angular/router'; import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + +import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; +import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; @Component({ - selector: 'ds-browse-link-metadata-list-element', - templateUrl: './browse-link-metadata-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink] + selector: 'ds-browse-link-metadata-list-element', + templateUrl: './browse-link-metadata-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink], }) /** * A component for displaying MetadataRepresentation objects in the form of plain text diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts index d1abd86620..293938587f 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts @@ -1,13 +1,16 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { - ItemMetadataRepresentation -} from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-representation/item/item-metadata-representation.model'; +import { ListableObjectComponentLoaderComponent } from '../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { ItemMetadataListElementComponent } from './item-metadata-list-element.component'; const mockItemMetadataRepresentation = new ItemMetadataRepresentation(Object.assign({})); diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts index 9e778b6ddc..d635bb5ca0 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts @@ -1,15 +1,14 @@ import { Component } from '@angular/core'; + import { ViewMode } from '../../../../core/shared/view-mode.model'; -import { - ListableObjectComponentLoaderComponent -} from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; @Component({ - selector: 'ds-item-metadata-list-element', - templateUrl: './item-metadata-list-element.component.html', - standalone: true, - imports: [ListableObjectComponentLoaderComponent] + selector: 'ds-item-metadata-list-element', + templateUrl: './item-metadata-list-element.component.html', + standalone: true, + imports: [ListableObjectComponentLoaderComponent], }) /** * A component for displaying MetadataRepresentation objects in the form of items diff --git a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component.ts index 8898ff6658..7d11870a7e 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component.ts @@ -9,9 +9,9 @@ import { getItemPageRoute } from '../../../../item-page/item-page-routing-paths' import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; @Component({ - selector: 'ds-item-metadata-representation-list-element', - template: '', - standalone: true + selector: 'ds-item-metadata-representation-list-element', + template: '', + standalone: true, }) /** * An abstract class for displaying a single ItemMetadataRepresentation diff --git a/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.spec.ts index a44f5bdc7d..2bba25ebe1 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.spec.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.spec.ts @@ -28,9 +28,9 @@ describe('MetadataRepresentationListElementComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [MetadataRepresentationListElementComponent], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(MetadataRepresentationListElementComponent, { + imports: [MetadataRepresentationListElementComponent], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(MetadataRepresentationListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts index 4df1ec8d4f..e468dc4af9 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts @@ -7,9 +7,9 @@ import { Context } from '../../../core/shared/context.model'; import { MetadataRepresentation } from '../../../core/shared/metadata-representation/metadata-representation.model'; @Component({ - selector: 'ds-metadata-representation-list-element', - template: '', - standalone: true + selector: 'ds-metadata-representation-list-element', + template: '', + standalone: true, }) /** * An abstract class for displaying a single MetadataRepresentation diff --git a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts index 7662bc3d55..e35f7d6759 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts @@ -1,13 +1,18 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; - import { - MetadatumRepresentation -} from '../../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; -import { mockData } from '../../../testing/browse-definition-data-service.stub'; + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; + +import { MetadatumRepresentation } from '../../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; import { ActivatedRouteStub } from '../../../testing/active-router.stub'; +import { mockData } from '../../../testing/browse-definition-data-service.stub'; import { PlainTextMetadataListElementComponent } from './plain-text-metadata-list-element.component'; // Render the mock representation with the default mock author browse definition so it is also rendered as a link @@ -23,10 +28,10 @@ describe('PlainTextMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [PlainTextMetadataListElementComponent], - providers: [{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PlainTextMetadataListElementComponent, { + imports: [PlainTextMetadataListElementComponent], + providers: [{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(PlainTextMetadataListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts index e17b7765b8..00ef60fedb 100644 --- a/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts +++ b/src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts @@ -1,14 +1,15 @@ -import { Component } from '@angular/core'; -import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; -import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; -import { RouterLink } from '@angular/router'; import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + +import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; +import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; @Component({ - selector: 'ds-plain-text-metadata-list-element', - templateUrl: './plain-text-metadata-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink] + selector: 'ds-plain-text-metadata-list-element', + templateUrl: './plain-text-metadata-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink], }) /** * A component for displaying MetadataRepresentation objects in the form of plain text diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts index e2a0ad1377..d077f4495e 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.spec.ts @@ -8,33 +8,45 @@ import { waitForAsync, } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateModule } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { APP_CONFIG } from '../../../../../../config/app-config.interface'; -import { environment } from '../../../../../../environments/environment'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../../../../config/app-config.interface'; +import { + environment, + environment, +} from '../../../../../../environments/environment'; +import { + DSONameService, + DSONameService, +} from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; -import { Context } from '../../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; -import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; +import { + DSONameServiceMock, + DSONameServiceMock, +} from '../../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../mocks/theme-service.mock'; import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../../remote-data.utils'; +import { ThemeService } from '../../../../theme-support/theme.service'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { VarDirective } from '../../../../utils/var.directive'; import { ClaimedApprovedSearchResultListElementComponent } from './claimed-approved-search-result-list-element.component'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; -import { APP_CONFIG } from '../../../../../../config/app-config.interface'; -import { environment } from '../../../../../../environments/environment'; -import { Context } from '../../../../../core/shared/context.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; -import { getMockThemeService } from '../../../../mocks/theme-service.mock'; -import { ThemeService } from '../../../../theme-support/theme.service'; let component: ClaimedApprovedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -80,21 +92,21 @@ const linkService = getMockLinkService(); describe('ClaimedApprovedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, VarDirective, - ClaimedApprovedSearchResultListElementComponent - ], - providers: [ + ClaimedApprovedSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedApprovedSearchResultListElementComponent, { + }).overrideComponent(ClaimedApprovedSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts index 4094ff23b7..c9d1a02b2a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.ts @@ -1,51 +1,59 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Inject, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { Context } from 'src/app/core/shared/context.model'; +import { + Context, + Context, +} from 'src/app/core/shared/context.model'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { RemoteData } from '../../../../../core/data/remote-data'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; import { - ClaimedApprovedTaskSearchResult -} from '../../../../object-collection/shared/claimed-approved-task-search-result.model'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; + ClaimedTask, + ClaimedTask, +} from '../../../../../core/tasks/models/claimed-task-object.model'; +import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model'; import { - listableObjectComponent -} from '../../../../object-collection/shared/listable-object/listable-object.decorator'; + ClaimedTaskSearchResult, + ClaimedTaskSearchResult, +} from '../../../../object-collection/shared/claimed-task-search-result.model'; +import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { followLink } from '../../../../utils/follow-link-config.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, + SearchResultListElementComponent, } from '../../../search-result-list-element/search-result-list-element.component'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; -import { Context } from 'src/app/core/shared/context.model'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-item-list-preview.component'; -import { NgIf, AsyncPipe } from '@angular/common'; -import { SearchResultListElementComponent } from '../../../search-result-list-element/search-result-list-element.component'; /** * This component renders claimed task approved object for the search result in the list view. */ @Component({ - selector: 'ds-claimed-approved-search-result-list-element', - styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './claimed-approved-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule] + selector: 'ds-claimed-approved-search-result-list-element', + styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './claimed-approved-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule], }) @listableObjectComponent(ClaimedApprovedTaskSearchResult, ViewMode.ListElement) export class ClaimedApprovedSearchResultListElementComponent extends SearchResultListElementComponent { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts index de14dac115..b3f45093ba 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.spec.ts @@ -21,14 +21,14 @@ import { WorkflowItem } from '../../../../../core/submission/models/workflowitem import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../mocks/theme-service.mock'; import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../../remote-data.utils'; +import { ThemeService } from '../../../../theme-support/theme.service'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { VarDirective } from '../../../../utils/var.directive'; import { ClaimedDeclinedSearchResultListElementComponent } from './claimed-declined-search-result-list-element.component'; -import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; -import { ThemeService } from '../../../../theme-support/theme.service'; -import { getMockThemeService } from '../../../../mocks/theme-service.mock'; let component: ClaimedDeclinedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -74,21 +74,21 @@ const linkService = getMockLinkService(); describe('ClaimedDeclinedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, VarDirective, - ClaimedDeclinedSearchResultListElementComponent - ], - providers: [ + ClaimedDeclinedSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, { + }).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts index bda91bb2a3..f0b8bea779 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.ts @@ -1,48 +1,59 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Inject, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { - + APP_CONFIG, APP_CONFIG, AppConfig, + AppConfig, } from '../../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { RemoteData } from '../../../../../core/data/remote-data'; -import { Context } from '../../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; +import { + ClaimedTask, + ClaimedTask, +} from '../../../../../core/tasks/models/claimed-task-object.model'; import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; +import { + ClaimedTaskSearchResult, + ClaimedTaskSearchResult, +} from '../../../../object-collection/shared/claimed-task-search-result.model'; import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { followLink } from '../../../../utils/follow-link-config.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, + SearchResultListElementComponent, } from '../../../search-result-list-element/search-result-list-element.component'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; -import { Context } from '../../../../../core/shared/context.model'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-item-list-preview.component'; -import { NgIf, AsyncPipe } from '@angular/common'; -import { SearchResultListElementComponent } from '../../../search-result-list-element/search-result-list-element.component'; /** * This component renders claimed task declined object for the search result in the list view. */ @Component({ - selector: 'ds-claimed-declined-search-result-list-element', - styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './claimed-declined-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule] + selector: 'ds-claimed-declined-search-result-list-element', + styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './claimed-declined-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule], }) @listableObjectComponent(ClaimedDeclinedTaskSearchResult, ViewMode.ListElement) export class ClaimedDeclinedSearchResultListElementComponent extends SearchResultListElementComponent { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts index d9b5844e6b..f0cf9e1b8e 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.spec.ts @@ -20,14 +20,14 @@ import { WorkflowItem } from '../../../../../core/submission/models/workflowitem import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; import { DSONameServiceMock } from '../../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../mocks/theme-service.mock'; import { ClaimedDeclinedTaskTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-task-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../../remote-data.utils'; +import { ThemeService } from '../../../../theme-support/theme.service'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { VarDirective } from '../../../../utils/var.directive'; import { ClaimedDeclinedTaskSearchResultListElementComponent } from './claimed-declined-task-search-result-list-element.component'; -import { mockTruncatableService } from '../../../../mocks/mock-trucatable.service'; -import { ThemeService } from '../../../../theme-support/theme.service'; -import { getMockThemeService } from '../../../../mocks/theme-service.mock'; let component: ClaimedDeclinedTaskSearchResultListElementComponent; let fixture: ComponentFixture; @@ -73,21 +73,21 @@ const linkService = getMockLinkService(); describe('ClaimedDeclinedTaskSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), VarDirective, - ClaimedDeclinedTaskSearchResultListElementComponent - ], - providers: [ + ClaimedDeclinedTaskSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedDeclinedTaskSearchResultListElementComponent, { + }).overrideComponent(ClaimedDeclinedTaskSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts index 4189a28357..9e2c8ff9a0 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.ts @@ -1,49 +1,60 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Inject, - OnInit,} from '@angular/core'; + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { Observable } from 'rxjs'; +import { ClaimedDeclinedTaskTaskSearchResult } from 'src/app/shared/object-collection/shared/claimed-declined-task-task-search-result.model'; + import { - Observable -} from 'rxjs'; -import { - ClaimedDeclinedTaskTaskSearchResult -} from 'src/app/shared/object-collection/shared/claimed-declined-task-task-search-result.model'; -import { APP_CONFIG, + APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; import { RemoteData } from '../../../../../core/data/remote-data'; -import { Context } from '../../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../../core/shared/context.model'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; +import { + ClaimedTask, + ClaimedTask, +} from '../../../../../core/tasks/models/claimed-task-object.model'; +import { + ClaimedTaskSearchResult, + ClaimedTaskSearchResult, +} from '../../../../object-collection/shared/claimed-task-search-result.model'; import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { followLink } from '../../../../utils/follow-link-config.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, + SearchResultListElementComponent, } from '../../../search-result-list-element/search-result-list-element.component'; -import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model'; -import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model'; -import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; -import { Context } from '../../../../../core/shared/context.model'; -import { TranslateModule } from '@ngx-translate/core'; import { ThemedItemListPreviewComponent } from '../../item-list-preview/themed-item-list-preview.component'; -import { NgIf, AsyncPipe } from '@angular/common'; -import { SearchResultListElementComponent } from '../../../search-result-list-element/search-result-list-element.component'; /** * This component renders claimed task declined task object for the search result in the list view. */ @Component({ - selector: 'ds-claimed-declined-task-search-result-list-element', - styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './claimed-declined-task-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule] + selector: 'ds-claimed-declined-task-search-result-list-element', + styleUrls: ['../../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './claimed-declined-task-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ThemedItemListPreviewComponent, AsyncPipe, TranslateModule], }) @listableObjectComponent(ClaimedDeclinedTaskTaskSearchResult, ViewMode.ListElement) export class ClaimedDeclinedTaskSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts index 88b602364d..ac9932b05d 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts @@ -12,6 +12,7 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -23,28 +24,27 @@ import { ConfigurationDataService } from '../../../../core/data/configuration-da import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; +import { SearchService } from '../../../../core/shared/search/search.service'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { SubmissionDuplicateDataService } from '../../../../core/submission/submission-duplicate-data.service'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../mocks/theme-service.mock'; +import { NotificationsService } from '../../../notifications/notifications.service'; import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model'; import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../../remote-data.utils'; +import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; +import { SearchServiceStub } from '../../../testing/search-service.stub'; import { createPaginatedList } from '../../../testing/utils.test'; +import { ThemeService } from '../../../theme-support/theme.service'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { VarDirective } from '../../../utils/var.directive'; import { ClaimedSearchResultListElementComponent } from './claimed-search-result-list-element.component'; -import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; -import { ThemeService } from '../../../theme-support/theme.service'; -import { getMockThemeService } from '../../../mocks/theme-service.mock'; -import { NotificationsService } from '../../../notifications/notifications.service'; -import { NotificationsServiceStub } from '../../../testing/notifications-service.stub'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchServiceStub } from '../../../testing/search-service.stub'; -import { SearchService } from '../../../../core/shared/search/search.service'; let component: ClaimedSearchResultListElementComponent; let fixture: ComponentFixture; @@ -108,13 +108,13 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('ClaimedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, VarDirective, - ClaimedSearchResultListElementComponent - ], - providers: [ + ClaimedSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -125,9 +125,9 @@ describe('ClaimedSearchResultListElementComponent', () => { { provide: ObjectCacheService, useValue: objectCacheServiceMock }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SubmissionDuplicateDataService, useValue: duplicateDataServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ClaimedSearchResultListElementComponent, { + }).overrideComponent(ClaimedSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts index 03557e84e6..83c0800e2f 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, Inject, @@ -13,6 +18,8 @@ import { import { map, mergeMap, + mergeMap, + tap, tap, } from 'rxjs/operators'; @@ -23,41 +30,44 @@ import { import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { Item } from '../../../../core/shared/item.model'; -import { mergeMap, tap } from 'rxjs/operators'; -import { hasValue, isNotEmpty } from '../../../empty.util'; import { ConfigurationDataService } from '../../../../core/data/configuration-data.service'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { ConfigurationProperty } from '../../../../core/shared/configuration-property.model'; import { Context } from '../../../../core/shared/context.model'; -import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component'; -import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component'; -import { NgIf, NgClass, AsyncPipe } from '@angular/common'; -import { Item } from '../../../../core/shared/item.model'; -import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { + Item, + Item, +} from '../../../../core/shared/item.model'; +import { + getFirstCompletedRemoteData, + getFirstCompletedRemoteData, +} from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { SubmissionDuplicateDataService } from '../../../../core/submission/submission-duplicate-data.service'; import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model'; import { hasValue, + hasValue, + isNotEmpty, isNotEmpty, } from '../../../empty.util'; +import { ClaimedTaskActionsComponent } from '../../../mydspace-actions/claimed-task/claimed-task-actions.component'; import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { Duplicate } from '../../duplicate-data/duplicate.model'; import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; +import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component'; @Component({ - selector: 'ds-claimed-search-result-list-element', - styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './claimed-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ThemedItemListPreviewComponent, NgClass, ClaimedTaskActionsComponent, AsyncPipe] + selector: 'ds-claimed-search-result-list-element', + styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './claimed-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ThemedItemListPreviewComponent, NgClass, ClaimedTaskActionsComponent, AsyncPipe], }) @listableObjectComponent(ClaimedTaskSearchResult, ViewMode.ListElement) export class ClaimedSearchResultListElementComponent extends SearchResultListElementComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts index 5cbdad111d..2df6a0a172 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts @@ -1,25 +1,31 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { Item } from '../../../../core/shared/item.model'; -import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; -import { TruncatePipe } from '../../../utils/truncate.pipe'; -import { ItemListPreviewComponent } from './item-list-preview.component'; import { ThumbnailComponent } from '../../../../thumbnail/thumbnail.component'; +import { TranslateLoaderMock } from '../../../mocks/translate-loader.mock'; import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; +import { ItemCollectionComponent } from '../../../object-collection/shared/mydspace-item-collection/item-collection.component'; +import { ItemSubmitterComponent } from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; import { TruncatableComponent } from '../../../truncatable/truncatable.component'; import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.component'; -import { - ItemSubmitterComponent -} from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; -import { - ItemCollectionComponent -} from '../../../object-collection/shared/mydspace-item-collection/item-collection.component'; +import { TruncatePipe } from '../../../utils/truncate.pipe'; +import { ItemListPreviewComponent } from './item-list-preview.component'; let component: ItemListPreviewComponent; let fixture: ComponentFixture; @@ -91,30 +97,30 @@ const enviromentNoThumbs = { describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), NoopAnimationsModule, - ItemListPreviewComponent, TruncatePipe - ], - providers: [ + ItemListPreviewComponent, TruncatePipe, + ], + providers: [ { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemListPreviewComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemListPreviewComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ ThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, ItemSubmitterComponent, ItemCollectionComponent, - ] - } + ], + }, }).compileComponents(); })); @@ -203,30 +209,30 @@ describe('ItemListPreviewComponent', () => { describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), NoopAnimationsModule, - ItemListPreviewComponent, TruncatePipe - ], - providers: [ + ItemListPreviewComponent, TruncatePipe, + ], + providers: [ { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemListPreviewComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemListPreviewComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, remove: { imports: [ ThumbnailComponent, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, ItemSubmitterComponent, ItemCollectionComponent, - ] - } + ], + }, }).compileComponents(); })); beforeEach(waitForAsync(() => { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts index 6208d851b3..178f4ce062 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts @@ -1,35 +1,44 @@ -import { Component, Inject, Input, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Context } from 'src/app/core/shared/context.model'; import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model'; -import { APP_CONFIG, AppConfig, } from '../../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../../config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Item } from '../../../../core/shared/item.model'; -import { fadeInOut } from '../../../animations/fade'; -import { SearchResult } from '../../../search/models/search-result.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ItemCollectionComponent -} from '../../../object-collection/shared/mydspace-item-collection/item-collection.component'; -import { - ItemSubmitterComponent -} from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; -import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; import { ThumbnailComponent } from '../../../../thumbnail/thumbnail.component'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; +import { fadeInOut } from '../../../animations/fade'; +import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; +import { ItemCollectionComponent } from '../../../object-collection/shared/mydspace-item-collection/item-collection.component'; +import { ItemSubmitterComponent } from '../../../object-collection/shared/mydspace-item-submitter/item-submitter.component'; +import { SearchResult } from '../../../search/models/search-result.model'; +import { TruncatableComponent } from '../../../truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.component'; /** * This component show metadata for the given item object in the list view. */ @Component({ - selector: 'ds-item-list-preview', - styleUrls: ['item-list-preview.component.scss'], - templateUrl: 'item-list-preview.component.html', - animations: [fadeInOut], - standalone: true, - imports: [NgIf, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, ItemSubmitterComponent, ItemCollectionComponent, AsyncPipe, TranslateModule] + selector: 'ds-item-list-preview', + styleUrls: ['item-list-preview.component.scss'], + templateUrl: 'item-list-preview.component.html', + animations: [fadeInOut], + standalone: true, + imports: [NgIf, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, ItemSubmitterComponent, ItemCollectionComponent, AsyncPipe, TranslateModule], }) export class ItemListPreviewComponent implements OnInit { diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts index 7253f2538f..2063462511 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts @@ -14,10 +14,10 @@ import { ItemListPreviewComponent } from './item-list-preview.component'; * Themed wrapper for ItemListPreviewComponent */ @Component({ - selector: 'ds-themed-item-list-preview', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-list-preview', + styleUrls: [], + templateUrl: '../../../theme-support/themed.component.html', + standalone: true, }) export class ThemedItemListPreviewComponent extends ThemedComponent { protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'badgeContext', 'showSubmitter', 'workflowItem']; diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts index f79d24c13d..9eb6c3f709 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts @@ -1,5 +1,14 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -8,9 +17,9 @@ import { APP_CONFIG } from '../../../../../config/app-config.interface'; import { environment } from '../../../../../environments/environment'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Context } from '../../../../core/shared/context.model'; -import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; import { Item } from '../../../../core/shared/item.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { ItemSearchResultListElementSubmissionComponent } from './item-search-result-list-element-submission.component'; @@ -54,15 +63,15 @@ mockResultObject.indexableObject = Object.assign(new Item(), { describe('ItemMyDSpaceResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, ItemSearchResultListElementSubmissionComponent], - providers: [ + imports: [NoopAnimationsModule, ItemSearchResultListElementSubmissionComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - { provide: ThemeService, useValue: getMockThemeService() } - ], + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemSearchResultListElementSubmissionComponent, { + }).overrideComponent(ItemSearchResultListElementSubmissionComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts index 5f1ed7e899..6be84181e5 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts @@ -1,3 +1,4 @@ +import { NgClass } from '@angular/common'; import { Component, OnInit, @@ -6,24 +7,21 @@ import { import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { - SearchResultListElementComponent -} from '../../search-result-list-element/search-result-list-element.component'; -import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component'; -import { NgClass } from '@angular/common'; +import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component'; /** * This component renders item object for the search result in the list view for submission. */ @Component({ - selector: 'ds-item-search-result-list-element-submission', - styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './item-search-result-list-element-submission.component.scss'], - templateUrl: './item-search-result-list-element-submission.component.html', - standalone: true, - imports: [ThemedItemListPreviewComponent, NgClass, ItemActionsComponent] + selector: 'ds-item-search-result-list-element-submission', + styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './item-search-result-list-element-submission.component.scss'], + templateUrl: './item-search-result-list-element-submission.component.html', + standalone: true, + imports: [ThemedItemListPreviewComponent, NgClass, ItemActionsComponent], }) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Workspace) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts index 35f632295b..260db236bd 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts @@ -1,5 +1,15 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + flush, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -17,14 +27,17 @@ import { SubmissionDuplicateDataService } from '../../../../core/submission/subm import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../mocks/link-service.mock'; +import { getMockThemeService } from '../../../mocks/theme-service.mock'; import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../../../remote-data.utils'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, +} from '../../../remote-data.utils'; import { createPaginatedList } from '../../../testing/utils.test'; +import { ThemeService } from '../../../theme-support/theme.service'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { VarDirective } from '../../../utils/var.directive'; import { PoolSearchResultListElementComponent } from './pool-search-result-list-element.component'; -import { ThemeService } from '../../../theme-support/theme.service'; -import { getMockThemeService } from '../../../mocks/theme-service.mock'; let component: PoolSearchResultListElementComponent; let fixture: ComponentFixture; @@ -96,8 +109,8 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('PoolSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, VarDirective, PoolSearchResultListElementComponent], - providers: [ + imports: [NoopAnimationsModule, VarDirective, PoolSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, @@ -105,10 +118,10 @@ describe('PoolSearchResultListElementComponent', () => { { provide: ObjectCacheService, useValue: objectCacheServiceMock }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SubmissionDuplicateDataService, useValue: duplicateDataServiceStub }, - { provide: ThemeService, useValue: getMockThemeService() } - ], + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(PoolSearchResultListElementComponent, { + }).overrideComponent(PoolSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts index 14336cc2e7..03f8845cc4 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts @@ -1,8 +1,30 @@ -import { Component, Inject, OnDestroy, OnInit, } from '@angular/core'; -import { BehaviorSubject, combineLatest, EMPTY, Observable, } from 'rxjs'; -import { map, mergeMap, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + BehaviorSubject, + combineLatest, + EMPTY, + Observable, +} from 'rxjs'; +import { + map, + mergeMap, + tap, +} from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from '../../../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../../../config/app-config.interface'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ObjectCacheService } from '../../../../core/cache/object-cache.service'; @@ -17,28 +39,28 @@ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { SubmissionDuplicateDataService } from '../../../../core/submission/submission-duplicate-data.service'; import { PoolTask } from '../../../../core/tasks/models/pool-task-object.model'; -import { hasValue, isNotEmpty, } from '../../../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../../empty.util'; +import { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { PoolTaskSearchResult } from '../../../object-collection/shared/pool-task-search-result.model'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { Duplicate } from '../../duplicate-data/duplicate.model'; -import { - SearchResultListElementComponent -} from '../../search-result-list-element/search-result-list-element.component'; -import { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; +import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; /** * This component renders pool task object for the search result in the list view. */ @Component({ - selector: 'ds-pool-search-result-list-element', - styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './pool-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ThemedItemListPreviewComponent, NgClass, PoolTaskActionsComponent, AsyncPipe] + selector: 'ds-pool-search-result-list-element', + styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './pool-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ThemedItemListPreviewComponent, NgClass, PoolTaskActionsComponent, AsyncPipe], }) @listableObjectComponent(PoolTaskSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts index b173563b60..96d7035b23 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts @@ -1,5 +1,14 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -14,11 +23,11 @@ import { Item } from '../../../../core/shared/item.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { WorkflowItemSearchResultListElementComponent } from './workflow-item-search-result-list-element.component'; -import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; let component: WorkflowItemSearchResultListElementComponent; @@ -72,17 +81,17 @@ describe('WorkflowItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { linkService = getMockLinkService(); TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, WorkflowItemSearchResultListElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkflowItemSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkflowItemSearchResultListElementComponent, { - add: {changeDetection: ChangeDetectionStrategy.Default}, + }).overrideComponent(WorkflowItemSearchResultListElementComponent, { + add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts index 34c6004787..471db6a95a 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, Inject, @@ -6,45 +11,55 @@ import { BehaviorSubject } from 'rxjs'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; -import { Context } from '../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; -import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators'; +import { + getFirstSucceededRemoteDataPayload, + getFirstSucceededRemoteDataPayload, +} from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model'; -import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; -import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; +import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; +import { WorkflowitemActionsComponent } from '../../../mydspace-actions/workflowitem/workflowitem-actions.component'; +import { + CollectionElementLinkType, + CollectionElementLinkType, +} from '../../../object-collection/collection-element-link.type'; +import { + ItemSearchResult, + ItemSearchResult, +} from '../../../object-collection/shared/item-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { - SearchResultListElementComponent + SearchResultListElementComponent, + SearchResultListElementComponent, } from '../../search-result-list-element/search-result-list-element.component'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; -import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators'; -import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; -import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; -import { Context } from '../../../../core/shared/context.model'; -import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; -import { WorkflowitemActionsComponent } from '../../../mydspace-actions/workflowitem/workflowitem-actions.component'; -import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgIf, NgClass, AsyncPipe } from '@angular/common'; -import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; /** * This component renders workflowitem object for the search result in the list view. */ @Component({ - selector: 'ds-workflow-item-my-dspace-result-list-element', - styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], - templateUrl: './workflow-item-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ListableObjectComponentLoaderComponent, NgClass, WorkflowitemActionsComponent, ThemedLoadingComponent, AsyncPipe] + selector: 'ds-workflow-item-my-dspace-result-list-element', + styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss'], + templateUrl: './workflow-item-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ListableObjectComponentLoaderComponent, NgClass, WorkflowitemActionsComponent, ThemedLoadingComponent, AsyncPipe], }) @listableObjectComponent(WorkflowItemSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts index 2d198c63e8..13666db7ee 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts @@ -9,32 +9,42 @@ import { tick, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; import { take } from 'rxjs/operators'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { + APP_CONFIG, + APP_CONFIG, +} from '../../../../../config/app-config.interface'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { ItemDataService } from '../../../../core/data/item-data.service'; -import { Context } from '../../../../core/shared/context.model'; +import { + Context, + Context, +} from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; -import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; +import { + DSONameServiceMock, + DSONameServiceMock, +} from '../../../mocks/dso-name.service.mock'; import { getMockLinkService } from '../../../mocks/link-service.mock'; +import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../mocks/theme-service.mock'; import { WorkflowItemSearchResult } from '../../../object-collection/shared/workflow-item-search-result.model'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; +import { ThemeService } from '../../../theme-support/theme.service'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { WorkspaceItemSearchResultListElementComponent } from './workspace-item-search-result-list-element.component'; -import { By } from '@angular/platform-browser'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; -import { APP_CONFIG } from '../../../../../config/app-config.interface'; -import { Context } from '../../../../core/shared/context.model'; -import { ThemeService } from '../../../theme-support/theme.service'; -import { getMockThemeService } from '../../../mocks/theme-service.mock'; -import { mockTruncatableService } from '../../../mocks/mock-trucatable.service'; @@ -88,17 +98,17 @@ describe('WorkspaceItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { linkService = getMockLinkService(); TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, WorkspaceItemSearchResultListElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkspaceItemSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, - { provide: ThemeService, useValue: getMockThemeService() } - ], + { provide: ThemeService, useValue: getMockThemeService() }, + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(WorkspaceItemSearchResultListElementComponent, { + }).overrideComponent(WorkspaceItemSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts index c108337da7..f75f7eaa0b 100644 --- a/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, Inject, @@ -6,45 +11,52 @@ import { BehaviorSubject } from 'rxjs'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from '../../../../../config/app-config.interface'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { Context } from '../../../../core/shared/context.model'; import { Item } from '../../../../core/shared/item.model'; -import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators'; +import { + getFirstSucceededRemoteDataPayload, + getFirstSucceededRemoteDataPayload, +} from '../../../../core/shared/operators'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { WorkspaceItem } from '../../../../core/submission/models/workspaceitem.model'; -import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; -import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; -import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { WorkspaceItemSearchResult } from '../../../object-collection/shared/workspace-item-search-result.model'; -import { TruncatableService } from '../../../truncatable/truncatable.service'; -import { - SearchResultListElementComponent -} from '../../search-result-list-element/search-result-list-element.component'; -import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; -import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; -import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; -import { map } from 'rxjs/operators'; -import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators'; -import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; -import { followLink } from '../../../utils/follow-link-config.model'; -import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component'; import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; import { WorkspaceitemActionsComponent } from '../../../mydspace-actions/workspaceitem/workspaceitem-actions.component'; +import { + CollectionElementLinkType, + CollectionElementLinkType, +} from '../../../object-collection/collection-element-link.type'; +import { + ItemSearchResult, + ItemSearchResult, +} from '../../../object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { NgIf, NgClass, AsyncPipe } from '@angular/common'; +import { WorkspaceItemSearchResult } from '../../../object-collection/shared/workspace-item-search-result.model'; +import { TruncatableService } from '../../../truncatable/truncatable.service'; +import { followLink } from '../../../utils/follow-link-config.model'; +import { + SearchResultListElementComponent, + SearchResultListElementComponent, +} from '../../search-result-list-element/search-result-list-element.component'; /** * This component renders workspaceitem object for the search result in the list view. */ @Component({ - selector: 'ds-workspace-item-search-result-list-element', - styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './workspace-item-search-result-list-element.component.scss'], - templateUrl: './workspace-item-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, ListableObjectComponentLoaderComponent, NgClass, WorkspaceitemActionsComponent, ThemedLoadingComponent, AsyncPipe] + selector: 'ds-workspace-item-search-result-list-element', + styleUrls: ['../../search-result-list-element/search-result-list-element.component.scss', './workspace-item-search-result-list-element.component.scss'], + templateUrl: './workspace-item-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, ListableObjectComponentLoaderComponent, NgClass, WorkspaceitemActionsComponent, ThemedLoadingComponent, AsyncPipe], }) @listableObjectComponent(WorkspaceItemSearchResult, ViewMode.ListElement) diff --git a/src/app/shared/object-list/object-list.component.spec.ts b/src/app/shared/object-list/object-list.component.spec.ts index 9d0417d0a9..eb369bdf2f 100644 --- a/src/app/shared/object-list/object-list.component.spec.ts +++ b/src/app/shared/object-list/object-list.component.spec.ts @@ -11,9 +11,9 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { PaginationComponent } from '../pagination/pagination.component'; import { ObjectListComponent } from './object-list.component'; import { SelectableListService } from './selectable-list/selectable-list.service'; -import { PaginationComponent } from '../pagination/pagination.component'; describe('ObjectListComponent', () => { let comp: ObjectListComponent; @@ -27,7 +27,7 @@ describe('ObjectListComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(ObjectListComponent, { remove: { - imports: [PaginationComponent] + imports: [PaginationComponent], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/shared/object-list/object-list.component.ts b/src/app/shared/object-list/object-list.component.ts index 32aff45dfe..ca3e9354aa 100644 --- a/src/app/shared/object-list/object-list.component.ts +++ b/src/app/shared/object-list/object-list.component.ts @@ -1,37 +1,45 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation, } from '@angular/core'; +import { + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + EventEmitter, + Input, + Output, + ViewEncapsulation, +} from '@angular/core'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { Context } from '../../core/shared/context.model'; import { ViewMode } from '../../core/shared/view-mode.model'; import { fadeIn } from '../animations/fade'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +import { ImportableListItemControlComponent } from '../object-collection/shared/importable-list-item-control/importable-list-item-control.component'; import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; -import { SelectableListService } from './selectable-list/selectable-list.service'; -import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { - ListableObjectComponentLoaderComponent -} from '../object-collection/shared/listable-object/listable-object-component-loader.component'; -import { - ImportableListItemControlComponent -} from '../object-collection/shared/importable-list-item-control/importable-list-item-control.component'; -import { - SelectableListItemControlComponent -} from '../object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; -import { NgClass, NgFor, NgIf } from '@angular/common'; +import { ListableObjectComponentLoaderComponent } from '../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { SelectableListItemControlComponent } from '../object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; import { PaginationComponent } from '../pagination/pagination.component'; +import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; +import { SelectableListService } from './selectable-list/selectable-list.service'; @Component({ - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - selector: 'ds-object-list', - styleUrls: ['./object-list.component.scss'], - templateUrl: './object-list.component.html', - animations: [fadeIn], - standalone: true, - imports: [PaginationComponent, NgIf, NgClass, NgFor, SelectableListItemControlComponent, ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe] + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, + selector: 'ds-object-list', + styleUrls: ['./object-list.component.scss'], + templateUrl: './object-list.component.html', + animations: [fadeIn], + standalone: true, + imports: [PaginationComponent, NgIf, NgClass, NgFor, SelectableListItemControlComponent, ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe], }) export class ObjectListComponent { /** diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index 143b2b2243..911c0d355f 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -16,13 +17,12 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Collection } from '../../../../core/shared/collection.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../utils/truncate.pipe'; -import { CollectionSearchResultListElementComponent } from './collection-search-result-list-element.component'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../testing/active-router.stub'; -import { ThemeService } from './../../../../shared/theme-support/theme.service'; import { getMockThemeService } from './../../../../shared/mocks/theme-service.mock'; +import { ThemeService } from './../../../../shared/theme-support/theme.service'; +import { CollectionSearchResultListElementComponent } from './collection-search-result-list-element.component'; let collectionSearchResultListElementComponent: CollectionSearchResultListElementComponent; let fixture: ComponentFixture; @@ -66,16 +66,16 @@ const environmentUseThumbs = { describe('CollectionSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, CollectionSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, CollectionSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CollectionSearchResultListElementComponent, { + }).overrideComponent(CollectionSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts index f90738ee51..58cd875ce2 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts @@ -1,20 +1,23 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Collection } from '../../../../core/shared/collection.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { RouterLink } from '@angular/router'; -import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; -import { NgIf, NgClass } from '@angular/common'; import { SearchResultListElementComponent } from '../search-result-list-element.component'; @Component({ - selector: 'ds-collection-search-result-list-element', - styleUrls: ['../search-result-list-element.component.scss', 'collection-search-result-list-element.component.scss'], - templateUrl: 'collection-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, NgClass, ThemedBadgesComponent, RouterLink] + selector: 'ds-collection-search-result-list-element', + styleUrls: ['../search-result-list-element.component.scss', 'collection-search-result-list-element.component.scss'], + templateUrl: 'collection-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, NgClass, ThemedBadgesComponent, RouterLink], }) /** * Component representing a collection search result in list view diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts index cb06d53de0..3ef9f33d10 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts @@ -9,6 +9,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../config/app-config.interface'; @@ -16,13 +17,12 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Community } from '../../../../core/shared/community.model'; import { DSONameServiceMock } from '../../../mocks/dso-name.service.mock'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; +import { ActivatedRouteStub } from '../../../testing/active-router.stub'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../utils/truncate.pipe'; -import { CommunitySearchResultListElementComponent } from './community-search-result-list-element.component'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../testing/active-router.stub'; -import { ThemeService } from './../../../../shared/theme-support/theme.service'; import { getMockThemeService } from './../../../../shared/mocks/theme-service.mock'; +import { ThemeService } from './../../../../shared/theme-support/theme.service'; +import { CommunitySearchResultListElementComponent } from './community-search-result-list-element.component'; let communitySearchResultListElementComponent: CommunitySearchResultListElementComponent; let fixture: ComponentFixture; @@ -66,16 +66,16 @@ const environmentUseThumbs = { describe('CommunitySearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, CommunitySearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, CommunitySearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(CommunitySearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(CommunitySearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts index c7ba8fdcc3..52d7ad6e6b 100644 --- a/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts @@ -1,20 +1,23 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Community } from '../../../../core/shared/community.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; +import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { RouterLink } from '@angular/router'; -import { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; -import { NgIf, NgClass } from '@angular/common'; import { SearchResultListElementComponent } from '../search-result-list-element.component'; @Component({ - selector: 'ds-community-search-result-list-element', - styleUrls: ['../search-result-list-element.component.scss', 'community-search-result-list-element.component.scss'], - templateUrl: 'community-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, NgClass, ThemedBadgesComponent, RouterLink] + selector: 'ds-community-search-result-list-element', + styleUrls: ['../search-result-list-element.component.scss', 'community-search-result-list-element.component.scss'], + templateUrl: 'community-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, NgClass, ThemedBadgesComponent, RouterLink], }) /** * Component representing a community search result in list view diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts index 3cc4cdc9ef..28701e454f 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts @@ -8,28 +8,28 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { APP_CONFIG } from '../../../../../../../config/app-config.interface'; +import { AuthService } from '../../../../../../core/auth/auth.service'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; +import { AuthorizationDataService } from '../../../../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../../../../core/shared/item.model'; import { DSONameServiceMock, UNDEFINED_NAME, } from '../../../../../mocks/dso-name.service.mock'; +import { mockTruncatableService } from '../../../../../mocks/mock-trucatable.service'; +import { getMockThemeService } from '../../../../../mocks/theme-service.mock'; import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; +import { ActivatedRouteStub } from '../../../../../testing/active-router.stub'; +import { AuthServiceStub } from '../../../../../testing/auth-service.stub'; +import { ThemeService } from '../../../../../theme-support/theme.service'; import { TruncatableService } from '../../../../../truncatable/truncatable.service'; import { TruncatePipe } from '../../../../../utils/truncate.pipe'; import { ItemSearchResultListElementComponent } from './item-search-result-list-element.component'; -import { getMockThemeService } from '../../../../../mocks/theme-service.mock'; -import { ThemeService } from '../../../../../theme-support/theme.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../../../../testing/active-router.stub'; -import { AuthService } from '../../../../../../core/auth/auth.service'; -import { AuthServiceStub } from '../../../../../testing/auth-service.stub'; -import { AuthorizationDataService } from '../../../../../../core/data/feature-authorization/authorization-data.service'; -import { mockTruncatableService } from '../../../../../mocks/mock-trucatable.service'; let publicationListElementComponent: ItemSearchResultListElementComponent; let fixture: ComponentFixture; @@ -207,12 +207,12 @@ const enviromentNoThumbs = { describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), TruncatePipe, - ItemSearchResultListElementComponent - ], - providers: [ + ItemSearchResultListElementComponent, + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, @@ -220,14 +220,14 @@ describe('ItemSearchResultListElementComponent', () => { { provide: AuthService, useValue: new AuthServiceStub() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, { - provide: AuthorizationDataService, - useValue: jasmine.createSpyObj('AuthorizationDataService', [ - 'invalidateAuthorizationsRequestCache' - ]) - } - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemSearchResultListElementComponent, { + provide: AuthorizationDataService, + useValue: jasmine.createSpyObj('AuthorizationDataService', [ + 'invalidateAuthorizationsRequestCache', + ]), + }, + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemSearchResultListElementComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -402,16 +402,16 @@ describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TruncatePipe, TranslateModule.forRoot(), ItemSearchResultListElementComponent], - providers: [ + imports: [TruncatePipe, TranslateModule.forRoot(), ItemSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs }, { provide: ThemeService, useValue: getMockThemeService() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(ItemSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(ItemSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 848ac0db9b..767ceee7f7 100644 --- a/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -1,27 +1,31 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + import { Item } from '../../../../../../core/shared/item.model'; import { ViewMode } from '../../../../../../core/shared/view-mode.model'; import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths'; -import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; -import { - listableObjectComponent -} from '../../../../../object-collection/shared/listable-object/listable-object.decorator'; -import { SearchResultListElementComponent } from '../../../search-result-list-element.component'; -import { TruncatablePartComponent } from '../../../../../truncatable/truncatable-part/truncatable-part.component'; -import { TruncatableComponent } from '../../../../../truncatable/truncatable.component'; -import { ThemedBadgesComponent } from '../../../../../object-collection/shared/badges/themed-badges.component'; import { ThumbnailComponent } from '../../../../../../thumbnail/thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; +import { ThemedBadgesComponent } from '../../../../../object-collection/shared/badges/themed-badges.component'; +import { ItemSearchResult } from '../../../../../object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../object-collection/shared/listable-object/listable-object.decorator'; +import { TruncatableComponent } from '../../../../../truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../truncatable/truncatable-part/truncatable-part.component'; +import { SearchResultListElementComponent } from '../../../search-result-list-element.component'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement) @Component({ - selector: 'ds-item-search-result-list-element', - styleUrls: ['./item-search-result-list-element.component.scss'], - templateUrl: './item-search-result-list-element.component.html', - standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe] + selector: 'ds-item-search-result-list-element', + styleUrls: ['./item-search-result-list-element.component.scss'], + templateUrl: './item-search-result-list-element.component.html', + standalone: true, + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe], }) /** * The component for displaying a list element for an item search result of the type Publication diff --git a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts index e108ea4fc0..986138493b 100644 --- a/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts +++ b/src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts @@ -18,9 +18,9 @@ import { SearchResult } from '../../search/models/search-result.model'; import { TruncatableService } from '../../truncatable/truncatable.service'; @Component({ - selector: 'ds-search-result-list-element', - template: ``, - standalone: true + selector: 'ds-search-result-list-element', + template: ``, + standalone: true, }) export class SearchResultListElementComponent, K extends DSpaceObject> extends AbstractListableElementComponent implements OnInit { /** diff --git a/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts index 0e4b4e4c45..480ecb68bb 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts @@ -1,22 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Collection } from '../../../../core/shared/collection.model'; import { Context } from '../../../../core/shared/context.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { SidebarSearchListElementComponent } from '../sidebar-search-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgClass, NgIf, AsyncPipe } from '@angular/common'; import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.component'; +import { SidebarSearchListElementComponent } from '../sidebar-search-list-element.component'; @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-collection-sidebar-search-list-element', - templateUrl: '../sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-collection-sidebar-search-list-element', + templateUrl: '../sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link CollectionSearchResult} within the context of a sidebar search modal diff --git a/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts index b73b972de6..8c40e5d5a4 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts @@ -1,22 +1,26 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../../core/shared/community.model'; import { Context } from '../../../../core/shared/context.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; -import { SidebarSearchListElementComponent } from '../sidebar-search-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgClass, NgIf, AsyncPipe } from '@angular/common'; import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.component'; +import { SidebarSearchListElementComponent } from '../sidebar-search-list-element.component'; @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-collection-sidebar-search-list-element', - templateUrl: '../sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-collection-sidebar-search-list-element', + templateUrl: '../sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link CommunitySearchResult} within the context of a sidebar search modal diff --git a/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts index 805d7c836a..798d52426e 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts @@ -1,26 +1,28 @@ import { - listableObjectComponent -} from '../../../../object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../core/shared/view-mode.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Context } from '../../../../../core/shared/context.model'; import { Item } from '../../../../../core/shared/item.model'; +import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; -import { SidebarSearchListElementComponent } from '../../sidebar-search-list-element.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; +import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator'; import { TruncatablePartComponent } from '../../../../truncatable/truncatable-part/truncatable-part.component'; +import { SidebarSearchListElementComponent } from '../../sidebar-search-list-element.component'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.SideBarSearchModal) @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.SideBarSearchModalCurrent) @Component({ - selector: 'ds-publication-sidebar-search-list-element', - templateUrl: '../../sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-publication-sidebar-search-list-element', + templateUrl: '../../sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link ItemSearchResult} of type "Publication" within the context of diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts index abe2385464..22bf7fd52c 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts @@ -1,14 +1,18 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../core/cache/builders/link.service'; import { ChildHALResource } from '../../../core/shared/child-hal-resource.model'; -import { mockTruncatableService } from '../../mocks/mock-trucatable.service'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { HALResource } from '../../../core/shared/hal-resource.model'; +import { mockTruncatableService } from '../../mocks/mock-trucatable.service'; import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; import { SearchResult } from '../../search/models/search-result.model'; import { TruncatableService } from '../../truncatable/truncatable.service'; diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index b057acc405..ba19fb9d4b 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -1,4 +1,10 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -8,15 +14,14 @@ import { map, } from 'rxjs/operators'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../../core/breadcrumbs/dso-name.service'; import { LinkService } from '../../../core/cache/builders/link.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ChildHALResource } from '../../../core/shared/child-hal-resource.model'; import { Context } from '../../../core/shared/context.model'; -import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgClass, NgIf, AsyncPipe } from '@angular/common'; -import { TruncatablePartComponent } from '../../truncatable/truncatable-part/truncatable-part.component'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { hasValue, @@ -24,14 +29,15 @@ import { } from '../../empty.util'; import { SearchResult } from '../../search/models/search-result.model'; import { TruncatableService } from '../../truncatable/truncatable.service'; +import { TruncatablePartComponent } from '../../truncatable/truncatable-part/truncatable-part.component'; import { followLink } from '../../utils/follow-link-config.model'; import { SearchResultListElementComponent } from '../search-result-list-element/search-result-list-element.component'; @Component({ - selector: 'ds-sidebar-search-list-element', - templateUrl: './sidebar-search-list-element.component.html', - standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-sidebar-search-list-element', + templateUrl: './sidebar-search-list-element.component.html', + standalone: true, + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) /** * Component displaying a list element for a {@link SearchResult} in the sidebar search modal diff --git a/src/app/shared/object-list/themed-object-list.component.ts b/src/app/shared/object-list/themed-object-list.component.ts index 1f1e23f635..105d9e9a4a 100644 --- a/src/app/shared/object-list/themed-object-list.component.ts +++ b/src/app/shared/object-list/themed-object-list.component.ts @@ -22,10 +22,10 @@ import { ObjectListComponent } from './object-list.component'; * Themed wrapper for ObjectListComponent */ @Component({ - selector: 'ds-themed-object-list', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-object-list', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', + standalone: true, }) export class ThemedObjectListComponent extends ThemedComponent { diff --git a/src/app/shared/object-select/collection-select/collection-select.component.spec.ts b/src/app/shared/object-select/collection-select/collection-select.component.spec.ts index 7275c23a46..e2c2ae69a2 100644 --- a/src/app/shared/object-select/collection-select/collection-select.component.spec.ts +++ b/src/app/shared/object-select/collection-select/collection-select.component.spec.ts @@ -1,45 +1,68 @@ -import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + NO_ERRORS_SCHEMA, + NO_ERRORS_SCHEMA, +} from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; +import { + By, + By, +} from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { ObjectSelectServiceStub } from '../../testing/object-select-service.stub'; -import { ObjectSelectService } from '../object-select.service'; -import { HostWindowService } from '../../host-window.service'; -import { HostWindowServiceStub } from '../../testing/host-window-service.stub'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { By } from '@angular/platform-browser'; -import { CollectionSelectComponent } from './collection-select.component'; -import { Collection } from '../../../core/shared/collection.model'; -import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; -import { createPaginatedList } from '../../testing/utils.test'; -import { PaginationService } from '../../../core/pagination/pagination.service'; -import { PaginationServiceStub } from '../../testing/pagination-service.stub'; import { of as observableOf } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { PaginationService } from '../../../core/pagination/pagination.service'; +import { + PaginationService, + PaginationService, +} from '../../../core/pagination/pagination.service'; import { LinkHeadService } from '../../../core/services/link-head.service'; -import { Collection } from '../../../core/shared/collection.model'; +import { + Collection, + Collection, +} from '../../../core/shared/collection.model'; import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { HostWindowService } from '../../host-window.service'; +import { + HostWindowService, + HostWindowService, +} from '../../host-window.service'; import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; -import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; -import { SharedModule } from '../../shared.module'; -import { HostWindowServiceStub } from '../../testing/host-window-service.stub'; -import { ObjectSelectServiceStub } from '../../testing/object-select-service.stub'; -import { PaginationServiceStub } from '../../testing/pagination-service.stub'; +import { + createSuccessfulRemoteDataObject$, + createSuccessfulRemoteDataObject$, +} from '../../remote-data.utils'; +import { + HostWindowServiceStub, + HostWindowServiceStub, +} from '../../testing/host-window-service.stub'; +import { + ObjectSelectServiceStub, + ObjectSelectServiceStub, +} from '../../testing/object-select-service.stub'; +import { + PaginationServiceStub, + PaginationServiceStub, +} from '../../testing/pagination-service.stub'; import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub'; -import { createPaginatedList } from '../../testing/utils.test'; -import { ObjectSelectService } from '../object-select.service'; -import { CollectionSelectComponent } from './collection-select.component'; +import { + createPaginatedList, + createPaginatedList, +} from '../../testing/utils.test'; +import { + ObjectSelectService, + ObjectSelectService, +} from '../object-select.service'; +import { + CollectionSelectComponent, + CollectionSelectComponent, +} from './collection-select.component'; describe('CollectionSelectComponent', () => { let comp: CollectionSelectComponent; @@ -89,8 +112,8 @@ describe('CollectionSelectComponent', () => { const paginationService = new PaginationServiceStub(); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], + providers: [ { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockCollectionList[1].id]) }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -99,9 +122,9 @@ describe('CollectionSelectComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/object-select/collection-select/collection-select.component.ts b/src/app/shared/object-select/collection-select/collection-select.component.ts index 83b2e6cfc1..2c9266151c 100644 --- a/src/app/shared/object-select/collection-select/collection-select.component.ts +++ b/src/app/shared/object-select/collection-select/collection-select.component.ts @@ -1,26 +1,31 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Collection } from '../../../core/shared/collection.model'; import { isNotEmpty } from '../../empty.util'; +import { ErrorComponent } from '../../error/error.component'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { PaginationComponent } from '../../pagination/pagination.component'; +import { VarDirective } from '../../utils/var.directive'; import { ObjectSelectService } from '../object-select.service'; import { ObjectSelectComponent } from '../object-select/object-select.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; -import { ErrorComponent } from '../../error/error.component'; -import { RouterLink } from '@angular/router'; -import { FormsModule } from '@angular/forms'; -import { PaginationComponent } from '../../pagination/pagination.component'; -import { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common'; -import { VarDirective } from '../../utils/var.directive'; @Component({ - selector: 'ds-collection-select', - templateUrl: './collection-select.component.html', - styleUrls: ['./collection-select.component.scss'], - standalone: true, - imports: [VarDirective, NgIf, PaginationComponent, NgFor, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule] + selector: 'ds-collection-select', + templateUrl: './collection-select.component.html', + styleUrls: ['./collection-select.component.scss'], + standalone: true, + imports: [VarDirective, NgIf, PaginationComponent, NgFor, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/object-select/item-select/item-select.component.spec.ts b/src/app/shared/object-select/item-select/item-select.component.spec.ts index f23c1021aa..15247affa9 100644 --- a/src/app/shared/object-select/item-select/item-select.component.spec.ts +++ b/src/app/shared/object-select/item-select/item-select.component.spec.ts @@ -1,15 +1,12 @@ -import { ItemSelectComponent } from './item-select.component'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { Item } from '../../../core/shared/item.model'; -import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ObjectSelectServiceStub } from '../../testing/object-select-service.stub'; -import { ObjectSelectService } from '../object-select.service'; -import { HostWindowService } from '../../host-window.service'; -import { HostWindowServiceStub } from '../../testing/host-window-service.stub'; import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; @@ -19,11 +16,18 @@ import { GroupDataService } from '../../../core/eperson/group-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { LinkHeadService } from '../../../core/services/link-head.service'; import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; +import { Item } from '../../../core/shared/item.model'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { HostWindowService } from '../../host-window.service'; +import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; +import { HostWindowServiceStub } from '../../testing/host-window-service.stub'; +import { ObjectSelectServiceStub } from '../../testing/object-select-service.stub'; import { PaginationServiceStub } from '../../testing/pagination-service.stub'; import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub'; import { createPaginatedList } from '../../testing/utils.test'; +import { ObjectSelectService } from '../object-select.service'; +import { ItemSelectComponent } from './item-select.component'; describe('ItemSelectComponent', () => { let comp: ItemSelectComponent; @@ -97,8 +101,8 @@ describe('ItemSelectComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], + providers: [ { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockItemList[1].id]) }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -107,9 +111,9 @@ describe('ItemSelectComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/object-select/item-select/item-select.component.ts b/src/app/shared/object-select/item-select/item-select.component.ts index 95165f94e0..e66bc4a974 100644 --- a/src/app/shared/object-select/item-select/item-select.component.ts +++ b/src/app/shared/object-select/item-select/item-select.component.ts @@ -1,29 +1,40 @@ -import { Component, Input, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; -import { ErrorComponent } from '../../error/error.component'; -import { RouterLink } from '@angular/router'; -import { FormsModule } from '@angular/forms'; -import { PaginationComponent } from '../../pagination/pagination.component'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; -import { VarDirective } from '../../utils/var.directive'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { Item } from '../../../core/shared/item.model'; import { getAllSucceededRemoteDataPayload } from '../../../core/shared/operators'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; -import { hasValueOperator, isNotEmpty, } from '../../empty.util'; +import { + hasValueOperator, + isNotEmpty, +} from '../../empty.util'; +import { ErrorComponent } from '../../error/error.component'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { PaginationComponent } from '../../pagination/pagination.component'; +import { VarDirective } from '../../utils/var.directive'; import { ObjectSelectService } from '../object-select.service'; import { ObjectSelectComponent } from '../object-select/object-select.component'; @Component({ - selector: 'ds-item-select', - templateUrl: './item-select.component.html', - standalone: true, - imports: [VarDirective, NgIf, PaginationComponent, NgFor, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule] + selector: 'ds-item-select', + templateUrl: './item-select.component.html', + standalone: true, + imports: [VarDirective, NgIf, PaginationComponent, NgFor, FormsModule, RouterLink, ErrorComponent, ThemedLoadingComponent, NgClass, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts index 5ba35dfbaa..e8b5d1de45 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.spec.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.spec.ts @@ -1,20 +1,30 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { first, take, } from 'rxjs/operators'; +import { + first, + take, +} from 'rxjs/operators'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginationService } from '../../core/pagination/pagination.service'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; import { EnumKeysPipe } from '../utils/enum-keys-pipe'; import { VarDirective } from '../utils/var.directive'; -import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { PageSizeSelectorComponent } from './page-size-selector.component'; describe('PageSizeSelectorComponent', () => { @@ -48,19 +58,19 @@ describe('PageSizeSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), PageSizeSelectorComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), PageSizeSelectorComponent, EnumKeysPipe, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: PaginationService, useValue: paginationService }, { - provide: SEARCH_CONFIG_SERVICE, - useValue: { - paginatedSearchOptions: observableOf(paginatedSearchOptions), + provide: SEARCH_CONFIG_SERVICE, + useValue: { + paginatedSearchOptions: observableOf(paginatedSearchOptions), }, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/page-size-selector/page-size-selector.component.ts b/src/app/shared/page-size-selector/page-size-selector.component.ts index 0cf663214e..8f3afa61b3 100644 --- a/src/app/shared/page-size-selector/page-size-selector.component.ts +++ b/src/app/shared/page-size-selector/page-size-selector.component.ts @@ -1,24 +1,37 @@ -import { Component, Inject, OnInit, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + AsyncPipe, + NgFor, +} from '@angular/common'; +import { + Component, + Inject, + OnInit, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { Observable } from 'rxjs'; -import { map, take, } from 'rxjs/operators'; +import { + map, + take, +} from 'rxjs/operators'; import { PaginationService } from '../../core/pagination/pagination.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model'; -import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgFor } from '@angular/common'; import { SidebarDropdownComponent } from '../sidebar/sidebar-dropdown.component'; -import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; @Component({ - selector: 'ds-page-size-selector', - styleUrls: ['./page-size-selector.component.scss'], - templateUrl: './page-size-selector.component.html', - standalone: true, - imports: [SidebarDropdownComponent, NgFor, FormsModule, AsyncPipe] + selector: 'ds-page-size-selector', + styleUrls: ['./page-size-selector.component.scss'], + templateUrl: './page-size-selector.component.html', + standalone: true, + imports: [SidebarDropdownComponent, NgFor, FormsModule, AsyncPipe], }) /** diff --git a/src/app/shared/pagination/pagination.component.spec.ts b/src/app/shared/pagination/pagination.component.spec.ts index 3437a225fb..625cfe3998 100644 --- a/src/app/shared/pagination/pagination.component.spec.ts +++ b/src/app/shared/pagination/pagination.component.spec.ts @@ -1,18 +1,39 @@ // Load the implementations that should be tested import { CommonModule } from '@angular/common'; -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement, } from '@angular/core'; -import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + inject, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { StoreModule } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { NgxPaginationModule } from 'ngx-pagination'; import { BehaviorSubject } from 'rxjs'; import { storeModuleConfig } from '../../app.reducer'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { FindListOptions } from '../../core/data/find-list-options.model'; import { PaginationService } from '../../core/pagination/pagination.service'; import { HostWindowService } from '../host-window.service'; @@ -20,11 +41,11 @@ import { MockActivatedRoute } from '../mocks/active-router.mock'; import { HostWindowServiceMock } from '../mocks/host-window-service.mock'; import { RouterMock } from '../mocks/router.mock'; import { TranslateLoaderMock } from '../mocks/translate-loader.mock'; +import { RSSComponent } from '../rss-feed/rss.component'; import { createTestComponent } from '../testing/utils.test'; import { EnumKeysPipe } from '../utils/enum-keys-pipe'; import { PaginationComponent } from './pagination.component'; import { PaginationComponentOptions } from './pagination-component-options.model'; -import { RSSComponent } from '../rss-feed/rss.component'; function expectPages(fixture: ComponentFixture, pagesDef: string[]): void { const de = fixture.debugElement.query(By.css('.pagination')); @@ -135,38 +156,38 @@ describe('Pagination component', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), NgxPaginationModule, NgbModule, RouterTestingModule.withRoutes([ - { path: 'home', component: TestComponent }, + { path: 'home', component: TestComponent }, ]), PaginationComponent, TestComponent, EnumKeysPipe, - ], - providers: [ + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useValue: routerStub }, { provide: HostWindowService, useValue: hostWindowServiceStub }, { provide: PaginationService, useValue: paginationService }, ChangeDetectorRef, PaginationComponent, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] -}).overrideComponent(PaginationComponent, { - remove: { - imports: [RSSComponent] - } -}); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }).overrideComponent(PaginationComponent, { + remove: { + imports: [RSSComponent], + }, + }); })); @@ -374,12 +395,12 @@ describe('Pagination component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', template: '', - standalone: true, - imports: [CommonModule, - NgxPaginationModule, - PaginationComponent, - NgbModule] + selector: 'ds-test-cmp', template: '', + standalone: true, + imports: [CommonModule, + NgxPaginationModule, + PaginationComponent, + NgbModule], }) class TestComponent { diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts index 0a48ab28dc..74b490a2e7 100644 --- a/src/app/shared/pagination/pagination.component.ts +++ b/src/app/shared/pagination/pagination.component.ts @@ -1,3 +1,9 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -9,10 +15,26 @@ import { Output, ViewEncapsulation, } from '@angular/core'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; -import { map, take, } from 'rxjs/operators'; +import { + NgbDropdownModule, + NgbPaginationModule, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + map, + take, +} from 'rxjs/operators'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { PaginationService } from '../../core/pagination/pagination.service'; @@ -22,26 +44,23 @@ import { ViewMode } from '../../core/shared/view-mode.model'; import { hasValue } from '../empty.util'; import { HostWindowService } from '../host-window.service'; import { ListableObject } from '../object-collection/shared/listable-object.model'; -import { HostWindowState } from '../search/host-window.reducer'; -import { PaginationComponentOptions } from './pagination-component-options.model'; -import { EnumKeysPipe } from '../utils/enum-keys-pipe'; -import { TranslateModule } from '@ngx-translate/core'; import { RSSComponent } from '../rss-feed/rss.component'; -import { NgbDropdownModule, NgbPaginationModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; +import { HostWindowState } from '../search/host-window.reducer'; +import { EnumKeysPipe } from '../utils/enum-keys-pipe'; +import { PaginationComponentOptions } from './pagination-component-options.model'; /** * The default pagination controls component. */ @Component({ - exportAs: 'paginationComponent', - selector: 'ds-pagination', - styleUrls: ['pagination.component.scss'], - templateUrl: 'pagination.component.html', - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - standalone: true, - imports: [NgIf, NgbDropdownModule, NgFor, NgClass, RSSComponent, NgbPaginationModule, NgbTooltipModule, AsyncPipe, TranslateModule, EnumKeysPipe] + exportAs: 'paginationComponent', + selector: 'ds-pagination', + styleUrls: ['pagination.component.scss'], + templateUrl: 'pagination.component.html', + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, + standalone: true, + imports: [NgIf, NgbDropdownModule, NgFor, NgClass, RSSComponent, NgbPaginationModule, NgbTooltipModule, AsyncPipe, TranslateModule, EnumKeysPipe], }) export class PaginationComponent implements OnDestroy, OnInit { /** diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts index 7bd9db14f8..3f82eec5fc 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts @@ -1,8 +1,24 @@ -import { ChangeDetectorRef, Component, Injector, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ChangeDetectorRef, + Component, + Injector, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -23,8 +39,14 @@ import { EPersonMock } from '../../testing/eperson.mock'; import { GroupMock } from '../../testing/group-mock'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; -import { createPaginatedList, createTestComponent, } from '../../testing/utils.test'; -import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; +import { + createPaginatedList, + createTestComponent, +} from '../../testing/utils.test'; +import { + ResourcePolicyEvent, + ResourcePolicyFormComponent, +} from '../form/resource-policy-form.component'; import { submittedResourcePolicy } from '../form/resource-policy-form.component.spec'; import { ResourcePolicyCreateComponent } from './resource-policy-create.component'; @@ -88,12 +110,12 @@ describe('ResourcePolicyCreateComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), ResourcePolicyCreateComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -102,17 +124,17 @@ describe('ResourcePolicyCreateComponent test suite', () => { ResourcePolicyCreateComponent, ChangeDetectorRef, Injector, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, - ], -}) -.overrideComponent(ResourcePolicyCreateComponent, { - remove: { - imports: [ResourcePolicyFormComponent] - } -}) -.compileComponents(); + ], + }) + .overrideComponent(ResourcePolicyCreateComponent, { + remove: { + imports: [ResourcePolicyFormComponent], + }, + }) + .compileComponents(); })); describe('', () => { @@ -264,9 +286,9 @@ describe('ResourcePolicyCreateComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.ts index c6385a3bcd..d2a07892d7 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.ts @@ -1,28 +1,45 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -import { BehaviorSubject, Observable } from 'rxjs'; -import { map, take } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; +import { + map, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; -import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; -import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { NotificationsService } from '../../notifications/notifications.service'; +import { + ResourcePolicyEvent, + ResourcePolicyFormComponent, +} from '../form/resource-policy-form.component'; @Component({ selector: 'ds-resource-policy-create', templateUrl: './resource-policy-create.component.html', imports: [ ResourcePolicyFormComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class ResourcePolicyCreateComponent implements OnInit { diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts index 2575b6b55c..85a608f9d2 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts @@ -1,8 +1,24 @@ -import { ChangeDetectorRef, Component, Injector, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ChangeDetectorRef, + Component, + Injector, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -14,12 +30,18 @@ import { ResourcePolicyDataService } from '../../../core/resource-policy/resourc import { getMockLinkService } from '../../mocks/link-service.mock'; import { getMockResourcePolicyService } from '../../mocks/mock-resource-policy-service'; import { NotificationsService } from '../../notifications/notifications.service'; -import { createFailedRemoteDataObject, createSuccessfulRemoteDataObject, } from '../../remote-data.utils'; +import { + createFailedRemoteDataObject, + createSuccessfulRemoteDataObject, +} from '../../remote-data.utils'; import { GroupMock } from '../../testing/group-mock'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { RouterStub } from '../../testing/router.stub'; import { createTestComponent } from '../../testing/utils.test'; -import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; +import { + ResourcePolicyEvent, + ResourcePolicyFormComponent, +} from '../form/resource-policy-form.component'; import { submittedResourcePolicy } from '../form/resource-policy-form.component.spec'; import { ResourcePolicyEditComponent } from './resource-policy-edit.component'; @@ -70,12 +92,12 @@ describe('ResourcePolicyEditComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), ResourcePolicyEditComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -84,13 +106,13 @@ describe('ResourcePolicyEditComponent test suite', () => { ResourcePolicyEditComponent, ChangeDetectorRef, Injector, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, - ], -}) + ], + }) .overrideComponent(ResourcePolicyEditComponent, { - remove: { imports: [ResourcePolicyFormComponent]} + remove: { imports: [ResourcePolicyFormComponent] }, }) .compileComponents(); })); @@ -214,9 +236,9 @@ describe('ResourcePolicyEditComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts index 1384a559a3..43e7b550fe 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts @@ -1,27 +1,46 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, of, } from 'rxjs'; -import { map, take } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Observable, + of, +} from 'rxjs'; +import { + map, + take, +} from 'rxjs/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; -import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { NotificationsService } from '../../notifications/notifications.service'; +import { + ResourcePolicyEvent, + ResourcePolicyFormComponent, +} from '../form/resource-policy-form.component'; @Component({ selector: 'ds-resource-policy-edit', templateUrl: './resource-policy-edit.component.html', imports: [ ResourcePolicyFormComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class ResourcePolicyEditComponent implements OnInit { diff --git a/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts b/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts index 788c9a171c..5c80afdbc9 100644 --- a/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts +++ b/src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts @@ -7,9 +7,15 @@ */ import { CommonModule } from '@angular/common'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; @@ -116,18 +122,18 @@ describe('ResourcePolicyEntryComponent', () => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), - ResourcePolicyEntryComponent - ], - providers: [ + ResourcePolicyEntryComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: GroupDataService, useValue: groupService }, { provide: DSONameService, useValue: dsoNameService }, - ] -}).compileComponents(); + ], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts index 8670dfbfd8..f7bd18979d 100644 --- a/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts +++ b/src/app/shared/resource-policies/entry/resource-policy-entry.component.ts @@ -5,8 +5,23 @@ * * http://www.dspace.org/license/ */ -import { Component, EventEmitter, Input, OnInit, Output, } from '@angular/core'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -14,15 +29,21 @@ import { getGroupEditRoute } from '../../../access-control/access-control-routin import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; import { GroupDataService } from '../../../core/eperson/group-data.service'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule } from '@angular/forms'; import { Group } from '../../../core/eperson/models/group.model'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { getAllSucceededRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; -import { dateToString, stringToNgbDateStruct, } from '../../date.util'; -import { hasValue, isNotEmpty, } from '../../empty.util'; +import { + getAllSucceededRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; +import { + dateToString, + stringToNgbDateStruct, +} from '../../date.util'; +import { + hasValue, + isNotEmpty, +} from '../../empty.util'; export interface ResourcePolicyCheckboxEntry { id: string; @@ -38,9 +59,9 @@ export interface ResourcePolicyCheckboxEntry { AsyncPipe, TranslateModule, FormsModule, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class ResourcePolicyEntryComponent implements OnInit { @Input() diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts index e1e620bcc2..f8491f886a 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts @@ -1,16 +1,38 @@ -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { By } from '@angular/platform-browser'; import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; +import { NgxMaskModule } from 'ngx-mask'; import { of as observableOf } from 'rxjs'; import { delay } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, + APP_DYNAMIC_FORM_CONTROL_FN, +} from 'src/config/app-config.interface'; +import { environment } from 'src/environments/environment.test'; import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; @@ -21,9 +43,16 @@ import { ActionType } from '../../../core/resource-policy/models/action-type.mod import { PolicyType } from '../../../core/resource-policy/models/policy-type.model'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; -import { dateToISOFormat, stringToNgbDateStruct, } from '../../date.util'; +import { SubmissionObjectDataService } from '../../../core/submission/submission-object-data.service'; +import { SubmissionService } from '../../../submission/submission.service'; +import { + dateToISOFormat, + stringToNgbDateStruct, +} from '../../date.util'; import { isNotEmptyOperator } from '../../empty.util'; import { EpersonGroupListComponent } from '../../eperson-group-list/eperson-group-list.component'; +import { dsDynamicFormControlMapFn } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; +import { DsDynamicTypeBindRelationService } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; import { FormBuilderService } from '../../form/builder/form-builder.service'; import { FormComponent } from '../../form/form.component'; import { FormService } from '../../form/form.service'; @@ -34,18 +63,11 @@ import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; import { EPersonMock } from '../../testing/eperson.mock'; import { GroupMock } from '../../testing/group-mock'; import { PaginationServiceStub } from '../../testing/pagination-service.stub'; -import { - DsDynamicTypeBindRelationService -} from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; -import { SubmissionObjectDataService } from '../../../core/submission/submission-object-data.service'; -import { SubmissionService } from '../../../submission/submission.service'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP, APP_DYNAMIC_FORM_CONTROL_FN } from 'src/config/app-config.interface'; -import { environment } from 'src/environments/environment.test'; -import { NgxMaskModule } from 'ngx-mask'; -import { provideMockStore } from '@ngrx/store/testing'; -import { dsDynamicFormControlMapFn } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; import { createTestComponent } from '../../testing/utils.test'; -import { ResourcePolicyEvent, ResourcePolicyFormComponent, } from './resource-policy-form.component'; +import { + ResourcePolicyEvent, + ResourcePolicyFormComponent, +} from './resource-policy-form.component'; export const mockResourcePolicyFormData = { name: [ @@ -182,7 +204,7 @@ describe('ResourcePolicyFormComponent test suite', () => { }; beforeEach(waitForAsync(() => { - TestBed.configureTestingModule({ + TestBed.configureTestingModule({ imports: [ CommonModule, FormsModule, @@ -212,18 +234,18 @@ describe('ResourcePolicyFormComponent test suite', () => { { provide: APP_CONFIG, useValue: environment }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, { provide: APP_DYNAMIC_FORM_CONTROL_FN, useValue: dsDynamicFormControlMapFn }, - provideMockStore({}) + provideMockStore({}), ], schemas: [ NO_ERRORS_SCHEMA, ], }) - .overrideComponent(ResourcePolicyFormComponent, { - remove: { - imports: [EpersonGroupListComponent] - } - }) - .compileComponents(); + .overrideComponent(ResourcePolicyFormComponent, { + remove: { + imports: [EpersonGroupListComponent], + }, + }) + .compileComponents(); })); describe('', () => { @@ -473,7 +495,7 @@ describe('ResourcePolicyFormComponent test suite', () => { CommonModule, FormsModule, NgbModule, - ReactiveFormsModule] + ReactiveFormsModule], }) class TestComponent { diff --git a/src/app/shared/resource-policies/form/resource-policy-form.component.ts b/src/app/shared/resource-policies/form/resource-policy-form.component.ts index 405abc9e6d..534e88bcef 100644 --- a/src/app/shared/resource-policies/form/resource-policy-form.component.ts +++ b/src/app/shared/resource-policies/form/resource-policy-form.component.ts @@ -1,11 +1,30 @@ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild, } from '@angular/core'; -import { NgbModal, NgbNavChangeEvent, NgbNavModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + ElementRef, + EventEmitter, + Input, + OnDestroy, + OnInit, + Output, + ViewChild, +} from '@angular/core'; +import { + NgbModal, + NgbNavChangeEvent, + NgbNavModule, +} from '@ng-bootstrap/ng-bootstrap'; import { DynamicDatePickerModel, DynamicFormControlModel, DynamicFormGroupModel, DynamicSelectModel, } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -13,7 +32,11 @@ import { of as observableOf, Subscription, } from 'rxjs'; -import { filter, map, take, } from 'rxjs/operators'; +import { + filter, + map, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { RemoteData } from '../../../core/data/remote-data'; @@ -24,10 +47,20 @@ import { ResourcePolicy } from '../../../core/resource-policy/models/resource-po import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { dateToISOFormat, stringToNgbDateStruct, } from '../../date.util'; -import { hasValue, hasValueOperator, isEmpty, isNotEmpty, } from '../../empty.util'; +import { + dateToISOFormat, + stringToNgbDateStruct, +} from '../../date.util'; +import { + hasValue, + hasValueOperator, + isEmpty, + isNotEmpty, +} from '../../empty.util'; +import { EpersonGroupListComponent } from '../../eperson-group-list/eperson-group-list.component'; import { DsDynamicInputModel } from '../../form/builder/ds-dynamic-form-ui/models/ds-dynamic-input.model'; import { DsDynamicTextAreaModel } from '../../form/builder/ds-dynamic-form-ui/models/ds-dynamic-textarea.model'; +import { FormComponent } from '../../form/form.component'; import { FormService } from '../../form/form.service'; import { RESOURCE_POLICY_FORM_ACTION_TYPE_CONFIG, @@ -41,10 +74,6 @@ import { RESOURCE_POLICY_FORM_START_DATE_CONFIG, RESOURCE_POLICY_FORM_START_DATE_LAYOUT, } from './resource-policy-form.model'; -import { FormComponent } from '../../form/form.component'; -import { EpersonGroupListComponent } from '../../eperson-group-list/eperson-group-list.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; export interface ResourcePolicyEvent { object: ResourcePolicy; @@ -67,7 +96,7 @@ export interface ResourcePolicyEvent { NgIf, NgFor, ], - standalone: true + standalone: true, }) /** * Component that show form for adding/editing a resource policy diff --git a/src/app/shared/resource-policies/resource-policies.component.spec.ts b/src/app/shared/resource-policies/resource-policies.component.spec.ts index 2e6a59d286..af9b134e5e 100644 --- a/src/app/shared/resource-policies/resource-policies.component.spec.ts +++ b/src/app/shared/resource-policies/resource-policies.component.spec.ts @@ -221,7 +221,7 @@ describe('ResourcePoliciesComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, ReactiveFormsModule, @@ -230,8 +230,8 @@ describe('ResourcePoliciesComponent test suite', () => { ResourcePolicyEntryComponent, TestComponent, HasValuePipe, - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: EPersonDataService, useValue: epersonService }, @@ -243,10 +243,10 @@ describe('ResourcePoliciesComponent test suite', () => { { provide: DSONameService, useValue: dsoNameService }, ChangeDetectorRef, ResourcePoliciesComponent, - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -444,12 +444,12 @@ describe('ResourcePoliciesComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule, - FormsModule, - ReactiveFormsModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule, + FormsModule, + ReactiveFormsModule], }) class TestComponent { diff --git a/src/app/shared/resource-policies/resource-policies.component.ts b/src/app/shared/resource-policies/resource-policies.component.ts index 1c81f513a2..1d098f554d 100644 --- a/src/app/shared/resource-policies/resource-policies.component.ts +++ b/src/app/shared/resource-policies/resource-policies.component.ts @@ -1,9 +1,38 @@ -import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; - -import { BehaviorSubject, from as observableFrom, Observable, Subscription } from 'rxjs'; -import { concatMap, distinctUntilChanged, filter, map, reduce, scan, take } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + from as observableFrom, + Observable, + Subscription, +} from 'rxjs'; +import { + concatMap, + distinctUntilChanged, + filter, + map, + reduce, + scan, + take, +} from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { RequestService } from '../../core/data/request.service'; @@ -12,11 +41,17 @@ import { GroupDataService } from '../../core/eperson/group-data.service'; import { ResourcePolicy } from '../../core/resource-policy/models/resource-policy.model'; import { ResourcePolicyDataService } from '../../core/resource-policy/resource-policy-data.service'; import { getAllSucceededRemoteData } from '../../core/shared/operators'; -import { hasValue, isEmpty, isNotEmpty, } from '../empty.util'; +import { + hasValue, + isEmpty, + isNotEmpty, +} from '../empty.util'; import { NotificationsService } from '../notifications/notifications.service'; import { followLink } from '../utils/follow-link-config.model'; -import { ResourcePolicyCheckboxEntry, ResourcePolicyEntryComponent } from './entry/resource-policy-entry.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { + ResourcePolicyCheckboxEntry, + ResourcePolicyEntryComponent, +} from './entry/resource-policy-entry.component'; @Component({ selector: 'ds-resource-policies', @@ -27,9 +62,9 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; TranslateModule, NgIf, AsyncPipe, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * Component that shows the policies for given resource diff --git a/src/app/shared/resource-policies/resource-policies.module.ts b/src/app/shared/resource-policies/resource-policies.module.ts index ad7e1622c9..4c75647f61 100644 --- a/src/app/shared/resource-policies/resource-policies.module.ts +++ b/src/app/shared/resource-policies/resource-policies.module.ts @@ -4,12 +4,12 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { FormModule } from '../form/form.module'; -import { ResourcePolicyResolver } from './resolvers/resource-policy.resolver'; -import { ResourcePolicyTargetResolver } from './resolvers/resource-policy-target.resolver'; import { ResourcePolicyCreateComponent } from './create/resource-policy-create.component'; import { ResourcePolicyEditComponent } from './edit/resource-policy-edit.component'; import { ResourcePolicyEntryComponent } from './entry/resource-policy-entry.component'; import { ResourcePolicyFormComponent } from './form/resource-policy-form.component'; +import { ResourcePolicyResolver } from './resolvers/resource-policy.resolver'; +import { ResourcePolicyTargetResolver } from './resolvers/resource-policy-target.resolver'; import { ResourcePoliciesComponent } from './resource-policies.component'; const COMPONENTS = [ @@ -26,17 +26,17 @@ const PROVIDERS = [ ]; @NgModule({ - imports: [ - NgbModule, - CommonModule, - FormModule, - TranslateModule, - ...COMPONENTS - ], - providers: [ + imports: [ + NgbModule, + CommonModule, + FormModule, + TranslateModule, + ...COMPONENTS, + ], + providers: [ ...PROVIDERS, - ], - exports: [ + ], + exports: [ ...COMPONENTS, ], }) diff --git a/src/app/shared/results-back-button/results-back-button.component.spec.ts b/src/app/shared/results-back-button/results-back-button.component.spec.ts index 67fab8f681..12e5e255fd 100644 --- a/src/app/shared/results-back-button/results-back-button.component.spec.ts +++ b/src/app/shared/results-back-button/results-back-button.component.spec.ts @@ -1,7 +1,14 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { of } from 'rxjs'; import { ResultsBackButtonComponent } from './results-back-button.component'; @@ -20,13 +27,13 @@ describe('ResultsBackButtonComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), ResultsBackButtonComponent], - providers: [ + imports: [TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), ResultsBackButtonComponent], + providers: [ { provide: TranslateService, useValue: translate }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); describe('from a metadata browse list', () => { diff --git a/src/app/shared/results-back-button/results-back-button.component.ts b/src/app/shared/results-back-button/results-back-button.component.ts index 2854bfa918..ebae3911ad 100644 --- a/src/app/shared/results-back-button/results-back-button.component.ts +++ b/src/app/shared/results-back-button/results-back-button.component.ts @@ -1,15 +1,20 @@ -import { ChangeDetectionStrategy, Component, Input, OnInit, } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; import { AsyncPipe } from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Input, + OnInit, +} from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; @Component({ - selector: 'ds-results-back-button', - styleUrls: ['./results-back-button.component.scss'], - templateUrl: './results-back-button.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - standalone: true, - imports: [AsyncPipe] + selector: 'ds-results-back-button', + styleUrls: ['./results-back-button.component.scss'], + templateUrl: './results-back-button.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [AsyncPipe], }) /** * Component for creating a back to result list button. diff --git a/src/app/shared/results-back-button/themed-results-back-button.component.ts b/src/app/shared/results-back-button/themed-results-back-button.component.ts index ea734f0015..d096c2af81 100644 --- a/src/app/shared/results-back-button/themed-results-back-button.component.ts +++ b/src/app/shared/results-back-button/themed-results-back-button.component.ts @@ -8,10 +8,10 @@ import { ThemedComponent } from '../theme-support/themed.component'; import { ResultsBackButtonComponent } from './results-back-button.component'; @Component({ - selector: 'ds-themed-results-back-button', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-results-back-button', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', + standalone: true, }) export class ThemedResultsBackButtonComponent extends ThemedComponent { diff --git a/src/app/shared/roles/role.directive.ts b/src/app/shared/roles/role.directive.ts index 7bd563928e..2401ac91b6 100644 --- a/src/app/shared/roles/role.directive.ts +++ b/src/app/shared/roles/role.directive.ts @@ -24,8 +24,8 @@ import { RoleType } from '../../core/roles/role-types'; import { hasValue } from '../empty.util'; @Directive({ - selector: '[dsShowOnlyForRole],[dsShowExceptForRole]', - standalone: true + selector: '[dsShowOnlyForRole],[dsShowExceptForRole]', + standalone: true, }) /** * Structural Directive for showing or hiding a template based on current user role diff --git a/src/app/shared/rss-feed/rss.component.spec.ts b/src/app/shared/rss-feed/rss.component.spec.ts index 890551e3a0..724d0abf4a 100644 --- a/src/app/shared/rss-feed/rss.component.spec.ts +++ b/src/app/shared/rss-feed/rss.component.spec.ts @@ -80,17 +80,17 @@ describe('RssComponent', () => { paginatedSearchOptions: mockSearchOptions, }; TestBed.configureTestingModule({ - imports: [RSSComponent], - providers: [ + imports: [RSSComponent], + providers: [ { provide: GroupDataService, useValue: groupDataService }, { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, { provide: PaginationService, useValue: paginationService }, - { provide: Router, useValue: new RouterMock() } - ] -}).compileComponents(); - })); + { provide: Router, useValue: new RouterMock() }, + ], + }).compileComponents(); + })); beforeEach(() => { uuid = '2cfcf65e-0a51-4bcb-8592-b8db7b064790'; diff --git a/src/app/shared/rss-feed/rss.component.ts b/src/app/shared/rss-feed/rss.component.ts index 2304d285d4..9865c1dd06 100644 --- a/src/app/shared/rss-feed/rss.component.ts +++ b/src/app/shared/rss-feed/rss.component.ts @@ -1,7 +1,25 @@ -import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, ViewEncapsulation, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + OnDestroy, + OnInit, + ViewEncapsulation, +} from '@angular/core'; import { Router } from '@angular/router'; -import { BehaviorSubject, Observable, Subscription, } from 'rxjs'; -import { map, switchMap, } from 'rxjs/operators'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + Subscription, +} from 'rxjs'; +import { + map, + switchMap, +} from 'rxjs/operators'; import { environment } from '../../../../src/environments/environment'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; @@ -12,22 +30,20 @@ import { LinkHeadService } from '../../core/services/link-head.service'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; /** * The Rss feed button componenet. */ @Component({ - exportAs: 'rssComponent', - selector: 'ds-rss', - styleUrls: ['rss.component.scss'], - templateUrl: 'rss.component.html', - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + exportAs: 'rssComponent', + selector: 'ds-rss', + styleUrls: ['rss.component.scss'], + templateUrl: 'rss.component.html', + changeDetection: ChangeDetectionStrategy.Default, + encapsulation: ViewEncapsulation.Emulated, + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule], }) export class RSSComponent implements OnInit, OnDestroy { diff --git a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.spec.ts b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.spec.ts index 09ebf3d626..e4d9514249 100644 --- a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.spec.ts +++ b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.spec.ts @@ -1,14 +1,24 @@ -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../core/shared/community.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector/dso-selector.component'; import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; import { RouterStub } from '../../testing/router.stub'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector/dso-selector.component'; import { ScopeSelectorModalComponent } from './scope-selector-modal.component'; describe('ScopeSelectorModalComponent', () => { @@ -29,7 +39,7 @@ describe('ScopeSelectorModalComponent', () => { const modalStub = jasmine.createSpyObj('modalStub', ['close']); beforeEach(waitForAsync(async () => { - await TestBed.configureTestingModule({ + await TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), ScopeSelectorModalComponent], providers: [ { provide: NgbActiveModal, useValue: modalStub }, diff --git a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts index f2c400f2f0..a53b87caf1 100644 --- a/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts +++ b/src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts @@ -1,13 +1,20 @@ -import { Component, EventEmitter, OnInit, } from '@angular/core'; +import { + Component, + EventEmitter, + OnInit, +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { environment } from '../../../../environments/environment'; -import { TranslateModule } from '@ngx-translate/core'; -import { DSOSelectorComponent } from '../../dso-selector/dso-selector/dso-selector.component'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; +import { DSOSelectorComponent } from '../../dso-selector/dso-selector/dso-selector.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType, @@ -20,11 +27,11 @@ import { * Used to select a scope */ @Component({ - selector: 'ds-scope-selector-modal', - styleUrls: ['./scope-selector-modal.component.scss'], - templateUrl: './scope-selector-modal.component.html', - standalone: true, - imports: [DSOSelectorComponent, TranslateModule] + selector: 'ds-scope-selector-modal', + styleUrls: ['./scope-selector-modal.component.scss'], + templateUrl: './scope-selector-modal.component.html', + standalone: true, + imports: [DSOSelectorComponent, TranslateModule], }) export class ScopeSelectorModalComponent extends DSOSelectorModalWrapperComponent implements OnInit { objectType = DSpaceObjectType.COMMUNITY; diff --git a/src/app/shared/search-form/search-form.component.spec.ts b/src/app/shared/search-form/search-form.component.spec.ts index 6ead1cb72a..532d5778ea 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -1,5 +1,11 @@ import { DebugElement } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; @@ -35,15 +41,15 @@ describe('SearchFormComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot(), SearchFormComponent], - providers: [ + imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot(), SearchFormComponent], + providers: [ { provide: Router, useValue: router }, { provide: SearchService, useValue: searchService }, { provide: PaginationService, useValue: paginationService }, { provide: SearchConfigurationService, useValue: searchConfigService }, { provide: DSpaceObjectDataService, useValue: dspaceObjectService }, - ], -}).compileComponents(); + ], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/search-form/search-form.component.ts b/src/app/shared/search-form/search-form.component.ts index dd9e46bc4b..325f8a074e 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -1,6 +1,21 @@ -import { Component, EventEmitter, Input, OnChanges, Output, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnChanges, + Output, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { Router } from '@angular/router'; -import { NgbModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbTooltipModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -9,22 +24,22 @@ import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.serv import { PaginationService } from '../../core/pagination/pagination.service'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { FormsModule } from '@angular/forms'; import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { hasValue, isNotEmpty, } from '../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../empty.util'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; import { currentPath } from '../utils/route.utils'; import { ScopeSelectorModalComponent } from './scope-selector-modal/scope-selector-modal.component'; @Component({ - selector: 'ds-search-form', - styleUrls: ['./search-form.component.scss'], - templateUrl: './search-form.component.html', - standalone: true, - imports: [FormsModule, NgIf, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe] + selector: 'ds-search-form', + styleUrls: ['./search-form.component.scss'], + templateUrl: './search-form.component.html', + standalone: true, + imports: [FormsModule, NgIf, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) /** * Component that represents the search form diff --git a/src/app/shared/search-form/themed-search-form.component.ts b/src/app/shared/search-form/themed-search-form.component.ts index 89f8707a05..301ee86acf 100644 --- a/src/app/shared/search-form/themed-search-form.component.ts +++ b/src/app/shared/search-form/themed-search-form.component.ts @@ -12,10 +12,10 @@ import { SearchFormComponent } from './search-form.component'; * Themed wrapper for {@link SearchFormComponent} */ @Component({ - selector: 'ds-themed-search-form', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-form', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchFormComponent extends ThemedComponent { diff --git a/src/app/shared/search/advanced-search/advanced-search.component.spec.ts b/src/app/shared/search/advanced-search/advanced-search.component.spec.ts index ba7d0814d5..97b96e8884 100644 --- a/src/app/shared/search/advanced-search/advanced-search.component.spec.ts +++ b/src/app/shared/search/advanced-search/advanced-search.component.spec.ts @@ -45,8 +45,8 @@ describe('AdvancedSearchComponent', () => { }; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot(), BrowserAnimationsModule, ReactiveFormsModule, BrowserOnlyMockPipe, AdvancedSearchComponent], - providers: [ + imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot(), BrowserAnimationsModule, ReactiveFormsModule, BrowserOnlyMockPipe, AdvancedSearchComponent], + providers: [ FormBuilder, { provide: APP_CONFIG, useValue: environment }, { provide: FormBuilderService, useValue: builderService }, @@ -54,9 +54,9 @@ describe('AdvancedSearchComponent', () => { { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: RemoteDataBuildService, useValue: {} }, { provide: SearchService, useValue: searchServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(AdvancedSearchComponent, { + }).overrideComponent(AdvancedSearchComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); }); diff --git a/src/app/shared/search/advanced-search/advanced-search.component.ts b/src/app/shared/search/advanced-search/advanced-search.component.ts index 3d2e54879c..3ed23c8052 100644 --- a/src/app/shared/search/advanced-search/advanced-search.component.ts +++ b/src/app/shared/search/advanced-search/advanced-search.component.ts @@ -1,3 +1,8 @@ +import { + LowerCasePipe, + NgClass, + NgForOf, +} from '@angular/common'; import { Component, Inject, @@ -6,28 +11,33 @@ import { } from '@angular/core'; import { FormBuilder, + FormBuilder, + FormControl, FormControl, FormGroup, + FormGroup, + ReactiveFormsModule, + Validators, Validators, } from '@angular/forms'; import { Router } from '@angular/router'; -import { slide } from '../../animations/slide'; -import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { APP_CONFIG, + APP_CONFIG, + AppConfig, AppConfig, } from 'src/config/app-config.interface'; import { SearchService } from '../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { APP_CONFIG, AppConfig } from 'src/config/app-config.interface'; -import { LowerCasePipe, NgClass, NgForOf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { BrowserOnlyPipe } from '../../utils/browser-only.pipe'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; - import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; -import { slide } from '../../animations/slide'; +import { + slide, + slide, +} from '../../animations/slide'; +import { BrowserOnlyPipe } from '../../utils/browser-only.pipe'; @Component({ selector: 'ds-advanced-search', @@ -40,9 +50,9 @@ import { slide } from '../../animations/slide'; ReactiveFormsModule, BrowserOnlyPipe, LowerCasePipe, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** * This component represents the part of the search sidebar that contains advanced filters. diff --git a/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts b/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts index ec684d040d..fc4052a52e 100644 --- a/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts +++ b/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts @@ -60,14 +60,14 @@ describe('SearchExportCsvComponent', () => { router = jasmine.createSpyObj('authorizationService', ['navigateByUrl']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NgbModule, SearchExportCsvComponent], - providers: [ + imports: [TranslateModule.forRoot(), NgbModule, SearchExportCsvComponent], + providers: [ { provide: ScriptDataService, useValue: scriptDataService }, { provide: AuthorizationDataService, useValue: authorizationDataService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Router, useValue: router }, ], -}).compileComponents(); + }).compileComponents(); } function initBeforeEach() { diff --git a/src/app/shared/search/search-export-csv/search-export-csv.component.ts b/src/app/shared/search/search-export-csv/search-export-csv.component.ts index e8d52279e3..9e25e387c2 100644 --- a/src/app/shared/search/search-export-csv/search-export-csv.component.ts +++ b/src/app/shared/search/search-export-csv/search-export-csv.component.ts @@ -1,7 +1,22 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { combineLatest as observableCombineLatest, Observable, } from 'rxjs'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, + Observable, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; @@ -11,18 +26,19 @@ import { RemoteData } from '../../../core/data/remote-data'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { getProcessDetailRoute } from '../../../process-page/process-page-routing.paths'; import { Process } from '../../../process-page/processes/process.model'; -import { hasValue, isNotEmpty, } from '../../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../empty.util'; import { NotificationsService } from '../../notifications/notifications.service'; import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; -import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgIf } from '@angular/common'; @Component({ - selector: 'ds-search-export-csv', - styleUrls: ['./search-export-csv.component.scss'], - templateUrl: './search-export-csv.component.html', - standalone: true, - imports: [NgIf, NgbTooltipModule, AsyncPipe, TranslateModule] + selector: 'ds-search-export-csv', + styleUrls: ['./search-export-csv.component.scss'], + templateUrl: './search-export-csv.component.html', + standalone: true, + imports: [NgIf, NgbTooltipModule, AsyncPipe, TranslateModule], }) /** * Display a button to export the current search results as csv diff --git a/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts index b2dc9ef489..eaf5768cce 100644 --- a/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts @@ -1,25 +1,30 @@ -import { Component, OnInit } from '@angular/core'; -import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; -import { TranslateModule } from '@ngx-translate/core'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; + +import { FilterInputSuggestionsComponent } from '../../../../input-suggestions/filter-suggestions/filter-input-suggestions.component'; import { - FilterInputSuggestionsComponent -} from '../../../../input-suggestions/filter-suggestions/filter-input-suggestions.component'; -import { - SearchFacetOptionComponent -} from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; -import { - SearchFacetSelectedOptionComponent -} from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; + facetLoad, + SearchFacetFilterComponent, +} from '../search-facet-filter/search-facet-filter.component'; +import { SearchFacetOptionComponent } from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; +import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; @Component({ - selector: 'ds-search-authority-filter', - styleUrls: ['./search-authority-filter.component.scss'], - templateUrl: './search-authority-filter.component.html', - animations: [facetLoad], - standalone: true, - imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule] + selector: 'ds-search-authority-filter', + styleUrls: ['./search-authority-filter.component.scss'], + templateUrl: './search-authority-filter.component.html', + animations: [facetLoad], + standalone: true, + imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts index 6af2c4afde..5c52b5b529 100644 --- a/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts @@ -1,21 +1,28 @@ -import { Component, OnInit } from '@angular/core'; -import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + import { - SearchFacetOptionComponent -} from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; -import { - SearchFacetSelectedOptionComponent -} from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; + facetLoad, + SearchFacetFilterComponent, +} from '../search-facet-filter/search-facet-filter.component'; +import { SearchFacetOptionComponent } from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; +import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; @Component({ - selector: 'ds-search-boolean-filter', - styleUrls: ['./search-boolean-filter.component.scss'], - templateUrl: './search-boolean-filter.component.html', - animations: [facetLoad], - standalone: true, - imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, AsyncPipe, TranslateModule] + selector: 'ds-search-boolean-filter', + styleUrls: ['./search-boolean-filter.component.scss'], + templateUrl: './search-boolean-filter.component.html', + animations: [facetLoad], + standalone: true, + imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts index 0beaa0e1c8..4b5e4609e6 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts @@ -1,9 +1,19 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + 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 { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -11,6 +21,7 @@ import { PaginationService } from '../../../../../../core/pagination/pagination. import { SearchService } from '../../../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service'; +import { ActivatedRouteStub } from '../../../../../../shared/testing/active-router.stub'; import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; import { RouterStub } from '../../../../../testing/router.stub'; @@ -20,7 +31,6 @@ import { FacetValue } from '../../../../models/facet-value.model'; import { FilterType } from '../../../../models/filter-type.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { SearchFacetOptionComponent } from './search-facet-option.component'; -import { ActivatedRouteStub } from '../../../../../../shared/testing/active-router.stub'; describe('SearchFacetOptionComponent', () => { let comp: SearchFacetOptionComponent; @@ -91,34 +101,34 @@ describe('SearchFacetOptionComponent', () => { const paginationService = new PaginationServiceStub(pagination); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetOptionComponent, ShortNumberPipe], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetOptionComponent, ShortNumberPipe], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: Router, useValue: new RouterStub() }, { provide: PaginationService, useValue: paginationService }, { - provide: SearchConfigurationService, useValue: { - paginationID: 'page-id', + provide: SearchConfigurationService, useValue: { + paginationID: 'page-id', searchOptions: observableOf({}), }, }, { - provide: SearchFilterService, useValue: { - getSelectedValuesForFilter: () => selectedValues, - isFilterActiveWithValue: (paramName: string, filterValue: string) => observableOf(true), - getPage: (paramName: string) => page, - /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - incrementPage: (filterName: string) => { - }, - resetPage: (filterName: string) => { + provide: SearchFilterService, useValue: { + getSelectedValuesForFilter: () => selectedValues, + isFilterActiveWithValue: (paramName: string, filterValue: string) => observableOf(true), + getPage: (paramName: string) => page, + /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ + incrementPage: (filterName: string) => { }, - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } + resetPage: (filterName: string) => { + }, + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ + }, }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchFacetOptionComponent, { + }).overrideComponent(SearchFacetOptionComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts index 91b818558c..97d49c3605 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts @@ -1,9 +1,24 @@ -import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { combineLatest as observableCombineLatest, Observable, Subscription, } from 'rxjs'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, + Observable, + Subscription, +} from 'rxjs'; import { map } from 'rxjs/operators'; -import { FacetValue } from '../../../../models/facet-value.model'; -import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -11,17 +26,17 @@ import { SearchConfigurationService } from '../../../../../../core/shared/search import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service'; import { hasValue } from '../../../../../empty.util'; import { currentPath } from '../../../../../utils/route.utils'; -import { getFacetValueForType } from '../../../../search.utils'; import { ShortNumberPipe } from '../../../../../utils/short-number.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { FacetValue } from '../../../../models/facet-value.model'; +import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; +import { getFacetValueForType } from '../../../../search.utils'; @Component({ - selector: 'ds-search-facet-option', - styleUrls: ['./search-facet-option.component.scss'], - templateUrl: './search-facet-option.component.html', - standalone: true, - imports: [NgIf, RouterLink, AsyncPipe, TranslateModule, ShortNumberPipe] + selector: 'ds-search-facet-option', + styleUrls: ['./search-facet-option.component.scss'], + templateUrl: './search-facet-option.component.html', + standalone: true, + imports: [NgIf, RouterLink, AsyncPipe, TranslateModule, ShortNumberPipe], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts index ea468558d4..8e5f0dc730 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts @@ -1,21 +1,30 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + 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 { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { Router, RouterLink } from '@angular/router'; +import { + Router, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../../../core/shared/search/search.service'; -import { SearchServiceStub } from '../../../../../testing/search-service.stub'; -import { RouterStub } from '../../../../../testing/router.stub'; import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service'; -import { SearchFacetRangeOptionComponent } from './search-facet-range-option.component'; import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; +import { RouterStub } from '../../../../../testing/router.stub'; +import { SearchServiceStub } from '../../../../../testing/search-service.stub'; import { ShortNumberPipe } from '../../../../../utils/short-number.pipe'; import { FacetValue } from '../../../../models/facet-value.model'; import { FilterType } from '../../../../models/filter-type.model'; @@ -24,6 +33,7 @@ import { RANGE_FILTER_MAX_SUFFIX, RANGE_FILTER_MIN_SUFFIX, } from '../../search-range-filter/search-range-filter.component'; +import { SearchFacetRangeOptionComponent } from './search-facet-range-option.component'; describe('SearchFacetRangeOptionComponent', () => { let comp: SearchFacetRangeOptionComponent; @@ -91,7 +101,7 @@ describe('SearchFacetRangeOptionComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(SearchFacetRangeOptionComponent, { remove: { - imports: [RouterLink] + imports: [RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts index 42846e2684..2a68b1e50e 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts @@ -1,6 +1,21 @@ -import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { Observable, Subscription, } from 'rxjs'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + Observable, + Subscription, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; @@ -10,7 +25,6 @@ import { SearchFilterService } from '../../../../../../core/shared/search/search import { hasValue } from '../../../../../empty.util'; import { currentPath } from '../../../../../utils/route.utils'; import { ShortNumberPipe } from '../../../../../utils/short-number.pipe'; -import { AsyncPipe, NgIf } from '@angular/common'; import { FacetValue } from '../../../../models/facet-value.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { @@ -21,12 +35,12 @@ import { const rangeDelimiter = '-'; @Component({ - selector: 'ds-search-facet-range-option', - styleUrls: ['./search-facet-range-option.component.scss'], - // templateUrl: './search-facet-range-option.component.html', - templateUrl: './search-facet-range-option.component.html', - standalone: true, - imports: [NgIf, RouterLink, AsyncPipe, ShortNumberPipe] + selector: 'ds-search-facet-range-option', + styleUrls: ['./search-facet-range-option.component.scss'], + // templateUrl: './search-facet-range-option.component.html', + templateUrl: './search-facet-range-option.component.html', + standalone: true, + imports: [NgIf, RouterLink, AsyncPipe, ShortNumberPipe], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.spec.ts index e663f788f1..37fc595c06 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.spec.ts @@ -1,8 +1,18 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -10,6 +20,7 @@ import { PaginationService } from '../../../../../../core/pagination/pagination. import { SearchService } from '../../../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service'; +import { ActivatedRouteStub } from '../../../../../../shared/testing/active-router.stub'; import { PaginationComponentOptions } from '../../../../../pagination/pagination-component-options.model'; import { PaginationServiceStub } from '../../../../../testing/pagination-service.stub'; import { RouterStub } from '../../../../../testing/router.stub'; @@ -18,7 +29,6 @@ import { FacetValue } from '../../../../models/facet-value.model'; import { FilterType } from '../../../../models/filter-type.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { SearchFacetSelectedOptionComponent } from './search-facet-selected-option.component'; -import { ActivatedRouteStub } from '../../../../../../shared/testing/active-router.stub'; describe('SearchFacetSelectedOptionComponent', () => { let comp: SearchFacetSelectedOptionComponent; @@ -116,33 +126,33 @@ describe('SearchFacetSelectedOptionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetSelectedOptionComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetSelectedOptionComponent], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: Router, useValue: new RouterStub() }, { provide: PaginationService, useValue: paginationService }, { - provide: SearchConfigurationService, useValue: { + provide: SearchConfigurationService, useValue: { searchOptions: observableOf({}), }, }, { - provide: SearchFilterService, useValue: { - getSelectedValuesForFilter: () => selectedValues, - isFilterActiveWithValue: (paramName: string, filterValue: string) => observableOf(true), - getPage: (paramName: string) => page, - /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - incrementPage: (filterName: string) => { - }, - resetPage: (filterName: string) => { + provide: SearchFilterService, useValue: { + getSelectedValuesForFilter: () => selectedValues, + isFilterActiveWithValue: (paramName: string, filterValue: string) => observableOf(true), + getPage: (paramName: string) => page, + /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ + incrementPage: (filterName: string) => { }, - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } + resetPage: (filterName: string) => { + }, + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ + }, }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchFacetSelectedOptionComponent, { + }).overrideComponent(SearchFacetSelectedOptionComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts index 503a3af3bd..f8b95fdd25 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts @@ -1,6 +1,19 @@ -import { Component, Input, OnDestroy, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { combineLatest as observableCombineLatest, Observable, Subscription, } from 'rxjs'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + combineLatest as observableCombineLatest, + Observable, + Subscription, +} from 'rxjs'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -11,14 +24,13 @@ import { currentPath } from '../../../../../utils/route.utils'; import { FacetValue } from '../../../../models/facet-value.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { getFacetValueForType } from '../../../../search.utils'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-search-facet-selected-option', - styleUrls: ['./search-facet-selected-option.component.scss'], - templateUrl: './search-facet-selected-option.component.html', - standalone: true, - imports: [RouterLink, TranslateModule] + selector: 'ds-search-facet-selected-option', + styleUrls: ['./search-facet-selected-option.component.scss'], + templateUrl: './search-facet-selected-option.component.html', + standalone: true, + imports: [RouterLink, TranslateModule], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component.ts index c13cd89714..76a3c62536 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component.ts @@ -1,4 +1,10 @@ -import { Component, Injector, Input, OnInit, } from '@angular/core'; +import { NgComponentOutlet } from '@angular/common'; +import { + Component, + Injector, + Input, + OnInit, +} from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; @@ -12,13 +18,12 @@ import { FilterType } from '../../../models/filter-type.model'; import { SearchFilterConfig } from '../../../models/search-filter-config.model'; import { SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; import { renderFilterType } from '../search-filter-type-decorator'; -import { NgComponentOutlet } from '@angular/common'; @Component({ - selector: 'ds-search-facet-filter-wrapper', - templateUrl: './search-facet-filter-wrapper.component.html', - standalone: true, - imports: [NgComponentOutlet] + selector: 'ds-search-facet-filter-wrapper', + templateUrl: './search-facet-filter-wrapper.component.html', + standalone: true, + imports: [NgComponentOutlet], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts index 135deaad3b..b245126d05 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts @@ -1,10 +1,20 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { buildPaginatedList } from '../../../../../core/data/paginated-list.model'; @@ -91,8 +101,8 @@ describe('SearchFacetFilterComponent', () => { const mockValues = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), values)); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetFilterComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetFilterComponent], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: Router, useValue: new RouterStub() }, { provide: FILTER_CONFIG, useValue: new SearchFilterConfig() }, @@ -102,21 +112,21 @@ describe('SearchFacetFilterComponent', () => { { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) }, { provide: SCOPE, useValue: undefined }, { - provide: SearchFilterService, useValue: { - getSelectedValuesForFilter: () => observableOf(selectedValues), - isFilterActiveWithValue: (paramName: string, filterValue: string) => true, - getPage: (paramName: string) => page, - /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - incrementPage: (filterName: string) => { - }, - resetPage: (filterName: string) => { + provide: SearchFilterService, useValue: { + getSelectedValuesForFilter: () => observableOf(selectedValues), + isFilterActiveWithValue: (paramName: string, filterValue: string) => true, + getPage: (paramName: string) => page, + /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ + incrementPage: (filterName: string) => { }, - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ + resetPage: (filterName: string) => { + }, + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ }, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchFacetFilterComponent, { + }).overrideComponent(SearchFacetFilterComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts index 847b6711f6..dabea2c1e2 100644 --- a/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts @@ -1,5 +1,16 @@ -import { animate, state, style, transition, trigger, } from '@angular/animations'; -import { Component, Inject, OnDestroy, OnInit, } from '@angular/core'; +import { + animate, + state, + style, + transition, + trigger, +} from '@angular/animations'; +import { + Component, + Inject, + OnDestroy, + OnInit, +} from '@angular/core'; import { Router } from '@angular/router'; import { BehaviorSubject, @@ -9,7 +20,16 @@ import { Subject, Subscription, } from 'rxjs'; -import { debounceTime, distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap, } from 'rxjs/operators'; +import { + debounceTime, + distinctUntilChanged, + filter, + map, + mergeMap, + switchMap, + take, + tap, +} from 'rxjs/operators'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { PaginatedList } from '../../../../../core/data/paginated-list.model'; @@ -24,23 +44,30 @@ import { SCOPE, SearchFilterService, } from '../../../../../core/shared/search/search-filter.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; -import { hasNoValue, hasValue, isNotEmpty, } from '../../../../empty.util'; +import { + hasNoValue, + hasValue, + isNotEmpty, +} from '../../../../empty.util'; import { InputSuggestion } from '../../../../input-suggestions/input-suggestions.model'; -import { SearchOptions } from '../../../models/search-options.model'; import { createPendingRemoteDataObject } from '../../../../remote-data.utils'; import { EmphasizePipe } from '../../../../utils/emphasize.pipe'; import { currentPath } from '../../../../utils/route.utils'; import { FacetValue } from '../../../models/facet-value.model'; import { FacetValues } from '../../../models/facet-values.model'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SearchFilterConfig } from '../../../models/search-filter-config.model'; -import { getFacetValueForType, stripOperatorFromFilterValue, } from '../../../search.utils'; +import { SearchOptions } from '../../../models/search-options.model'; +import { + getFacetValueForType, + stripOperatorFromFilterValue, +} from '../../../search.utils'; @Component({ - selector: 'ds-search-facet-filter', - template: ``, - standalone: true + selector: 'ds-search-facet-filter', + template: ``, + standalone: true, }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-filter-type-decorator.ts b/src/app/shared/search/search-filters/search-filter/search-filter-type-decorator.ts index 26d47dbd06..563d9cece0 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter-type-decorator.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter-type-decorator.ts @@ -1,9 +1,9 @@ import { FilterType } from '../../models/filter-type.model'; -import { SearchTextFilterComponent } from './search-text-filter/search-text-filter.component'; import { SearchAuthorityFilterComponent } from './search-authority-filter/search-authority-filter.component'; import { SearchBooleanFilterComponent } from './search-boolean-filter/search-boolean-filter.component'; import { SearchHierarchyFilterComponent } from './search-hierarchy-filter/search-hierarchy-filter.component'; import { SearchRangeFilterComponent } from './search-range-filter/search-range-filter.component'; +import { SearchTextFilterComponent } from './search-text-filter/search-text-filter.component'; /** * Contains the mapping between a facet component and a FilterType diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts index c03d18e9ba..e91860bbb4 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts @@ -1,19 +1,29 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { SearchService } from '../../../../core/shared/search/search.service'; -import { SearchFilterComponent } from './search-filter.component'; -import { SearchFilterConfig } from '../../models/search-filter-config.model'; -import { FilterType } from '../../models/filter-type.model'; -import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; import { SequenceService } from '../../../../core/shared/sequence.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; -import { SearchFacetFilterWrapperComponent } from './search-facet-filter-wrapper/search-facet-filter-wrapper.component'; import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; +import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; +import { FilterType } from '../../models/filter-type.model'; +import { SearchFilterConfig } from '../../models/search-filter-config.model'; +import { SearchFacetFilterWrapperComponent } from './search-facet-filter-wrapper/search-facet-filter-wrapper.component'; +import { SearchFilterComponent } from './search-filter.component'; describe('SearchFilterComponent', () => { let comp: SearchFilterComponent; @@ -62,20 +72,20 @@ describe('SearchFilterComponent', () => { sequenceService = jasmine.createSpyObj('sequenceService', { next: 17 }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, SearchFilterComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, SearchFilterComponent], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { - provide: SearchFilterService, + provide: SearchFilterService, useValue: mockFilterService, }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: SequenceService, useValue: sequenceService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchFilterComponent, { + }).overrideComponent(SearchFilterComponent, { add: { changeDetection: ChangeDetectionStrategy.Default }, - remove: { imports: [SearchFacetFilterWrapperComponent]} + remove: { imports: [SearchFacetFilterWrapperComponent] }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts index 5cdc81b561..81e4cd2389 100644 --- a/src/app/shared/search/search-filters/search-filter/search-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-filter.component.ts @@ -1,27 +1,50 @@ -import { Component, Inject, Input, OnInit, } from '@angular/core'; -import { BehaviorSubject, Observable, of as observableOf, } from 'rxjs'; -import { filter, map, startWith, switchMap, take, } from 'rxjs/operators'; +import { + AsyncPipe, + LowerCasePipe, + NgClass, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + of as observableOf, +} from 'rxjs'; +import { + filter, + map, + startWith, + switchMap, + take, +} from 'rxjs/operators'; import { SearchService } from '../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../../core/shared/search/search-filter.service'; import { SequenceService } from '../../../../core/shared/sequence.service'; -import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchFacetFilterWrapperComponent } from './search-facet-filter-wrapper/search-facet-filter-wrapper.component'; -import { AsyncPipe, LowerCasePipe, NgClass, NgIf } from '@angular/common'; import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { slide } from '../../../animations/slide'; -import { hasValue, isNotEmpty, } from '../../../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../../empty.util'; +import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; import { SearchFilterConfig } from '../../models/search-filter-config.model'; +import { SearchFacetFilterWrapperComponent } from './search-facet-filter-wrapper/search-facet-filter-wrapper.component'; @Component({ - selector: 'ds-search-filter', - styleUrls: ['./search-filter.component.scss'], - templateUrl: './search-filter.component.html', - animations: [slide], - standalone: true, - imports: [NgIf, NgClass, SearchFacetFilterWrapperComponent, AsyncPipe, LowerCasePipe, TranslateModule, BrowserOnlyPipe] + selector: 'ds-search-filter', + styleUrls: ['./search-filter.component.scss'], + templateUrl: './search-filter.component.html', + animations: [slide], + standalone: true, + imports: [NgIf, NgClass, SearchFacetFilterWrapperComponent, AsyncPipe, LowerCasePipe, TranslateModule, BrowserOnlyPipe], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts index d7bc158d3d..37d895315b 100644 --- a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts @@ -1,11 +1,26 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, EventEmitter, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, } from '@angular/core/testing'; +import { + DebugElement, + EventEmitter, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { Router } from '@angular/router'; -import { NgbModal, NgbModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModule, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { APP_CONFIG } from '../../../../../../config/app-config.interface'; import { environment } from '../../../../../../environments/environment.test'; @@ -22,16 +37,14 @@ import { SCOPE, SearchFilterService, } from '../../../../../core/shared/search/search-filter.service'; -import { - VocabularyEntryDetail -} from '../../../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; +import { VocabularyEntryDetail } from '../../../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; import { VocabularyService } from '../../../../../core/submission/vocabularies/vocabulary.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { RouterStub } from '../../../../testing/router.stub'; import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub'; import { FacetValue } from '../../../models/facet-value.model'; import { SearchFilterConfig } from '../../../models/search-filter-config.model'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SearchHierarchyFilterComponent } from './search-hierarchy-filter.component'; describe('SearchHierarchyFilterComponent', () => { @@ -64,13 +77,13 @@ describe('SearchHierarchyFilterComponent', () => { beforeEach(() => { return TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, TranslateModule.forRoot(), - SearchHierarchyFilterComponent - ], - providers: [ + SearchHierarchyFilterComponent, + ], + providers: [ { provide: SearchService, useValue: searchService }, { provide: SearchFilterService, useValue: searchFilterService }, { provide: RemoteDataBuildService, useValue: {} }, @@ -83,9 +96,9 @@ describe('SearchHierarchyFilterComponent', () => { { provide: FILTER_CONFIG, useValue: Object.assign(new SearchFilterConfig(), { name: testSearchFilter }) }, { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) }, { provide: SCOPE, useValue: undefined }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); }); function init() { diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts index 21ca7dd804..69151dc960 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts @@ -1,10 +1,20 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { buildPaginatedList } from '../../../../../core/data/paginated-list.model'; @@ -18,6 +28,7 @@ import { SCOPE, SearchFilterService, } from '../../../../../core/shared/search/search-filter.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { createSuccessfulRemoteDataObject$ } from '../../../../remote-data.utils'; import { RouterStub } from '../../../../testing/router.stub'; import { SearchConfigurationServiceStub } from '../../../../testing/search-configuration-service.stub'; @@ -26,7 +37,6 @@ import { FacetValue } from '../../../models/facet-value.model'; import { FilterType } from '../../../models/filter-type.model'; import { SearchFilterConfig } from '../../../models/search-filter-config.model'; import { SearchRangeFilterComponent } from './search-range-filter.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; describe('SearchRangeFilterComponent', () => { let comp: SearchRangeFilterComponent; @@ -96,8 +106,8 @@ describe('SearchRangeFilterComponent', () => { const mockValues = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), values)); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchRangeFilterComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchRangeFilterComponent], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: Router, useValue: new RouterStub() }, { provide: FILTER_CONFIG, useValue: mockFilterConfig }, @@ -108,21 +118,21 @@ describe('SearchRangeFilterComponent', () => { { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) }, { provide: SCOPE, useValue: undefined }, { - provide: SearchFilterService, useValue: { - getSelectedValuesForFilter: () => selectedValues, - isFilterActiveWithValue: (paramName: string, filterValue: string) => true, - getPage: (paramName: string) => page, - /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ - incrementPage: (filterName: string) => { - }, - resetPage: (filterName: string) => { + provide: SearchFilterService, useValue: { + getSelectedValuesForFilter: () => selectedValues, + isFilterActiveWithValue: (paramName: string, filterValue: string) => true, + getPage: (paramName: string) => page, + /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ + incrementPage: (filterName: string) => { }, - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ + resetPage: (filterName: string) => { + }, + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ }, }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchRangeFilterComponent, { + }).overrideComponent(SearchRangeFilterComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts index a4affb8839..71ec55c6b1 100644 --- a/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts @@ -1,13 +1,35 @@ -import { AsyncPipe, isPlatformBrowser, NgFor, NgIf } from '@angular/common'; -import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID, } from '@angular/core'; +import { + AsyncPipe, + isPlatformBrowser, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription, } from 'rxjs'; -import { map, startWith, } from 'rxjs/operators'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { NouisliderComponent } from 'ng2-nouislider'; +import { + BehaviorSubject, + combineLatest as observableCombineLatest, + Subscription, +} from 'rxjs'; +import { + map, + startWith, +} from 'rxjs/operators'; import { yearFromString } from 'src/app/shared/date.util'; + import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; -import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; -import { SearchFilterConfig } from '../../../models/search-filter-config.model'; import { RouteService } from '../../../../../core/services/route.service'; import { SearchService } from '../../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../../core/shared/search/search-configuration.service'; @@ -18,16 +40,20 @@ import { SCOPE, SearchFilterService, } from '../../../../../core/shared/search/search-filter.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-page.component'; import { hasValue } from '../../../../empty.util'; -import { - SearchFacetRangeOptionComponent -} from '../search-facet-filter-options/search-facet-range-option/search-facet-range-option.component'; import { DebounceDirective } from '../../../../utils/debounce.directive'; -import { NouisliderComponent } from 'ng2-nouislider'; -import { FormsModule } from '@angular/forms'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../my-dspace-page/my-dspace-configuration.service'; -import { RANGE_FILTER_MAX_SUFFIX, RANGE_FILTER_MIN_SUFFIX } from './search-range-filter-constants'; +import { SearchFilterConfig } from '../../../models/search-filter-config.model'; +import { + facetLoad, + SearchFacetFilterComponent, +} from '../search-facet-filter/search-facet-filter.component'; +import { SearchFacetRangeOptionComponent } from '../search-facet-filter-options/search-facet-range-option/search-facet-range-option.component'; +import { + RANGE_FILTER_MAX_SUFFIX, + RANGE_FILTER_MIN_SUFFIX, +} from './search-range-filter-constants'; /** * This component renders a simple item page. @@ -35,12 +61,12 @@ import { RANGE_FILTER_MAX_SUFFIX, RANGE_FILTER_MIN_SUFFIX } from './search-range * All fields of the item that should be displayed, are defined in its template. */ @Component({ - selector: 'ds-search-range-filter', - styleUrls: ['./search-range-filter.component.scss'], - templateUrl: './search-range-filter.component.html', - animations: [facetLoad], - standalone: true, - imports: [FormsModule, NgIf, NouisliderComponent, DebounceDirective, NgFor, SearchFacetRangeOptionComponent, AsyncPipe, TranslateModule] + selector: 'ds-search-range-filter', + styleUrls: ['./search-range-filter.component.scss'], + templateUrl: './search-range-filter.component.html', + animations: [facetLoad], + standalone: true, + imports: [FormsModule, NgIf, NouisliderComponent, DebounceDirective, NgFor, SearchFacetRangeOptionComponent, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts index 5e7ec89d85..3db6bfc027 100644 --- a/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts @@ -1,18 +1,23 @@ -import { Component, OnInit } from '@angular/core'; -import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; -import { addOperatorToFilterValue, } from '../../../search.utils'; -import { TranslateModule } from '@ngx-translate/core'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; + +import { FilterInputSuggestionsComponent } from '../../../../input-suggestions/filter-suggestions/filter-input-suggestions.component'; +import { addOperatorToFilterValue } from '../../../search.utils'; import { - FilterInputSuggestionsComponent -} from '../../../../input-suggestions/filter-suggestions/filter-input-suggestions.component'; -import { - SearchFacetOptionComponent -} from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; -import { - SearchFacetSelectedOptionComponent -} from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; + facetLoad, + SearchFacetFilterComponent, +} from '../search-facet-filter/search-facet-filter.component'; +import { SearchFacetOptionComponent } from '../search-facet-filter-options/search-facet-option/search-facet-option.component'; +import { SearchFacetSelectedOptionComponent } from '../search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; /** * This component renders a simple item page. @@ -21,12 +26,12 @@ import { AsyncPipe, NgFor, NgIf } from '@angular/common'; */ @Component({ - selector: 'ds-search-text-filter', - styleUrls: ['./search-text-filter.component.scss'], - templateUrl: './search-text-filter.component.html', - animations: [facetLoad], - standalone: true, - imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule] + selector: 'ds-search-text-filter', + styleUrls: ['./search-text-filter.component.scss'], + templateUrl: './search-text-filter.component.html', + animations: [facetLoad], + standalone: true, + imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search-filters/search-filters.component.spec.ts b/src/app/shared/search/search-filters/search-filters.component.spec.ts index 683cba1119..88f8722c14 100644 --- a/src/app/shared/search/search-filters/search-filters.component.spec.ts +++ b/src/app/shared/search/search-filters/search-filters.component.spec.ts @@ -1,5 +1,12 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; @@ -8,9 +15,9 @@ import { environment } from 'src/environments/environment'; import { SearchService } from '../../../core/shared/search/search.service'; import { SearchFilterService } from '../../../core/shared/search/search-filter.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { SearchFiltersComponent } from './search-filters.component'; describe('SearchFiltersComponent', () => { @@ -35,16 +42,16 @@ describe('SearchFiltersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, SearchFiltersComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, SearchFiltersComponent], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: SearchFilterService, useValue: searchFiltersStub }, { provide: APP_CONFIG, useValue: environment }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(SearchFiltersComponent, { + }).overrideComponent(SearchFiltersComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/search/search-filters/search-filters.component.ts b/src/app/shared/search/search-filters/search-filters.component.ts index 42a14744dd..f94e4282bf 100644 --- a/src/app/shared/search/search-filters/search-filters.component.ts +++ b/src/app/shared/search/search-filters/search-filters.component.ts @@ -1,29 +1,48 @@ -import { Component, Inject, Input, OnDestroy, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { BehaviorSubject, Observable, } from 'rxjs'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; import { map } from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from 'src/config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from 'src/config/app-config.interface'; import { RemoteData } from '../../../core/data/remote-data'; import { SearchService } from '../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SearchFilterService } from '../../../core/shared/search/search-filter.service'; -import { currentPath } from '../../utils/route.utils'; -import { hasValue } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchFilterComponent } from './search-filter/search-filter.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; -import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; +import { hasValue } from '../../empty.util'; +import { currentPath } from '../../utils/route.utils'; import { AdvancedSearchComponent } from '../advanced-search/advanced-search.component'; +import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; import { SearchFilterConfig } from '../models/search-filter-config.model'; +import { SearchFilterComponent } from './search-filter/search-filter.component'; @Component({ selector: 'ds-search-filters', styleUrls: ['./search-filters.component.scss'], templateUrl: './search-filters.component.html', standalone: true, - imports: [NgIf, NgFor, SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, AdvancedSearchComponent] + imports: [NgIf, NgFor, SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, AdvancedSearchComponent], }) /** diff --git a/src/app/shared/search/search-filters/themed-search-filters.component.ts b/src/app/shared/search/search-filters/themed-search-filters.component.ts index db4caf846a..22cc098662 100644 --- a/src/app/shared/search/search-filters/themed-search-filters.component.ts +++ b/src/app/shared/search/search-filters/themed-search-filters.component.ts @@ -13,10 +13,10 @@ import { SearchFiltersComponent } from './search-filters.component'; * Themed wrapper for SearchFiltersComponent */ @Component({ - selector: 'ds-themed-search-filters', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-filters', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchFiltersComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts index 2bceb0a51c..4284ddbcf5 100644 --- a/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.spec.ts @@ -1,23 +1,38 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Params, Router, RouterLink, } from '@angular/router'; +import { + ActivatedRoute, + Params, + Router, + RouterLink, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { Observable, of as observableOf } from 'rxjs'; -import { SearchLabelComponent } from './search-label.component'; -import { ObjectKeysPipe } from '../../../utils/object-keys-pipe'; -import { SearchServiceStub } from '../../../testing/search-service.stub'; -import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; -import { SearchService } from '../../../../core/shared/search/search.service'; -import { PaginationComponentOptions } from '../../../pagination/pagination-component-options.model'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { PaginationService } from '../../../../core/pagination/pagination.service'; +import { SearchService } from '../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; -import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; -import { PaginationServiceStub } from '../../../testing/pagination-service.stub'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { PaginationComponentOptions } from '../../../pagination/pagination-component-options.model'; +import { PaginationServiceStub } from '../../../testing/pagination-service.stub'; +import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub'; +import { SearchServiceStub } from '../../../testing/search-service.stub'; +import { ObjectKeysPipe } from '../../../utils/object-keys-pipe'; +import { SearchLabelComponent } from './search-label.component'; describe('SearchLabelComponent', () => { let comp: SearchLabelComponent; @@ -57,7 +72,7 @@ describe('SearchLabelComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(SearchLabelComponent, { remove: { - imports: [RouterLink] + imports: [RouterLink], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/shared/search/search-labels/search-label/search-label.component.ts b/src/app/shared/search/search-labels/search-label/search-label.component.ts index 2b356b298a..b24ff13826 100644 --- a/src/app/shared/search/search-labels/search-label/search-label.component.ts +++ b/src/app/shared/search/search-labels/search-label/search-label.component.ts @@ -1,22 +1,33 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { Params, Router, RouterLink, } from '@angular/router'; +import { AsyncPipe } from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + Params, + Router, + RouterLink, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { SearchService } from '../../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; -import { hasValue, isNotEmpty, } from '../../../empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../../empty.util'; import { currentPath } from '../../../utils/route.utils'; import { stripOperatorFromFilterValue } from '../../search.utils'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-label', - templateUrl: './search-label.component.html', - standalone: true, - imports: [RouterLink, AsyncPipe, TranslateModule] + selector: 'ds-search-label', + templateUrl: './search-label.component.html', + standalone: true, + imports: [RouterLink, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search-labels/search-labels.component.spec.ts b/src/app/shared/search/search-labels/search-labels.component.spec.ts index 92f8e4fd13..17c82ed26e 100644 --- a/src/app/shared/search/search-labels/search-labels.component.spec.ts +++ b/src/app/shared/search/search-labels/search-labels.component.spec.ts @@ -1,5 +1,12 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -7,11 +14,11 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { SearchService } from '../../../core/shared/search/search.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { SearchServiceStub } from '../../testing/search-service.stub'; import { ObjectKeysPipe } from '../../utils/object-keys-pipe'; import { SearchLabelComponent } from './search-label/search-label.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { SearchLabelsComponent } from './search-labels.component'; describe('SearchLabelsComponent', () => { @@ -42,7 +49,7 @@ describe('SearchLabelsComponent', () => { schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(SearchLabelsComponent, { remove: { - imports: [SearchLabelComponent] + imports: [SearchLabelComponent], }, add: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); diff --git a/src/app/shared/search/search-labels/search-labels.component.ts b/src/app/shared/search/search-labels/search-labels.component.ts index 89bda9c0c5..afabc0f51a 100644 --- a/src/app/shared/search/search-labels/search-labels.component.ts +++ b/src/app/shared/search/search-labels/search-labels.component.ts @@ -1,20 +1,30 @@ -import { Component, Inject, Input } from '@angular/core'; -import { Params, Router, } from '@angular/router'; +import { + AsyncPipe, + NgFor, +} from '@angular/common'; +import { + Component, + Inject, + Input, +} from '@angular/core'; +import { + Params, + Router, +} from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ObjectKeysPipe } from '../../utils/object-keys-pipe'; -import { SearchLabelComponent } from './search-label/search-label.component'; -import { AsyncPipe, NgFor } from '@angular/common'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; +import { ObjectKeysPipe } from '../../utils/object-keys-pipe'; +import { SearchLabelComponent } from './search-label/search-label.component'; @Component({ - selector: 'ds-search-labels', - styleUrls: ['./search-labels.component.scss'], - templateUrl: './search-labels.component.html', - standalone: true, - imports: [NgFor, SearchLabelComponent, AsyncPipe, ObjectKeysPipe] + selector: 'ds-search-labels', + styleUrls: ['./search-labels.component.scss'], + templateUrl: './search-labels.component.html', + standalone: true, + imports: [NgFor, SearchLabelComponent, AsyncPipe, ObjectKeysPipe], }) /** diff --git a/src/app/shared/search/search-results/search-results.component.spec.ts b/src/app/shared/search/search-results/search-results.component.spec.ts index 731c5c081a..fedea57e07 100644 --- a/src/app/shared/search/search-results/search-results.component.spec.ts +++ b/src/app/shared/search/search-results/search-results.component.spec.ts @@ -9,19 +9,19 @@ import { } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { Community } from '../../../core/shared/community.model'; -import { createFailedRemoteDataObject } from '../../remote-data.utils'; -import { ActivatedRoute } from '@angular/router'; -import { ActivatedRouteStub } from '../../testing/active-router.stub'; -import { ThemeService } from '../../theme-support/theme.service'; -import { getMockThemeService } from '../../mocks/theme-service.mock'; -import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; -import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; -import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; import { ErrorComponent } from '../../error/error.component'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { getMockThemeService } from '../../mocks/theme-service.mock'; +import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; +import { createFailedRemoteDataObject } from '../../remote-data.utils'; +import { ActivatedRouteStub } from '../../testing/active-router.stub'; import { QueryParamsDirectiveStub } from '../../testing/query-params-directive.stub'; +import { ThemeService } from '../../theme-support/theme.service'; +import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; import { SearchResultsComponent } from './search-results.component'; describe('SearchResultsComponent', () => { @@ -52,7 +52,7 @@ describe('SearchResultsComponent', () => { ErrorComponent, ], }, - add: { imports: [QueryParamsDirectiveStub] } + add: { imports: [QueryParamsDirectiveStub] }, }) .compileComponents(); })); diff --git a/src/app/shared/search/search-results/search-results.component.ts b/src/app/shared/search/search-results/search-results.component.ts index 855467e47e..16c9575b86 100644 --- a/src/app/shared/search/search-results/search-results.component.ts +++ b/src/app/shared/search/search-results/search-results.component.ts @@ -1,4 +1,12 @@ -import { Component, EventEmitter, Input, Output, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + Output, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../../core/data/paginated-list.model'; @@ -6,19 +14,22 @@ import { RemoteData } from '../../../core/data/remote-data'; import { Context } from '../../../core/shared/context.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; -import { fadeIn, fadeInOut, } from '../../animations/fade'; -import { hasNoValue, isNotEmpty, } from '../../empty.util'; -import { CollectionElementLinkType } from '../../object-collection/collection-element-link.type'; -import { ListableObject } from '../../object-collection/shared/listable-object.model'; -import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; +import { + fadeIn, + fadeInOut, +} from '../../animations/fade'; +import { + hasNoValue, + isNotEmpty, +} from '../../empty.util'; import { ErrorComponent } from '../../error/error.component'; import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { CollectionElementLinkType } from '../../object-collection/collection-element-link.type'; import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; -import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; -import { NgIf } from '@angular/common'; +import { ListableObject } from '../../object-collection/shared/listable-object.model'; +import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; import { SearchResult } from '../models/search-result.model'; +import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; export interface SelectionConfig { repeatable: boolean; @@ -26,14 +37,14 @@ export interface SelectionConfig { } @Component({ - selector: 'ds-search-results', - templateUrl: './search-results.component.html', - animations: [ - fadeIn, - fadeInOut - ], - standalone: true, - imports: [NgIf, SearchExportCsvComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, RouterLink, TranslateModule] + selector: 'ds-search-results', + templateUrl: './search-results.component.html', + animations: [ + fadeIn, + fadeInOut, + ], + standalone: true, + imports: [NgIf, SearchExportCsvComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, RouterLink, TranslateModule], }) /** diff --git a/src/app/shared/search/search-results/themed-search-results.component.ts b/src/app/shared/search/search-results/themed-search-results.component.ts index 1c29aa792c..c473a4ec72 100644 --- a/src/app/shared/search/search-results/themed-search-results.component.ts +++ b/src/app/shared/search/search-results/themed-search-results.component.ts @@ -25,10 +25,10 @@ import { * Themed wrapper for SearchResultsComponent */ @Component({ - selector: 'ds-themed-search-results', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-results', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchResultsComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-settings/search-settings.component.spec.ts b/src/app/shared/search/search-settings/search-settings.component.spec.ts index 432ba364b8..657bfa7310 100644 --- a/src/app/shared/search/search-settings/search-settings.component.spec.ts +++ b/src/app/shared/search/search-settings/search-settings.component.spec.ts @@ -1,19 +1,26 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { VarDirective } from '../../utils/var.directive'; -import { SidebarService } from '../../sidebar/sidebar.service'; -import { SidebarServiceStub } from '../../testing/sidebar-service.stub'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { PaginationComponentOptions } from '../../pagination/pagination-component-options.model'; +import { SidebarService } from '../../sidebar/sidebar.service'; import { PaginationServiceStub } from '../../testing/pagination-service.stub'; +import { SidebarServiceStub } from '../../testing/sidebar-service.stub'; import { EnumKeysPipe } from '../../utils/enum-keys-pipe'; +import { VarDirective } from '../../utils/var.directive'; import { SearchSettingsComponent } from './search-settings.component'; describe('SearchSettingsComponent', () => { @@ -50,32 +57,32 @@ describe('SearchSettingsComponent', () => { paginationService = new PaginationServiceStub(pagination, sort); await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), SearchSettingsComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), SearchSettingsComponent, EnumKeysPipe, VarDirective], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { provide: ActivatedRoute, useValue: activatedRouteStub }, { - provide: SidebarService, - useValue: SidebarServiceStub, + provide: SidebarService, + useValue: SidebarServiceStub, }, { - provide: SearchFilterService, - useValue: {}, + provide: SearchFilterService, + useValue: {}, }, { - provide: PaginationService, - useValue: paginationService, + provide: PaginationService, + useValue: paginationService, }, { - provide: SEARCH_CONFIG_SERVICE, - useValue: { - paginatedSearchOptions: observableOf(paginatedSearchOptions), - getCurrentScope: observableOf('test-id'), + provide: SEARCH_CONFIG_SERVICE, + useValue: { + paginatedSearchOptions: observableOf(paginatedSearchOptions), + getCurrentScope: observableOf('test-id'), }, }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/search/search-settings/search-settings.component.ts b/src/app/shared/search/search-settings/search-settings.component.ts index 84f11a5fb1..6f8ace0df1 100644 --- a/src/app/shared/search/search-settings/search-settings.component.ts +++ b/src/app/shared/search/search-settings/search-settings.component.ts @@ -1,21 +1,31 @@ -import { Component, Inject, Input, } from '@angular/core'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + Input, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; -import { SortDirection, SortOptions, } from '../../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../../core/cache/models/sort-options.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { PageSizeSelectorComponent } from '../../page-size-selector/page-size-selector.component'; -import { FormsModule } from '@angular/forms'; -import { SidebarDropdownComponent } from '../../sidebar/sidebar-dropdown.component'; -import { NgFor, NgIf } from '@angular/common'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; +import { PageSizeSelectorComponent } from '../../page-size-selector/page-size-selector.component'; +import { SidebarDropdownComponent } from '../../sidebar/sidebar-dropdown.component'; @Component({ - selector: 'ds-search-settings', - styleUrls: ['./search-settings.component.scss'], - templateUrl: './search-settings.component.html', - standalone: true, - imports: [NgIf, SidebarDropdownComponent, NgFor, FormsModule, PageSizeSelectorComponent, TranslateModule] + selector: 'ds-search-settings', + styleUrls: ['./search-settings.component.scss'], + templateUrl: './search-settings.component.html', + standalone: true, + imports: [NgIf, SidebarDropdownComponent, NgFor, FormsModule, PageSizeSelectorComponent, TranslateModule], }) /** diff --git a/src/app/shared/search/search-settings/themed-search-settings.component.ts b/src/app/shared/search/search-settings/themed-search-settings.component.ts index 0870aa5e7a..af3a15ca51 100644 --- a/src/app/shared/search/search-settings/themed-search-settings.component.ts +++ b/src/app/shared/search/search-settings/themed-search-settings.component.ts @@ -11,10 +11,10 @@ import { SearchSettingsComponent } from './search-settings.component'; * Themed wrapper for SearchSettingsComponent */ @Component({ - selector: 'ds-themed-search-settings', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-settings', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchSettingsComponent extends ThemedComponent { @Input() currentSortOption: SortOptions; diff --git a/src/app/shared/search/search-sidebar/search-sidebar.component.spec.ts b/src/app/shared/search/search-sidebar/search-sidebar.component.spec.ts index 195380a559..00341fff7c 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.spec.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.spec.ts @@ -1,12 +1,19 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { SearchSidebarComponent } from './search-sidebar.component'; -import { ThemedSearchSettingsComponent } from '../search-settings/themed-search-settings.component'; import { ThemedSearchFiltersComponent } from '../search-filters/themed-search-filters.component'; +import { ThemedSearchSettingsComponent } from '../search-settings/themed-search-settings.component'; +import { SearchSidebarComponent } from './search-sidebar.component'; describe('SearchSidebarComponent', () => { let comp: SearchSidebarComponent; @@ -21,15 +28,15 @@ describe('SearchSidebarComponent', () => { ], schemas: [NO_ERRORS_SCHEMA], }) - .overrideComponent(SearchSidebarComponent, { - remove:{ - imports: [ThemedSearchFiltersComponent, ThemedSearchSettingsComponent], - }, - add: { - changeDetection: ChangeDetectionStrategy.Default, - } - }) - .compileComponents(); // compile template and css + .overrideComponent(SearchSidebarComponent, { + remove:{ + imports: [ThemedSearchFiltersComponent, ThemedSearchSettingsComponent], + }, + add: { + changeDetection: ChangeDetectionStrategy.Default, + }, + }) + .compileComponents(); // compile template and css })); // synchronous beforeEach diff --git a/src/app/shared/search/search-sidebar/search-sidebar.component.ts b/src/app/shared/search/search-sidebar/search-sidebar.component.ts index 09662c6c93..1aabe12737 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -1,20 +1,26 @@ -import { Component, EventEmitter, Input, Output, } from '@angular/core'; -import { BehaviorSubject, Observable, } from 'rxjs'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + Output, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { RemoteData } from '../../../core/data/remote-data'; import { ViewMode } from '../../../core/shared/view-mode.model'; +import { ViewModeSwitchComponent } from '../../view-mode-switch/view-mode-switch.component'; import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; import { SearchFilterConfig } from '../models/search-filter-config.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedSearchSettingsComponent } from '../search-settings/themed-search-settings.component'; import { ThemedSearchFiltersComponent } from '../search-filters/themed-search-filters.component'; -import { - SearchSwitchConfigurationComponent -} from '../search-switch-configuration/search-switch-configuration.component'; -import { ViewModeSwitchComponent } from '../../view-mode-switch/view-mode-switch.component'; -import { NgIf } from '@angular/common'; +import { ThemedSearchSettingsComponent } from '../search-settings/themed-search-settings.component'; import { SearchConfigurationOption } from '../search-switch-configuration/search-configuration-option.model'; +import { SearchSwitchConfigurationComponent } from '../search-switch-configuration/search-switch-configuration.component'; /** * This component renders a simple item page. @@ -23,11 +29,11 @@ import { SearchConfigurationOption } from '../search-switch-configuration/search */ @Component({ - selector: 'ds-search-sidebar', - styleUrls: ['./search-sidebar.component.scss'], - templateUrl: './search-sidebar.component.html', - standalone: true, - imports: [NgIf, ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule] + selector: 'ds-search-sidebar', + styleUrls: ['./search-sidebar.component.scss'], + templateUrl: './search-sidebar.component.html', + standalone: true, + imports: [NgIf, ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule], }) /** diff --git a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts index 2df1c7f6de..d44698cfc2 100644 --- a/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/themed-search-sidebar.component.ts @@ -22,10 +22,10 @@ import { SearchSidebarComponent } from './search-sidebar.component'; * Themed wrapper for SearchSidebarComponent */ @Component({ - selector: 'ds-themed-search-sidebar', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search-sidebar', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchSidebarComponent extends ThemedComponent { diff --git a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts index 7c099b6d85..7bd982fb76 100644 --- a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts +++ b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts @@ -1,19 +1,32 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NavigationExtras, Router, } from '@angular/router'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + NavigationExtras, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { Context } from '../../../core/shared/context.model'; import { SearchService } from '../../../core/shared/search/search.service'; -import { MYDSPACE_ROUTE, SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { MyDSpaceConfigurationValueType } from '../../../my-dspace-page/my-dspace-configuration-value-type'; +import { + MYDSPACE_ROUTE, + SEARCH_CONFIG_SERVICE, +} from '../../../my-dspace-page/my-dspace-page.component'; import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; import { RouterStub } from '../../testing/router.stub'; import { SearchConfigurationServiceStub } from '../../testing/search-configuration-service.stub'; import { SearchSwitchConfigurationComponent } from './search-switch-configuration.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; describe('SearchSwitchConfigurationComponent', () => { @@ -40,22 +53,22 @@ describe('SearchSwitchConfigurationComponent', () => { ]; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), - SearchSwitchConfigurationComponent - ], - providers: [ + SearchSwitchConfigurationComponent, + ], + providers: [ { provide: Router, useValue: new RouterStub() }, { provide: SearchService, useValue: searchServiceStub }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts index 9827aed3f3..e301a3729e 100644 --- a/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts +++ b/src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts @@ -1,25 +1,39 @@ -import { Component, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, } from '@angular/core'; -import { NavigationExtras, Router, } from '@angular/router'; +import { + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Inject, + Input, + OnDestroy, + OnInit, + Output, +} from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { + NavigationExtras, + Router, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import findIndex from 'lodash/findIndex'; import { Subscription } from 'rxjs'; -import { hasValue } from '../../empty.util'; import { SearchService } from '../../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; import { MyDSpaceConfigurationValueType } from '../../../my-dspace-page/my-dspace-configuration-value-type'; +import { hasValue } from '../../empty.util'; import { currentPath } from '../../utils/route.utils'; import { SearchConfigurationOption } from './search-configuration-option.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule } from '@angular/forms'; -import { NgFor, NgIf } from '@angular/common'; -import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service'; @Component({ - selector: 'ds-search-switch-configuration', - styleUrls: ['./search-switch-configuration.component.scss'], - templateUrl: './search-switch-configuration.component.html', - standalone: true, - imports: [NgIf, FormsModule, NgFor, TranslateModule] + selector: 'ds-search-switch-configuration', + styleUrls: ['./search-switch-configuration.component.scss'], + templateUrl: './search-switch-configuration.component.html', + standalone: true, + imports: [NgIf, FormsModule, NgFor, TranslateModule], }) /** * Represents a select that allow to switch over available search configurations diff --git a/src/app/shared/search/search.component.spec.ts b/src/app/shared/search/search.component.spec.ts index 7d5c8c0d8a..2339b8a912 100644 --- a/src/app/shared/search/search.component.spec.ts +++ b/src/app/shared/search/search.component.spec.ts @@ -1,5 +1,14 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; @@ -8,13 +17,23 @@ import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; -import { BehaviorSubject, Observable, of as observableOf, } from 'rxjs'; +import { + BehaviorSubject, + Observable, + of as observableOf, +} from 'rxjs'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, +} from '../../../config/app-config.interface'; import { environment } from '../../../environments/environment.test'; import { getCollectionPageRoute } from '../../collection-page/collection-page-routing-paths'; import { getCommunityPageRoute } from '../../community-page/community-page-routing-paths'; -import { SortDirection, SortOptions, } from '../../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../../core/cache/models/sort-options.model'; import { CommunityDataService } from '../../core/data/community-data.service'; import { RemoteData } from '../../core/data/remote-data'; import { RouteService } from '../../core/services/route.service'; @@ -22,26 +41,32 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; import { SearchService } from '../../core/shared/search/search.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; -import { PaginatedSearchOptions } from './models/paginated-search-options.model'; import { SearchFilterService } from '../../core/shared/search/search-filter.service'; -import { SearchConfig, SortConfig, } from '../../core/shared/search/search-filters/search-config.model'; +import { + SearchConfig, + SortConfig, +} from '../../core/shared/search/search-filters/search-config.model'; +import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { HostWindowService } from '../host-window.service'; import { PaginationComponentOptions } from '../pagination/pagination-component-options.model'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, +} from '../remote-data.utils'; +import { ThemedSearchFormComponent } from '../search-form/themed-search-form.component'; +import { PageWithSidebarComponent } from '../sidebar/page-with-sidebar.component'; import { SidebarService } from '../sidebar/sidebar.service'; import { SidebarServiceStub } from '../testing/sidebar-service.stub'; -import { FilterType } from './models/filter-type.model'; -import { PageWithSidebarComponent } from '../sidebar/page-with-sidebar.component'; import { ViewModeSwitchComponent } from '../view-mode-switch/view-mode-switch.component'; -import { ThemedSearchResultsComponent } from './search-results/themed-search-results.component'; -import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchFormComponent } from '../search-form/themed-search-form.component'; -import { SearchLabelsComponent } from './search-labels/search-labels.component'; -import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-configuration.service'; +import { FilterType } from './models/filter-type.model'; +import { PaginatedSearchOptions } from './models/paginated-search-options.model'; import { SearchFilterConfig } from './models/search-filter-config.model'; import { SearchObjects } from './models/search-objects.model'; import { SearchComponent } from './search.component'; +import { SearchLabelsComponent } from './search-labels/search-labels.component'; +import { ThemedSearchResultsComponent } from './search-results/themed-search-results.component'; +import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component'; let comp: SearchComponent; let fixture: ComponentFixture; @@ -188,40 +213,40 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar TestBed.configureTestingModule({ imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule, compType, ...additionalDeclarations], providers: [ - { provide: SearchService, useValue: searchServiceStub }, - { - provide: CommunityDataService, + { provide: SearchService, useValue: searchServiceStub }, + { + provide: CommunityDataService, useValue: jasmine.createSpyObj('communityService', ['findById', 'findAll']), - }, - { provide: ActivatedRoute, useValue: activatedRouteStub }, - { provide: RouteService, useValue: routeServiceStub }, - { + }, + { provide: ActivatedRoute, useValue: activatedRouteStub }, + { provide: RouteService, useValue: routeServiceStub }, + { provide: Store, useValue: store, - }, - { - provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { - isXs: observableOf(true), - isSm: observableOf(false), - isXsOrSm: observableOf(true), - }), - }, - { - provide: SidebarService, - useClass: SidebarServiceStub, - }, - { - provide: SearchFilterService, + }, + { + provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { + isXs: observableOf(true), + isSm: observableOf(false), + isXsOrSm: observableOf(true), + }), + }, + { + provide: SidebarService, + useClass: SidebarServiceStub, + }, + { + provide: SearchFilterService, useValue: {}, - }, - { - provide: SEARCH_CONFIG_SERVICE, + }, + { + provide: SEARCH_CONFIG_SERVICE, useValue: searchConfigurationServiceStub, - }, - { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - { provide: APP_CONFIG, useValue: environment }, + }, + { provide: APP_DATA_SERVICES_MAP, useValue: {} }, + { provide: APP_CONFIG, useValue: environment }, ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(compType, { + }).overrideComponent(compType, { add: { changeDetection: ChangeDetectionStrategy.Default, providers: [{ @@ -237,8 +262,8 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, - ] - } + ], + }, }).compileComponents(); } diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index d745406748..9b647e4cb1 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -1,3 +1,8 @@ +import { + AsyncPipe, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -8,61 +13,82 @@ import { OnInit, Output, } from '@angular/core'; -import { NavigationStart, Router, } from '@angular/router'; +import { + NavigationStart, + Router, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import uniqueId from 'lodash/uniqueId'; -import { BehaviorSubject, combineLatest, Observable, Subscription, } from 'rxjs'; -import { debounceTime, distinctUntilChanged, filter, map, switchMap, } from 'rxjs/operators'; +import { + BehaviorSubject, + combineLatest, + Observable, + Subscription, +} from 'rxjs'; +import { + debounceTime, + distinctUntilChanged, + filter, + map, + switchMap, +} from 'rxjs/operators'; -import { APP_CONFIG, AppConfig, } from '../../../config/app-config.interface'; +import { + APP_CONFIG, + AppConfig, +} from '../../../config/app-config.interface'; import { COLLECTION_MODULE_PATH } from '../../collection-page/collection-page-routing-paths'; import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routing-paths'; import { SortOptions } from '../../core/cache/models/sort-options.model'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { RouteService } from '../../core/services/route.service'; -import { PaginatedSearchOptions } from './models/paginated-search-options.model'; -import { SearchResult } from './models/search-result.model'; -import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { SearchService } from '../../core/shared/search/search.service'; -import { currentPath } from '../utils/route.utils'; import { Context } from '../../core/shared/context.model'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { Item } from '../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; +import { SearchService } from '../../core/shared/search/search.service'; +import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; import { SearchConfig } from '../../core/shared/search/search-filters/search-config.model'; import { ViewMode } from '../../core/shared/view-mode.model'; import { SubmissionObject } from '../../core/submission/models/submission-object.model'; import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; import { ITEM_MODULE_PATH } from '../../item-page/item-page-routing-paths'; -import { TranslateModule } from '@ngx-translate/core'; -import { SearchLabelsComponent } from './search-labels/search-labels.component'; -import { ThemedSearchFormComponent } from '../search-form/themed-search-form.component'; -import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchResultsComponent } from './search-results/themed-search-results.component'; -import { ViewModeSwitchComponent } from '../view-mode-switch/view-mode-switch.component'; -import { PageWithSidebarComponent } from '../sidebar/page-with-sidebar.component'; -import { AsyncPipe, NgIf, NgTemplateOutlet } from '@angular/common'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; import { pushInOut } from '../animations/push'; -import { hasValue, hasValueOperator, isEmpty, isNotEmpty, } from '../empty.util'; +import { + hasValue, + hasValueOperator, + isEmpty, + isNotEmpty, +} from '../empty.util'; import { HostWindowService } from '../host-window.service'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; import { ListableObject } from '../object-collection/shared/listable-object.model'; +import { ThemedSearchFormComponent } from '../search-form/themed-search-form.component'; +import { PageWithSidebarComponent } from '../sidebar/page-with-sidebar.component'; import { SidebarService } from '../sidebar/sidebar.service'; import { followLink } from '../utils/follow-link-config.model'; +import { currentPath } from '../utils/route.utils'; +import { ViewModeSwitchComponent } from '../view-mode-switch/view-mode-switch.component'; +import { PaginatedSearchOptions } from './models/paginated-search-options.model'; import { SearchFilterConfig } from './models/search-filter-config.model'; import { SearchObjects } from './models/search-objects.model'; +import { SearchResult } from './models/search-result.model'; +import { SearchLabelsComponent } from './search-labels/search-labels.component'; import { SelectionConfig } from './search-results/search-results.component'; +import { ThemedSearchResultsComponent } from './search-results/themed-search-results.component'; +import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component'; import { SearchConfigurationOption } from './search-switch-configuration/search-configuration-option.model'; @Component({ - selector: 'ds-search', - styleUrls: ['./search.component.scss'], - templateUrl: './search.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [pushInOut], - standalone: true, - imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule] + selector: 'ds-search', + styleUrls: ['./search.component.scss'], + templateUrl: './search.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, + animations: [pushInOut], + standalone: true, + imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule], }) /** diff --git a/src/app/shared/search/search.module.ts b/src/app/shared/search/search.module.ts index 78cb70d581..edc5007750 100644 --- a/src/app/shared/search/search.module.ts +++ b/src/app/shared/search/search.module.ts @@ -1,6 +1,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MissingTranslationHandler, TranslateModule, } from '@ngx-translate/core'; +import { + MissingTranslationHandler, + TranslateModule, +} from '@ngx-translate/core'; import { NouisliderModule } from 'ng2-nouislider'; import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component'; @@ -11,51 +14,29 @@ import { FacetConfigResponse } from './models/facet-config-response.model'; import { FacetValues } from './models/facet-values.model'; import { SearchObjects } from './models/search-objects.model'; import { SearchResult } from './models/search-result.model'; -import { SearchResultsComponent } from './search-results/search-results.component'; import { SearchComponent } from './search.component'; -import { - SearchAuthorityFilterComponent -} from './search-filters/search-filter/search-authority-filter/search-authority-filter.component'; -import { - SearchBooleanFilterComponent -} from './search-filters/search-filter/search-boolean-filter/search-boolean-filter.component'; -import { - SearchFacetFilterComponent -} from './search-filters/search-filter/search-facet-filter/search-facet-filter.component'; -import { - SearchFacetOptionComponent -} from './search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component'; -import { - SearchFacetRangeOptionComponent -} from './search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component'; -import { - SearchFacetSelectedOptionComponent -} from './search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; -import { - SearchFacetFilterWrapperComponent -} from './search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component'; +import { SearchAuthorityFilterComponent } from './search-filters/search-filter/search-authority-filter/search-authority-filter.component'; +import { SearchBooleanFilterComponent } from './search-filters/search-filter/search-boolean-filter/search-boolean-filter.component'; +import { SearchFacetFilterComponent } from './search-filters/search-filter/search-facet-filter/search-facet-filter.component'; +import { SearchFacetOptionComponent } from './search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component'; +import { SearchFacetRangeOptionComponent } from './search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component'; +import { SearchFacetSelectedOptionComponent } from './search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component'; +import { SearchFacetFilterWrapperComponent } from './search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component'; import { SearchFilterComponent } from './search-filters/search-filter/search-filter.component'; -import { - SearchHierarchyFilterComponent -} from './search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component'; -import { - SearchRangeFilterComponent -} from './search-filters/search-filter/search-range-filter/search-range-filter.component'; -import { - SearchTextFilterComponent -} from './search-filters/search-filter/search-text-filter/search-text-filter.component'; +import { SearchHierarchyFilterComponent } from './search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component'; +import { SearchRangeFilterComponent } from './search-filters/search-filter/search-range-filter/search-range-filter.component'; +import { SearchTextFilterComponent } from './search-filters/search-filter/search-text-filter/search-text-filter.component'; import { SearchFiltersComponent } from './search-filters/search-filters.component'; import { ThemedSearchFiltersComponent } from './search-filters/themed-search-filters.component'; import { SearchLabelComponent } from './search-labels/search-label/search-label.component'; import { SearchLabelsComponent } from './search-labels/search-labels.component'; +import { SearchResultsComponent } from './search-results/search-results.component'; import { ThemedSearchResultsComponent } from './search-results/themed-search-results.component'; import { SearchSettingsComponent } from './search-settings/search-settings.component'; import { ThemedSearchSettingsComponent } from './search-settings/themed-search-settings.component'; import { SearchSidebarComponent } from './search-sidebar/search-sidebar.component'; import { ThemedSearchSidebarComponent } from './search-sidebar/themed-search-sidebar.component'; -import { - SearchSwitchConfigurationComponent -} from './search-switch-configuration/search-switch-configuration.component'; +import { SearchSwitchConfigurationComponent } from './search-switch-configuration/search-switch-configuration.component'; import { ThemedSearchComponent } from './themed-search.component'; const COMPONENTS = [ @@ -111,16 +92,16 @@ export const MODELS = [ ]; @NgModule({ - imports: [ - CommonModule, - TranslateModule.forChild({ - missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper }, + imports: [ + CommonModule, + TranslateModule.forChild({ + missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper }, useDefaultLang: true, - }), - NouisliderModule, - ...COMPONENTS - ], - exports: [ + }), + NouisliderModule, + ...COMPONENTS, + ], + exports: [ ...COMPONENTS, ], }) diff --git a/src/app/shared/search/themed-search.component.ts b/src/app/shared/search/themed-search.component.ts index 27e8188f0d..c6bf3927b4 100644 --- a/src/app/shared/search/themed-search.component.ts +++ b/src/app/shared/search/themed-search.component.ts @@ -20,9 +20,9 @@ import { SearchConfigurationOption } from './search-switch-configuration/search- * Themed wrapper for {@link SearchComponent} */ @Component({ - selector: 'ds-themed-search', - templateUrl: '../theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-search', + templateUrl: '../theme-support/themed.component.html', + standalone: true, }) export class ThemedSearchComponent extends ThemedComponent { diff --git a/src/app/shared/sidebar/page-with-sidebar.component.spec.ts b/src/app/shared/sidebar/page-with-sidebar.component.spec.ts index 3a078cb7d6..d4cfdc951e 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.spec.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.spec.ts @@ -1,4 +1,8 @@ -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of as observableOf } from 'rxjs'; @@ -14,21 +18,21 @@ describe('PageWithSidebarComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, PageWithSidebarComponent], - providers: [ + imports: [NoopAnimationsModule, PageWithSidebarComponent], + providers: [ { - provide: SidebarService, + provide: SidebarService, useClass: SidebarServiceStub, }, { - provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { - isXs: observableOf(true), - isSm: observableOf(false), - isXsOrSm: observableOf(true), - }), + provide: HostWindowService, useValue: jasmine.createSpyObj('hostWindowService', { + isXs: observableOf(true), + isSm: observableOf(false), + isXsOrSm: observableOf(true), + }), }, - ] -}).compileComponents().then(() => { + ], + }).compileComponents().then(() => { fixture = TestBed.createComponent(PageWithSidebarComponent); comp = fixture.componentInstance; comp.id = 'mock-id'; diff --git a/src/app/shared/sidebar/page-with-sidebar.component.ts b/src/app/shared/sidebar/page-with-sidebar.component.ts index 350c743127..b53193d10e 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgTemplateOutlet, +} from '@angular/common'; import { Component, Input, @@ -6,19 +10,18 @@ import { } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { NgTemplateOutlet, AsyncPipe } from '@angular/common'; import { pushInOut } from '../animations/push'; import { HostWindowService } from '../host-window.service'; import { SidebarService } from './sidebar.service'; @Component({ - selector: 'ds-page-with-sidebar', - styleUrls: ['./page-with-sidebar.component.scss'], - templateUrl: './page-with-sidebar.component.html', - animations: [pushInOut], - standalone: true, - imports: [NgTemplateOutlet, AsyncPipe] + selector: 'ds-page-with-sidebar', + styleUrls: ['./page-with-sidebar.component.scss'], + templateUrl: './page-with-sidebar.component.html', + animations: [pushInOut], + standalone: true, + imports: [NgTemplateOutlet, AsyncPipe], }) /** * This component takes care of displaying the sidebar properly on all viewports. It does not diff --git a/src/app/shared/sidebar/sidebar-dropdown.component.ts b/src/app/shared/sidebar/sidebar-dropdown.component.ts index d372e7b086..f94f153255 100644 --- a/src/app/shared/sidebar/sidebar-dropdown.component.ts +++ b/src/app/shared/sidebar/sidebar-dropdown.component.ts @@ -7,11 +7,11 @@ import { import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-sidebar-dropdown', - styleUrls: ['./sidebar-dropdown.component.scss'], - templateUrl: './sidebar-dropdown.component.html', - standalone: true, - imports: [TranslateModule] + selector: 'ds-sidebar-dropdown', + styleUrls: ['./sidebar-dropdown.component.scss'], + templateUrl: './sidebar-dropdown.component.html', + standalone: true, + imports: [TranslateModule], }) /** * This components renders a sidebar dropdown including the label. diff --git a/src/app/shared/starts-with/date/starts-with-date.component.spec.ts b/src/app/shared/starts-with/date/starts-with-date.component.spec.ts index 9ad769eabc..6a48f0db22 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.spec.ts +++ b/src/app/shared/starts-with/date/starts-with-date.component.spec.ts @@ -37,14 +37,14 @@ describe('StartsWithDateComponent', () => { paginationService = new PaginationServiceStub(); await TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithDateComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithDateComponent, EnumKeysPipe], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: router }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/starts-with/date/starts-with-date.component.ts b/src/app/shared/starts-with/date/starts-with-date.component.ts index cd1a6cbc1b..726f708fe8 100644 --- a/src/app/shared/starts-with/date/starts-with-date.component.ts +++ b/src/app/shared/starts-with/date/starts-with-date.component.ts @@ -1,22 +1,27 @@ -import { Component, OnInit } from '@angular/core'; -import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; +import { NgFor } from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { hasValue } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgFor } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { StartsWithType, } from '../starts-with-decorator'; +import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; /** * A switchable component rendering StartsWith options for the type "Date". * The options are rendered in a dropdown with an input field (of type number) next to it. */ @Component({ - selector: 'ds-starts-with-date', - styleUrls: ['./starts-with-date.component.scss'], - templateUrl: './starts-with-date.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgFor, TranslateModule] + selector: 'ds-starts-with-date', + styleUrls: ['./starts-with-date.component.scss'], + templateUrl: './starts-with-date.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgFor, TranslateModule], }) export class StartsWithDateComponent extends StartsWithAbstractComponent implements OnInit { diff --git a/src/app/shared/starts-with/starts-with-abstract.component.ts b/src/app/shared/starts-with/starts-with-abstract.component.ts index 7c946c0def..e3b8ca13ab 100644 --- a/src/app/shared/starts-with/starts-with-abstract.component.ts +++ b/src/app/shared/starts-with/starts-with-abstract.component.ts @@ -1,6 +1,17 @@ -import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { UntypedFormControl, UntypedFormGroup, } from '@angular/forms'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + UntypedFormControl, + UntypedFormGroup, +} from '@angular/forms'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { Subscription } from 'rxjs'; import { PaginationService } from '../../core/pagination/pagination.service'; diff --git a/src/app/shared/starts-with/starts-with-decorator.spec.ts b/src/app/shared/starts-with/starts-with-decorator.spec.ts index bd515bf49f..8c394d91a3 100644 --- a/src/app/shared/starts-with/starts-with-decorator.spec.ts +++ b/src/app/shared/starts-with/starts-with-decorator.spec.ts @@ -1,7 +1,5 @@ import { renderStartsWithFor } from './starts-with-decorator'; -import { - StartsWithType, -} from './starts-with-type'; +import { StartsWithType } from './starts-with-type'; describe('BrowseByStartsWithDecorator', () => { const textDecorator = renderStartsWithFor(StartsWithType.text); diff --git a/src/app/shared/starts-with/starts-with-loader.component.spec.ts b/src/app/shared/starts-with/starts-with-loader.component.spec.ts index d80b87ead6..7a96e6954e 100644 --- a/src/app/shared/starts-with/starts-with-loader.component.spec.ts +++ b/src/app/shared/starts-with/starts-with-loader.component.spec.ts @@ -1,6 +1,16 @@ -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ChangeDetectionStrategy, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { PaginationService } from '../../core/pagination/pagination.service'; @@ -8,10 +18,10 @@ import { DynamicComponentLoaderDirective } from '../abstract-component-loader/dy import { getMockThemeService } from '../mocks/theme-service.mock'; import { ActivatedRouteStub } from '../testing/active-router.stub'; import { PaginationServiceStub } from '../testing/pagination-service.stub'; -import { StartsWithType } from './starts-with-type'; import { RouterStub } from '../testing/router.stub'; import { ThemeService } from '../theme-support/theme.service'; import { StartsWithLoaderComponent } from './starts-with-loader.component'; +import { StartsWithType } from './starts-with-type'; import { StartsWithTextComponent } from './text/starts-with-text.component'; describe('StartsWithLoaderComponent', () => { @@ -30,20 +40,20 @@ describe('StartsWithLoaderComponent', () => { themeService = getMockThemeService('dspace'); void TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), StartsWithTextComponent, - StartsWithLoaderComponent - ], - declarations: [DynamicComponentLoaderDirective], - providers: [ + StartsWithLoaderComponent, + ], + declarations: [DynamicComponentLoaderDirective], + providers: [ { provide: PaginationService, useValue: paginationService }, { provide: ActivatedRoute, useValue: route }, { provide: Router, useValue: new RouterStub() }, { provide: ThemeService, useValue: themeService }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).overrideComponent(StartsWithLoaderComponent, { + ], + schemas: [NO_ERRORS_SCHEMA], + }).overrideComponent(StartsWithLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, entryComponents: [StartsWithTextComponent], diff --git a/src/app/shared/starts-with/starts-with-loader.component.ts b/src/app/shared/starts-with/starts-with-loader.component.ts index 5a826a3609..884e05055a 100644 --- a/src/app/shared/starts-with/starts-with-loader.component.ts +++ b/src/app/shared/starts-with/starts-with-loader.component.ts @@ -1,9 +1,12 @@ -import { Component, Input, } from '@angular/core'; +import { + Component, + Input, +} from '@angular/core'; import { GenericConstructor } from '../../core/shared/generic-constructor'; -import { getStartsWithComponent } from './starts-with-decorator'; import { AbstractComponentLoaderComponent } from '../abstract-component-loader/abstract-component-loader.component'; import { StartsWithAbstractComponent } from './starts-with-abstract.component'; +import { getStartsWithComponent } from './starts-with-decorator'; import { StartsWithType } from './starts-with-type'; /** diff --git a/src/app/shared/starts-with/text/starts-with-text.component.spec.ts b/src/app/shared/starts-with/text/starts-with-text.component.spec.ts index 2e180159af..c0c6996d96 100644 --- a/src/app/shared/starts-with/text/starts-with-text.component.spec.ts +++ b/src/app/shared/starts-with/text/starts-with-text.component.spec.ts @@ -37,14 +37,14 @@ describe('StartsWithTextComponent', () => { router = new RouterStub(); await TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithTextComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithTextComponent, EnumKeysPipe], + providers: [ { provide: PaginationService, useValue: paginationService }, { provide: ActivatedRoute, useValue: route }, { provide: Router, useValue: router }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/starts-with/text/starts-with-text.component.ts b/src/app/shared/starts-with/text/starts-with-text.component.ts index cb0d0fe94b..7bd67cf399 100644 --- a/src/app/shared/starts-with/text/starts-with-text.component.ts +++ b/src/app/shared/starts-with/text/starts-with-text.component.ts @@ -1,20 +1,22 @@ import { Component } from '@angular/core'; -import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { hasValue } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { StartsWithType, } from '../starts-with-decorator'; +import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; /** * A switchable component rendering StartsWith options for the type "Text". */ @Component({ - selector: 'ds-starts-with-text', - styleUrls: ['./starts-with-text.component.scss'], - templateUrl: './starts-with-text.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule] + selector: 'ds-starts-with-text', + styleUrls: ['./starts-with-text.component.scss'], + templateUrl: './starts-with-text.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, TranslateModule], }) export class StartsWithTextComponent extends StartsWithAbstractComponent { diff --git a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.spec.ts b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.spec.ts index 97dbc93227..a5dfbd4093 100644 --- a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.spec.ts +++ b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.spec.ts @@ -28,6 +28,7 @@ import { buildPaginatedList } from '../../../core/data/paginated-list.model'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { Item } from '../../../core/shared/item.model'; import { PageInfo } from '../../../core/shared/page-info.model'; +import { getMockThemeService } from '../../mocks/theme-service.mock'; import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; import { NotificationsService } from '../../notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../remote-data.utils'; @@ -35,10 +36,9 @@ import { subscriptionMock, subscriptionMock2, } from '../../testing/subscriptions-data.mock'; +import { ThemeService } from '../../theme-support/theme.service'; import { SubscriptionsDataService } from '../subscriptions-data.service'; import { SubscriptionModalComponent } from './subscription-modal.component'; -import { ThemeService } from '../../theme-support/theme.service'; -import { getMockThemeService } from '../../mocks/theme-service.mock'; describe('SubscriptionModalComponent', () => { let component: SubscriptionModalComponent; @@ -98,29 +98,29 @@ describe('SubscriptionModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModalModule, ReactiveFormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - SubscriptionModalComponent - ], - providers: [ + SubscriptionModalComponent, + ], + providers: [ NgbActiveModal, { provide: AuthService, useValue: authService }, { provide: NotificationsService, useValue: notificationServiceStub }, { provide: SubscriptionsDataService, useValue: subscriptionServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); diff --git a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts index f43c1d48b8..452d890a55 100644 --- a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts +++ b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts @@ -1,33 +1,67 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; - -import { FormsModule, ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; - -import { BehaviorSubject, combineLatest, from, shareReplay } from 'rxjs'; -import { map, mergeMap, take, tap } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + AsyncPipe, + KeyValuePipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnInit, + Output, +} from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup, + Validators, +} from '@angular/forms'; +import { + NgbActiveModal, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import findIndex from 'lodash/findIndex'; +import { + BehaviorSubject, + combineLatest, + from, + shareReplay, +} from 'rxjs'; +import { + map, + mergeMap, + take, + tap, +} from 'rxjs/operators'; import { AuthService } from '../../../core/auth/auth.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { RemoteData } from '../../../core/data/remote-data'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; -import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstCompletedRemoteData, + getFirstSucceededRemoteDataPayload, +} from '../../../core/shared/operators'; +import { AlertComponent } from '../../alert/alert.component'; import { isNotEmpty } from '../../empty.util'; import { NotificationsService } from '../../notifications/notifications.service'; +import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; import { Subscription } from '../models/subscription.model'; import { SubscriptionsDataService } from '../subscriptions-data.service'; -import { AlertComponent } from '../../alert/alert.component'; -import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; -import { AsyncPipe, KeyValuePipe, NgFor, NgIf } from '@angular/common'; @Component({ - selector: 'ds-subscription-modal', - templateUrl: './subscription-modal.component.html', - styleUrls: ['./subscription-modal.component.scss'], - standalone: true, - imports: [NgIf, FormsModule, ReactiveFormsModule, ThemedTypeBadgeComponent, NgFor, AlertComponent, AsyncPipe, KeyValuePipe, TranslateModule] + selector: 'ds-subscription-modal', + templateUrl: './subscription-modal.component.html', + styleUrls: ['./subscription-modal.component.scss'], + standalone: true, + imports: [NgIf, FormsModule, ReactiveFormsModule, ThemedTypeBadgeComponent, NgFor, AlertComponent, AsyncPipe, KeyValuePipe, TranslateModule], }) /** * Modal that allows to manage the subscriptions for the selected item diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts index 3cd1e911f1..ab3392b4d2 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts @@ -24,6 +24,7 @@ import { of as observableOf } from 'rxjs'; import { Item } from '../../../core/shared/item.model'; import { ITEM } from '../../../core/shared/item.resource-type'; +import { getMockThemeService } from '../../mocks/theme-service.mock'; // Import mocks import { TranslateLoaderMock } from '../../mocks/translate-loader.mock'; // Import utils @@ -34,11 +35,10 @@ import { findByEPersonAndDsoResEmpty, subscriptionMock, } from '../../testing/subscriptions-data.mock'; +import { ThemeService } from '../../theme-support/theme.service'; import { Subscription } from '../models/subscription.model'; import { SubscriptionsDataService } from '../subscriptions-data.service'; import { SubscriptionViewComponent } from './subscription-view.component'; -import { ThemeService } from '../../theme-support/theme.service'; -import { getMockThemeService } from '../../mocks/theme-service.mock'; describe('SubscriptionViewComponent', () => { let component: SubscriptionViewComponent; @@ -67,29 +67,29 @@ describe('SubscriptionViewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, ReactiveFormsModule, BrowserModule, RouterTestingModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - SubscriptionViewComponent - ], - providers: [ + SubscriptionViewComponent, + ], + providers: [ { provide: ComponentFixtureAutoDetect, useValue: true }, { provide: NotificationsService, useValue: NotificationsServiceStub }, { provide: SubscriptionsDataService, useValue: subscriptionServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) - .compileComponents(); + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts b/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts index 3b17ae4d5d..a6e1834781 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts @@ -1,13 +1,19 @@ +import { + NgFor, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, Input, Output, } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { take } from 'rxjs/operators'; import { getCollectionModuleRoute } from '../../../collection-page/collection-page-routing-paths'; @@ -17,21 +23,18 @@ import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { getItemModuleRoute } from '../../../item-page/item-page-routing-paths'; import { ConfirmationModalComponent } from '../../confirmation-modal/confirmation-modal.component'; import { hasValue } from '../../empty.util'; +import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; import { Subscription } from '../models/subscription.model'; import { SubscriptionModalComponent } from '../subscription-modal/subscription-modal.component'; import { SubscriptionsDataService } from '../subscriptions-data.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; -import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; -import { NgIf, NgFor } from '@angular/common'; @Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: '[ds-subscription-view]', - templateUrl: './subscription-view.component.html', - styleUrls: ['./subscription-view.component.scss'], - standalone: true, - imports: [NgIf, ThemedTypeBadgeComponent, RouterLink, NgFor, TranslateModule] + // eslint-disable-next-line @angular-eslint/component-selector + selector: '[ds-subscription-view]', + templateUrl: './subscription-view.component.html', + styleUrls: ['./subscription-view.component.scss'], + standalone: true, + imports: [NgIf, ThemedTypeBadgeComponent, RouterLink, NgFor, TranslateModule], }) /** * Table row representing a subscription that displays all information and action buttons to manage it diff --git a/src/app/shared/subscriptions/subscriptions-data.service.ts b/src/app/shared/subscriptions/subscriptions-data.service.ts index 60c3c50584..1180c45563 100644 --- a/src/app/shared/subscriptions/subscriptions-data.service.ts +++ b/src/app/shared/subscriptions/subscriptions-data.service.ts @@ -11,11 +11,13 @@ import { } from 'rxjs/operators'; import { sendRequest } from 'src/app/core/shared/request.operators'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { + DSONameService, + DSONameService, +} from '../../core/breadcrumbs/dso-name.service'; import { RemoteDataBuildService } from '../../core/cache/builders/remote-data-build.service'; import { RequestParam } from '../../core/cache/models/request-param.model'; import { ObjectCacheService } from '../../core/cache/object-cache.service'; -import { dataService } from '../../core/data/base/data-service.decorator'; import { DeleteDataImpl } from '../../core/data/base/delete-data'; import { FindAllData } from '../../core/data/base/find-all-data'; import { IdentifiableDataService } from '../../core/data/base/identifiable-data.service'; @@ -31,8 +33,6 @@ import { import { RequestService } from '../../core/data/request.service'; import { RestRequest } from '../../core/data/rest-request.model'; import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; -import { Subscription } from './models/subscription.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { NoContent } from '../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { @@ -41,8 +41,10 @@ import { } from '../empty.util'; import { NotificationsService } from '../notifications/notifications.service'; import { followLink } from '../utils/follow-link-config.model'; -import { Subscription } from './models/subscription.model'; -import { SUBSCRIPTION } from './models/subscription.resource-type'; +import { + Subscription, + Subscription, +} from './models/subscription.model'; /** * Provides methods to retrieve subscription resources from the REST API related CRUD actions. diff --git a/src/app/shared/subscriptions/subscriptions.module.ts b/src/app/shared/subscriptions/subscriptions.module.ts index 702a3623d5..46a18f46c2 100644 --- a/src/app/shared/subscriptions/subscriptions.module.ts +++ b/src/app/shared/subscriptions/subscriptions.module.ts @@ -4,6 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; + import { SubscriptionModalComponent } from './subscription-modal/subscription-modal.component'; import { SubscriptionViewComponent } from './subscription-view/subscription-view.component'; @@ -13,15 +14,15 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - NgbModalModule, - ReactiveFormsModule, - TranslateModule, - RouterModule, - ...COMPONENTS - ], - exports: [ + imports: [ + CommonModule, + NgbModalModule, + ReactiveFormsModule, + TranslateModule, + RouterModule, + ...COMPONENTS, + ], + exports: [ ...COMPONENTS, ], }) diff --git a/src/app/shared/testing/browser-only-mock.pipe.ts b/src/app/shared/testing/browser-only-mock.pipe.ts index ddcfc5ec35..d49a246f88 100644 --- a/src/app/shared/testing/browser-only-mock.pipe.ts +++ b/src/app/shared/testing/browser-only-mock.pipe.ts @@ -8,7 +8,7 @@ import { */ @Pipe({ name: 'dsBrowserOnly', - standalone: true + standalone: true, }) export class BrowserOnlyMockPipe implements PipeTransform { transform(value: string): string | undefined { diff --git a/src/app/shared/testing/ng-component-outlet-directive.stub.ts b/src/app/shared/testing/ng-component-outlet-directive.stub.ts index 8bd5b930fb..debbc1d365 100644 --- a/src/app/shared/testing/ng-component-outlet-directive.stub.ts +++ b/src/app/shared/testing/ng-component-outlet-directive.stub.ts @@ -7,7 +7,7 @@ import { @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[ngComponentOutlet]', - standalone: true + standalone: true, }) export class NgComponentOutletDirectiveStub { @Input() ngComponentOutlet: any; diff --git a/src/app/shared/testing/query-params-directive.stub.ts b/src/app/shared/testing/query-params-directive.stub.ts index cfcbb91c5b..8610abbbd5 100644 --- a/src/app/shared/testing/query-params-directive.stub.ts +++ b/src/app/shared/testing/query-params-directive.stub.ts @@ -7,7 +7,7 @@ import { @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[queryParams]', - standalone: true + standalone: true, }) export class QueryParamsDirectiveStub { @Input() queryParams: any; diff --git a/src/app/shared/testing/route-service.stub.ts b/src/app/shared/testing/route-service.stub.ts index 1c3be69541..3098f9f91e 100644 --- a/src/app/shared/testing/route-service.stub.ts +++ b/src/app/shared/testing/route-service.stub.ts @@ -1,4 +1,7 @@ -import { EMPTY, of as observableOf, } from 'rxjs'; +import { + EMPTY, + of as observableOf, +} from 'rxjs'; export const routeServiceStub: any = { /* eslint-disable no-empty,@typescript-eslint/no-empty-function */ diff --git a/src/app/shared/testing/router-link-directive.stub.ts b/src/app/shared/testing/router-link-directive.stub.ts index 569064ced2..b3e2b09fb3 100644 --- a/src/app/shared/testing/router-link-directive.stub.ts +++ b/src/app/shared/testing/router-link-directive.stub.ts @@ -7,7 +7,7 @@ import { @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[routerLink]', - standalone: true + standalone: true, }) export class RouterLinkDirectiveStub { @Input() routerLink: any; diff --git a/src/app/shared/testing/test-module.ts b/src/app/shared/testing/test-module.ts index 0ad816d03b..eb250d1c2c 100644 --- a/src/app/shared/testing/test-module.ts +++ b/src/app/shared/testing/test-module.ts @@ -1,9 +1,10 @@ import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule, } from '@angular/core'; - import { - MySimpleItemActionComponent -} from '../../item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec'; + CUSTOM_ELEMENTS_SCHEMA, + NgModule, +} from '@angular/core'; + +import { MySimpleItemActionComponent } from '../../item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec'; import { BrowserOnlyMockPipe } from './browser-only-mock.pipe'; import { NgComponentOutletDirectiveStub } from './ng-component-outlet-directive.stub'; import { QueryParamsDirectiveStub } from './query-params-directive.stub'; @@ -26,8 +27,8 @@ import { RouterLinkDirectiveStub } from './router-link-directive.stub'; ], exports: [ QueryParamsDirectiveStub, - RouterLinkDirectiveStub, - BrowserOnlyMockPipe + RouterLinkDirectiveStub, + BrowserOnlyMockPipe, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, diff --git a/src/app/shared/testing/utils.test.ts b/src/app/shared/testing/utils.test.ts index aae0eb5682..a318f0b547 100644 --- a/src/app/shared/testing/utils.test.ts +++ b/src/app/shared/testing/utils.test.ts @@ -1,12 +1,22 @@ -import { ComponentFixture, MetadataOverride, TestBed, } from '@angular/core/testing'; -import { Observable, of as observableOf, } from 'rxjs'; +import { Component } from '@angular/core'; +import { + ComponentFixture, + MetadataOverride, + TestBed, +} from '@angular/core/testing'; +import { + Observable, + of as observableOf, +} from 'rxjs'; -import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; import { RequestEntry } from '../../core/data/request-entry.model'; import { RequestEntryState } from '../../core/data/request-entry-state.model'; import { PageInfo } from '../../core/shared/page-info.model'; import { UnCacheableObject } from '../../core/shared/uncacheable-object.model'; -import { Component } from '@angular/core'; /** * Returns true if a Native Element has a specified css class. @@ -33,7 +43,7 @@ export const hasClass = (element: any, className: string): boolean => { export const createTestComponent = (html: string, type: new (...args: any[]) => T, override: MetadataOverride = {}): ComponentFixture => { TestBed.overrideComponent(type, { set: { template: html }, - ...override + ...override, }); const fixture = TestBed.createComponent(type); diff --git a/src/app/shared/theme-support/themed.component.spec.ts b/src/app/shared/theme-support/themed.component.spec.ts index 97b77f2d50..a0cead6dc5 100644 --- a/src/app/shared/theme-support/themed.component.spec.ts +++ b/src/app/shared/theme-support/themed.component.spec.ts @@ -17,9 +17,9 @@ import { ThemeService } from './theme.service'; import { ThemedComponent } from './themed.component'; @Component({ - selector: 'ds-test-themed-component', - templateUrl: './themed.component.html', - standalone: true + selector: 'ds-test-themed-component', + templateUrl: './themed.component.html', + standalone: true, }) class TestThemedComponent extends ThemedComponent { protected inAndOutputNames: (keyof TestComponent & keyof this)[] = ['testInput']; @@ -45,12 +45,12 @@ describe('ThemedComponent', () => { function setupTestingModuleForTheme(theme: string, themes?: ThemeConfig[]) { themeService = getMockThemeService(theme, themes); TestBed.configureTestingModule({ - imports: [TestThemedComponent, VarDirective], - providers: [ + imports: [TestThemedComponent, VarDirective], + providers: [ { provide: ThemeService, useValue: themeService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); } function initComponent() { diff --git a/src/app/shared/trackable/abstract-trackable.component.spec.ts b/src/app/shared/trackable/abstract-trackable.component.spec.ts index 68fe8f62ce..bfd88e733e 100644 --- a/src/app/shared/trackable/abstract-trackable.component.spec.ts +++ b/src/app/shared/trackable/abstract-trackable.component.spec.ts @@ -54,14 +54,14 @@ describe('AbstractTrackableComponent', () => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), AbstractTrackableComponent], - providers: [ + imports: [TranslateModule.forRoot(), AbstractTrackableComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: NotificationsService, useValue: notificationsService }, - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/trackable/abstract-trackable.component.ts b/src/app/shared/trackable/abstract-trackable.component.ts index 97cb4c37cc..3f6a92b95b 100644 --- a/src/app/shared/trackable/abstract-trackable.component.ts +++ b/src/app/shared/trackable/abstract-trackable.component.ts @@ -9,9 +9,9 @@ import { NotificationsService } from '../notifications/notifications.service'; * Abstract Component that is able to track changes made in the inheriting component using the ObjectUpdateService */ @Component({ - selector: 'ds-abstract-trackable', - template: '', - standalone: true + selector: 'ds-abstract-trackable', + template: '', + standalone: true, }) export class AbstractTrackableComponent { diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts index 594235f33c..7e528650d9 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts @@ -44,22 +44,22 @@ describe('TruncatablePartComponent', () => { } else { return observableOf(false); } - }, + }, }; void TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, + imports: [NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), TruncatablePartComponent], - providers: [ + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: TruncatableService, useValue: truncatableService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(TruncatablePartComponent, { + }).overrideComponent(TruncatablePartComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); @@ -127,22 +127,22 @@ describe('TruncatablePartComponent', () => { beforeEach(waitForAsync(() => { translateService = getMockTranslateService(); void TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - TruncatablePartComponent - ], - providers: [ + TruncatablePartComponent, + ], + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: TruncatableService, useValue: mockTruncatableService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(TruncatablePartComponent, { + }).overrideComponent(TruncatablePartComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts index 73721cac6f..54220d7f10 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts @@ -1,17 +1,25 @@ -import { AfterViewChecked, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + AfterViewChecked, + Component, + ElementRef, + Input, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { hasValue } from '../../empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; import { DragClickDirective } from '../../utils/drag-click.directive'; import { TruncatableService } from '../truncatable.service'; @Component({ - selector: 'ds-truncatable-part', - templateUrl: './truncatable-part.component.html', - styleUrls: ['./truncatable-part.component.scss'], - standalone: true, - imports: [DragClickDirective, NgIf, TranslateModule] + selector: 'ds-truncatable-part', + templateUrl: './truncatable-part.component.html', + styleUrls: ['./truncatable-part.component.scss'], + standalone: true, + imports: [DragClickDirective, NgIf, TranslateModule], }) /** diff --git a/src/app/shared/truncatable/truncatable.component.spec.ts b/src/app/shared/truncatable/truncatable.component.spec.ts index 4c9618f612..a8796b4fa4 100644 --- a/src/app/shared/truncatable/truncatable.component.spec.ts +++ b/src/app/shared/truncatable/truncatable.component.spec.ts @@ -20,12 +20,12 @@ describe('TruncatableComponent', () => { let truncatableService; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TruncatableComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatableComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).overrideComponent(TruncatableComponent, { + }).overrideComponent(TruncatableComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/truncatable/truncatable.component.ts b/src/app/shared/truncatable/truncatable.component.ts index 34ca21327d..fccfc21188 100644 --- a/src/app/shared/truncatable/truncatable.component.ts +++ b/src/app/shared/truncatable/truncatable.component.ts @@ -9,10 +9,10 @@ import { import { TruncatableService } from './truncatable.service'; @Component({ - selector: 'ds-truncatable', - templateUrl: './truncatable.component.html', - styleUrls: ['./truncatable.component.scss'], - standalone: true + selector: 'ds-truncatable', + templateUrl: './truncatable.component.html', + styleUrls: ['./truncatable.component.scss'], + standalone: true, }) /** diff --git a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts index 3187c75a82..8c04bd264b 100644 --- a/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts +++ b/src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts @@ -1,12 +1,26 @@ -import { Component, EventEmitter, HostListener, Input, OnInit, Output, } from '@angular/core'; -import uniqueId from 'lodash/uniqueId'; -import { FileUploader, FileUploadModule } from 'ng2-file-upload'; -import { Observable, of as observableOf, } from 'rxjs'; -import { UploaderOptions } from '../uploader/uploader-options.model'; import { CommonModule } from '@angular/common'; +import { + Component, + EventEmitter, + HostListener, + Input, + OnInit, + Output, +} from '@angular/core'; import { FormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import uniqueId from 'lodash/uniqueId'; +import { + FileUploader, + FileUploadModule, +} from 'ng2-file-upload'; +import { + Observable, + of as observableOf, +} from 'rxjs'; + import { FileValidator } from '../../utils/require-file.validator'; +import { UploaderOptions } from '../uploader/uploader-options.model'; /** * Component to have a file dropzone without that dropping/choosing a file in browse automatically triggers @@ -24,9 +38,9 @@ import { FileValidator } from '../../utils/require-file.validator'; FormsModule, TranslateModule, FileUploadModule, - FileValidator + FileValidator, ], - standalone: true + standalone: true, }) export class FileDropzoneNoUploaderComponent implements OnInit { diff --git a/src/app/shared/upload/upload.module.ts b/src/app/shared/upload/upload.module.ts index b1dd57f13b..a5538b6afd 100644 --- a/src/app/shared/upload/upload.module.ts +++ b/src/app/shared/upload/upload.module.ts @@ -8,6 +8,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FileUploadModule } from 'ng2-file-upload'; + import { FileDropzoneNoUploaderComponent } from './file-dropzone-no-uploader/file-dropzone-no-uploader.component'; import { UploaderComponent } from './uploader/uploader.component'; @@ -17,17 +18,17 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - FileUploadModule, - ...COMPONENTS - ], - providers: [ - ...COMPONENTS, - ], - exports: [ - ...COMPONENTS, - FileUploadModule, + imports: [ + CommonModule, + FileUploadModule, + ...COMPONENTS, + ], + providers: [ + ...COMPONENTS, + ], + exports: [ + ...COMPONENTS, + FileUploadModule, ], }) export class UploadModule { diff --git a/src/app/shared/upload/uploader/uploader.component.spec.ts b/src/app/shared/upload/uploader/uploader.component.spec.ts index 5f57fc4d7d..90563f1080 100644 --- a/src/app/shared/upload/uploader/uploader.component.spec.ts +++ b/src/app/shared/upload/uploader/uploader.component.spec.ts @@ -1,7 +1,16 @@ // Load the implementations that should be tested import { HttpXsrfTokenExtractor } from '@angular/common/http'; -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { FileUploadModule } from 'ng2-file-upload'; @@ -23,21 +32,21 @@ describe('Chips component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FileUploadModule, TranslateModule.forRoot(), UploaderComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ ChangeDetectorRef, UploaderComponent, DragService, { provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock('mock-token') }, { provide: CookieService, useValue: new CookieServiceMock() }, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}); + }); })); @@ -61,10 +70,10 @@ describe('Chips component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FileUploadModule, UploaderComponent] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FileUploadModule, UploaderComponent], }) class TestComponent { public uploadFilesOptions: UploaderOptions = Object.assign(new UploaderOptions(), { diff --git a/src/app/shared/upload/uploader/uploader.component.ts b/src/app/shared/upload/uploader/uploader.component.ts index a74da31483..f4b2c35314 100644 --- a/src/app/shared/upload/uploader/uploader.component.ts +++ b/src/app/shared/upload/uploader/uploader.component.ts @@ -1,3 +1,5 @@ +import { CommonModule } from '@angular/common'; +import { HttpXsrfTokenExtractor } from '@angular/common/http'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -8,20 +10,28 @@ import { Output, ViewEncapsulation, } from '@angular/core'; - -import { of as observableOf } from 'rxjs'; -import { FileUploader, FileUploadModule } from 'ng2-file-upload'; +import { TranslateModule } from '@ngx-translate/core'; import uniqueId from 'lodash/uniqueId'; -import { HttpXsrfTokenExtractor } from '@angular/common/http'; +import { + FileUploader, + FileUploadModule, +} from 'ng2-file-upload'; +import { of as observableOf } from 'rxjs'; import { DragService } from '../../../core/drag.service'; import { CookieService } from '../../../core/services/cookie.service'; -import { XSRF_COOKIE, XSRF_REQUEST_HEADER, XSRF_RESPONSE_HEADER, } from '../../../core/xsrf/xsrf.constants'; -import { hasValue, isNotEmpty, isUndefined, } from '../../empty.util'; +import { + XSRF_COOKIE, + XSRF_REQUEST_HEADER, + XSRF_RESPONSE_HEADER, +} from '../../../core/xsrf/xsrf.constants'; +import { + hasValue, + isNotEmpty, + isUndefined, +} from '../../empty.util'; import { UploaderOptions } from './uploader-options.model'; import { UploaderProperties } from './uploader-properties.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { CommonModule } from '@angular/common'; @Component({ selector: 'ds-uploader', @@ -30,7 +40,7 @@ import { CommonModule } from '@angular/common'; changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.Emulated, standalone: true, - imports: [TranslateModule, FileUploadModule, CommonModule] + imports: [TranslateModule, FileUploadModule, CommonModule], }) export class UploaderComponent { diff --git a/src/app/shared/utils/auto-focus.directive.ts b/src/app/shared/utils/auto-focus.directive.ts index 614ee5161c..a6e3d053d4 100644 --- a/src/app/shared/utils/auto-focus.directive.ts +++ b/src/app/shared/utils/auto-focus.directive.ts @@ -11,8 +11,8 @@ import { isNotEmpty } from '../empty.util'; * Directive to set focus on an element when it is rendered */ @Directive({ - selector: '[dsAutoFocus]', - standalone: true + selector: '[dsAutoFocus]', + standalone: true, }) export class AutoFocusDirective implements AfterViewInit { diff --git a/src/app/shared/utils/browser-only.pipe.ts b/src/app/shared/utils/browser-only.pipe.ts index 16fbd5e4bc..cce471bec3 100644 --- a/src/app/shared/utils/browser-only.pipe.ts +++ b/src/app/shared/utils/browser-only.pipe.ts @@ -22,8 +22,8 @@ import { * until such components are fully interactive before trying to interact with them. */ @Pipe({ - name: 'dsBrowserOnly', - standalone: true + name: 'dsBrowserOnly', + standalone: true, }) export class BrowserOnlyPipe implements PipeTransform { constructor( diff --git a/src/app/shared/utils/capitalize.pipe.ts b/src/app/shared/utils/capitalize.pipe.ts index 14753d1eb1..107a183619 100644 --- a/src/app/shared/utils/capitalize.pipe.ts +++ b/src/app/shared/utils/capitalize.pipe.ts @@ -4,8 +4,8 @@ import { } from '@angular/core'; @Pipe({ - name: 'dsCapitalize', - standalone: true + name: 'dsCapitalize', + standalone: true, }) /** diff --git a/src/app/shared/utils/click-outside.directive.ts b/src/app/shared/utils/click-outside.directive.ts index b74d683cfe..2f2349af08 100644 --- a/src/app/shared/utils/click-outside.directive.ts +++ b/src/app/shared/utils/click-outside.directive.ts @@ -7,8 +7,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[dsClickOutside]', - standalone: true + selector: '[dsClickOutside]', + standalone: true, }) /** * Directive to detect when the users clicks outside of the element the directive was put on diff --git a/src/app/shared/utils/console.pipe.ts b/src/app/shared/utils/console.pipe.ts index a81d52ecab..170137012e 100644 --- a/src/app/shared/utils/console.pipe.ts +++ b/src/app/shared/utils/console.pipe.ts @@ -4,8 +4,8 @@ import { } from '@angular/core'; @Pipe({ - name: 'dsConsole', - standalone: true + name: 'dsConsole', + standalone: true, }) export class ConsolePipe implements PipeTransform { transform(value: any): string { diff --git a/src/app/shared/utils/debounce.directive.ts b/src/app/shared/utils/debounce.directive.ts index 5e5166ce33..efb78293ec 100644 --- a/src/app/shared/utils/debounce.directive.ts +++ b/src/app/shared/utils/debounce.directive.ts @@ -15,8 +15,8 @@ import { } from 'rxjs/operators'; @Directive({ - selector: '[ngModel][dsDebounce]', - standalone: true + selector: '[ngModel][dsDebounce]', + standalone: true, }) /** * Directive for setting a debounce time on an input field diff --git a/src/app/shared/utils/drag-click.directive.ts b/src/app/shared/utils/drag-click.directive.ts index c298879adc..4d0b1bcb81 100644 --- a/src/app/shared/utils/drag-click.directive.ts +++ b/src/app/shared/utils/drag-click.directive.ts @@ -6,8 +6,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[dsDragClick]', - standalone: true + selector: '[dsDragClick]', + standalone: true, }) /** diff --git a/src/app/shared/utils/emphasize.pipe.ts b/src/app/shared/utils/emphasize.pipe.ts index b7399ab157..f44ebc87dd 100644 --- a/src/app/shared/utils/emphasize.pipe.ts +++ b/src/app/shared/utils/emphasize.pipe.ts @@ -4,8 +4,8 @@ import { } from '@angular/core'; @Pipe({ - name: 'dsEmphasize', - standalone: true + name: 'dsEmphasize', + standalone: true, }) /** * Pipe for emphasizing a part of a string by surrounding it with tags diff --git a/src/app/shared/utils/enum-keys-pipe.ts b/src/app/shared/utils/enum-keys-pipe.ts index 334f4dafa0..c466e83828 100644 --- a/src/app/shared/utils/enum-keys-pipe.ts +++ b/src/app/shared/utils/enum-keys-pipe.ts @@ -4,8 +4,8 @@ import { } from '@angular/core'; @Pipe({ - name: 'dsKeys', - standalone: true + name: 'dsKeys', + standalone: true, }) /** * Pipe for parsing all values of an enumeration to an array of key-value pairs diff --git a/src/app/shared/utils/file-size-pipe.ts b/src/app/shared/utils/file-size-pipe.ts index cad47378d9..310fc08d17 100644 --- a/src/app/shared/utils/file-size-pipe.ts +++ b/src/app/shared/utils/file-size-pipe.ts @@ -16,8 +16,8 @@ import * as fileSize from 'filesize'; */ @Pipe({ - name: 'dsFileSize', - standalone: true + name: 'dsFileSize', + standalone: true, }) export class FileSizePipe implements PipeTransform { transform(bytes: number = 0, precision: number = 2): string { diff --git a/src/app/shared/utils/file-value-accessor.directive.ts b/src/app/shared/utils/file-value-accessor.directive.ts index 087336f467..96b7c62849 100644 --- a/src/app/shared/utils/file-value-accessor.directive.ts +++ b/src/app/shared/utils/file-value-accessor.directive.ts @@ -5,17 +5,17 @@ import { } from '@angular/forms'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: 'input[type=file]', - // eslint-disable-next-line @angular-eslint/no-host-metadata-property - host: { - '(change)': 'onChange($event.target.files)', + // eslint-disable-next-line @angular-eslint/directive-selector + selector: 'input[type=file]', + // eslint-disable-next-line @angular-eslint/no-host-metadata-property + host: { + '(change)': 'onChange($event.target.files)', '(blur)': 'onTouched()', }, providers: [ - { provide: NG_VALUE_ACCESSOR, useExisting: FileValueAccessorDirective, multi: true } - ], - standalone: true + { provide: NG_VALUE_ACCESSOR, useExisting: FileValueAccessorDirective, multi: true }, + ], + standalone: true, }) /** * Value accessor directive for inputs of type 'file' diff --git a/src/app/shared/utils/in-list-validator.directive.ts b/src/app/shared/utils/in-list-validator.directive.ts index a7f640e08a..6de189ded2 100644 --- a/src/app/shared/utils/in-list-validator.directive.ts +++ b/src/app/shared/utils/in-list-validator.directive.ts @@ -15,12 +15,12 @@ import { inListValidator } from './validator.functions'; * Directive for validating if a ngModel value is in a given list */ @Directive({ - selector: '[ngModel][dsInListValidator]', - // We add our directive to the list of existing validators - providers: [ - { provide: NG_VALIDATORS, useExisting: InListValidator, multi: true } - ], - standalone: true + selector: '[ngModel][dsInListValidator]', + // We add our directive to the list of existing validators + providers: [ + { provide: NG_VALIDATORS, useExisting: InListValidator, multi: true }, + ], + standalone: true, }) export class InListValidator implements Validator { /** diff --git a/src/app/shared/utils/markdown.pipe.ts b/src/app/shared/utils/markdown.pipe.ts index bc886794d0..6ab0c858f6 100644 --- a/src/app/shared/utils/markdown.pipe.ts +++ b/src/app/shared/utils/markdown.pipe.ts @@ -47,8 +47,8 @@ const SANITIZE_HTML = new InjectionToken( * */ @Pipe({ - name: 'dsMarkdown', - standalone: true + name: 'dsMarkdown', + standalone: true, }) export class MarkdownPipe implements PipeTransform { diff --git a/src/app/shared/utils/metadatafield-validator.directive.ts b/src/app/shared/utils/metadatafield-validator.directive.ts index 8228fba0fc..3112d4870b 100644 --- a/src/app/shared/utils/metadatafield-validator.directive.ts +++ b/src/app/shared/utils/metadatafield-validator.directive.ts @@ -29,12 +29,12 @@ import { getFirstSucceededRemoteData } from '../../core/shared/operators'; * Directive for validating if a ngModel value is a valid metadata field */ @Directive({ - selector: '[ngModel][dsMetadataFieldValidator]', - // We add our directive to the list of existing validators - providers: [ - { provide: NG_VALIDATORS, useExisting: MetadataFieldValidator, multi: true } - ], - standalone: true + selector: '[ngModel][dsMetadataFieldValidator]', + // We add our directive to the list of existing validators + providers: [ + { provide: NG_VALIDATORS, useExisting: MetadataFieldValidator, multi: true }, + ], + standalone: true, }) @Injectable({ providedIn: 'root' }) export class MetadataFieldValidator implements AsyncValidator { diff --git a/src/app/shared/utils/object-keys-pipe.ts b/src/app/shared/utils/object-keys-pipe.ts index cba36a8625..8ade3f236b 100644 --- a/src/app/shared/utils/object-keys-pipe.ts +++ b/src/app/shared/utils/object-keys-pipe.ts @@ -4,8 +4,8 @@ import { } from '@angular/core'; @Pipe({ - name: 'dsObjectKeys', - standalone: true + name: 'dsObjectKeys', + standalone: true, }) /** * Pipe for parsing all keys of an object to an array of key-value pairs diff --git a/src/app/shared/utils/object-ngfor.pipe.ts b/src/app/shared/utils/object-ngfor.pipe.ts index 6f9a52f621..c52426fef4 100644 --- a/src/app/shared/utils/object-ngfor.pipe.ts +++ b/src/app/shared/utils/object-ngfor.pipe.ts @@ -12,8 +12,8 @@ import { * */ @Pipe({ - name: 'dsObjNgFor', - standalone: true + name: 'dsObjNgFor', + standalone: true, }) export class ObjNgFor implements PipeTransform { transform(value: any, args: any[] = null): any { diff --git a/src/app/shared/utils/object-values-pipe.ts b/src/app/shared/utils/object-values-pipe.ts index d2e93f888c..6b862afff9 100644 --- a/src/app/shared/utils/object-values-pipe.ts +++ b/src/app/shared/utils/object-values-pipe.ts @@ -6,9 +6,9 @@ import { import { isNotEmpty } from '../empty.util'; @Pipe({ - name: 'dsObjectValues', - pure: true, - standalone: true + name: 'dsObjectValues', + pure: true, + standalone: true, }) /** * Pipe for parsing all values of an object to an array of values diff --git a/src/app/shared/utils/require-file.validator.ts b/src/app/shared/utils/require-file.validator.ts index cde13659e3..6825f058dd 100644 --- a/src/app/shared/utils/require-file.validator.ts +++ b/src/app/shared/utils/require-file.validator.ts @@ -1,13 +1,17 @@ import { Directive } from '@angular/core'; -import { NG_VALIDATORS, UntypedFormControl, Validator, } from '@angular/forms'; +import { + NG_VALIDATORS, + UntypedFormControl, + Validator, +} from '@angular/forms'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: '[requireFile]', - providers: [ - { provide: NG_VALIDATORS, useExisting: FileValidator, multi: true }, - ], - standalone: true + // eslint-disable-next-line @angular-eslint/directive-selector + selector: '[requireFile]', + providers: [ + { provide: NG_VALIDATORS, useExisting: FileValidator, multi: true }, + ], + standalone: true, }) /** * Validator directive to validate if a file is selected diff --git a/src/app/shared/utils/safe-url-pipe.ts b/src/app/shared/utils/safe-url-pipe.ts index aa13933912..6cb9d9fb1b 100644 --- a/src/app/shared/utils/safe-url-pipe.ts +++ b/src/app/shared/utils/safe-url-pipe.ts @@ -10,8 +10,8 @@ import { DomSanitizer } from '@angular/platform-browser'; */ @Pipe({ - name: 'dsSafeUrl', - standalone: true + name: 'dsSafeUrl', + standalone: true, }) export class SafeUrlPipe implements PipeTransform { constructor(private domSanitizer: DomSanitizer) { } diff --git a/src/app/shared/utils/short-number.pipe.ts b/src/app/shared/utils/short-number.pipe.ts index 93711955f9..f0b458755d 100644 --- a/src/app/shared/utils/short-number.pipe.ts +++ b/src/app/shared/utils/short-number.pipe.ts @@ -7,8 +7,8 @@ import { isEmpty } from '../empty.util'; @Pipe({ - name: 'dsShortNumber', - standalone: true + name: 'dsShortNumber', + standalone: true, }) export class ShortNumberPipe implements PipeTransform { diff --git a/src/app/shared/utils/split.pipe.ts b/src/app/shared/utils/split.pipe.ts index bf55413ad6..c84e7895f1 100644 --- a/src/app/shared/utils/split.pipe.ts +++ b/src/app/shared/utils/split.pipe.ts @@ -11,7 +11,7 @@ import { */ @Pipe({ name: 'dsSplit', - standalone: true + standalone: true, }) export class SplitPipe implements PipeTransform { transform(value: string, separator: string): string[] { diff --git a/src/app/shared/utils/truncate.pipe.ts b/src/app/shared/utils/truncate.pipe.ts index bc2ce92d8e..2955be8f5d 100644 --- a/src/app/shared/utils/truncate.pipe.ts +++ b/src/app/shared/utils/truncate.pipe.ts @@ -10,8 +10,8 @@ import { hasValue } from '../empty.util'; * Default value: 10 */ @Pipe({ - name: 'dsTruncate', - standalone: true + name: 'dsTruncate', + standalone: true, }) export class TruncatePipe implements PipeTransform { diff --git a/src/app/shared/utils/var.directive.ts b/src/app/shared/utils/var.directive.ts index 51cd497629..eaa8a6fdc1 100644 --- a/src/app/shared/utils/var.directive.ts +++ b/src/app/shared/utils/var.directive.ts @@ -7,8 +7,8 @@ import { /* eslint-disable @angular-eslint/directive-selector */ @Directive({ - selector: '[ngVar]', - standalone: true + selector: '[ngVar]', + standalone: true, }) export class VarDirective { @Input() diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.spec.ts b/src/app/shared/view-mode-switch/view-mode-switch.component.spec.ts index a173805705..e4d92bece4 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.spec.ts +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.spec.ts @@ -1,8 +1,20 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { SearchService } from '../../core/shared/search/search.service'; import { ViewMode } from '../../core/shared/view-mode.model'; @@ -11,8 +23,8 @@ import { SearchServiceStub } from '../testing/search-service.stub'; import { ViewModeSwitchComponent } from './view-mode-switch.component'; @Component({ - template: '', - standalone: true + template: '', + standalone: true, }) class DummyComponent { } @@ -26,23 +38,23 @@ describe('ViewModeSwitchComponent', () => { let detailButton: HTMLElement; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), RouterTestingModule.withRoutes([ - { path: 'search', component: DummyComponent, pathMatch: 'full' }, + { path: 'search', component: DummyComponent, pathMatch: 'full' }, ]), ViewModeSwitchComponent, - DummyComponent - ], - providers: [ + DummyComponent, + ], + providers: [ { provide: SearchService, useValue: searchService }, - ] -}).overrideComponent(ViewModeSwitchComponent, { + ], + }).overrideComponent(ViewModeSwitchComponent, { set: { changeDetection: ChangeDetectionStrategy.Default }, }).compileComponents(); })); diff --git a/src/app/shared/view-mode-switch/view-mode-switch.component.ts b/src/app/shared/view-mode-switch/view-mode-switch.component.ts index c3c289230e..baed3c9336 100644 --- a/src/app/shared/view-mode-switch/view-mode-switch.component.ts +++ b/src/app/shared/view-mode-switch/view-mode-switch.component.ts @@ -1,25 +1,39 @@ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, } from '@angular/core'; -import { Router, RouterLink, RouterLinkActive } from '@angular/router'; +import { NgIf } from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnDestroy, + OnInit, + Output, +} from '@angular/core'; +import { + Router, + RouterLink, + RouterLinkActive, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { SearchService } from '../../core/shared/search/search.service'; import { ViewMode } from '../../core/shared/view-mode.model'; -import { isEmpty, isNotEmpty, } from '../empty.util'; -import { currentPath } from '../utils/route.utils'; +import { + isEmpty, + isNotEmpty, +} from '../empty.util'; import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgIf } from '@angular/common'; +import { currentPath } from '../utils/route.utils'; /** * Component to switch between list and grid views. */ @Component({ - selector: 'ds-view-mode-switch', - styleUrls: ['./view-mode-switch.component.scss'], - templateUrl: './view-mode-switch.component.html', - standalone: true, - imports: [NgIf, RouterLink, RouterLinkActive, TranslateModule, BrowserOnlyPipe] + selector: 'ds-view-mode-switch', + styleUrls: ['./view-mode-switch.component.scss'], + templateUrl: './view-mode-switch.component.html', + standalone: true, + imports: [NgIf, RouterLink, RouterLinkActive, TranslateModule, BrowserOnlyPipe], }) export class ViewModeSwitchComponent implements OnInit, OnDestroy { diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts index 390be87b2e..ddb83328b1 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts @@ -1,4 +1,7 @@ -import { CommonModule } from '@angular/common'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; import { DebugElement } from '@angular/core'; import { ComponentFixture, @@ -14,15 +17,15 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../../core/auth/auth.service'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; -import { CommonModule } from '@angular/common'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { Collection } from '../../core/shared/collection.model'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; +import { + UsageReport, + UsageReport, +} from '../../core/statistics/models/usage-report.model'; import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; -import { SharedModule } from '../../shared/shared.module'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { CollectionStatisticsPageComponent } from './collection-statistics-page.component'; @@ -72,21 +75,21 @@ describe('CollectionStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, CollectionStatisticsPageComponent, - StatisticsTableComponent - ], - providers: [ + StatisticsTableComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: UsageReportDataService, useValue: usageReportService }, { provide: DSpaceObjectDataService, useValue: {} }, { provide: DSONameService, useValue: nameService }, { provide: AuthService, useValue: authService }, - ] -}) + ], + }) .compileComponents(); })); diff --git a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts index 3d7b651e69..1dfe3ad8bf 100644 --- a/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts +++ b/src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts @@ -1,31 +1,25 @@ -import { Component } from '@angular/core'; -import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; -import { Collection } from '../../core/shared/collection.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { - ActivatedRoute, - Router, -} from '@angular/router'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; -import { AuthService } from '../../core/auth/auth.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { Collection } from '../../core/shared/collection.model'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; +import { + Collection, + Collection, +} from '../../core/shared/collection.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; +import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; /** * Component representing the statistics page for a collection. */ @Component({ - selector: 'ds-collection-statistics-page', - templateUrl: '../statistics-page/statistics-page.component.html', - styleUrls: ['./collection-statistics-page.component.scss'], - standalone: true, - imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], + selector: 'ds-collection-statistics-page', + templateUrl: '../statistics-page/statistics-page.component.html', + styleUrls: ['./collection-statistics-page.component.scss'], + standalone: true, + imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], }) export class CollectionStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts b/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts index dc8b6ae0f7..43d474db27 100644 --- a/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts +++ b/src/app/statistics-page/collection-statistics-page/themed-collection-statistics-page.component.ts @@ -7,10 +7,10 @@ import { CollectionStatisticsPageComponent } from './collection-statistics-page. * Themed wrapper for CollectionStatisticsPageComponent */ @Component({ - selector: 'ds-themed-collection-statistics-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-collection-statistics-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCollectionStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts index 40fee16b26..6155092275 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts @@ -1,4 +1,7 @@ -import { CommonModule } from '@angular/common'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; import { DebugElement } from '@angular/core'; import { ComponentFixture, @@ -6,8 +9,6 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; -import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router, @@ -19,10 +20,12 @@ import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { Community } from '../../core/shared/community.model'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; +import { + UsageReport, + UsageReport, +} from '../../core/statistics/models/usage-report.model'; import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; -import { SharedModule } from '../../shared/shared.module'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { CommunityStatisticsPageComponent } from './community-statistics-page.component'; @@ -72,21 +75,21 @@ describe('CommunityStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, CommunityStatisticsPageComponent, - StatisticsTableComponent - ], - providers: [ + StatisticsTableComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: UsageReportDataService, useValue: usageReportService }, { provide: DSpaceObjectDataService, useValue: {} }, { provide: DSONameService, useValue: nameService }, { provide: AuthService, useValue: authService }, - ] -}) + ], + }) .compileComponents(); })); diff --git a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts index ade9c712a9..1580519a49 100644 --- a/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts +++ b/src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts @@ -1,21 +1,15 @@ -import { Component } from '@angular/core'; -import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; -import { Community } from '../../core/shared/community.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { - ActivatedRoute, - Router, -} from '@angular/router'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; -import { AuthService } from '../../core/auth/auth.service'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { Community } from '../../core/shared/community.model'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; +import { + Community, + Community, +} from '../../core/shared/community.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; +import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; /** * Component representing the statistics page for a community. diff --git a/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts b/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts index 1988cb944b..7f6e8b0b62 100644 --- a/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts +++ b/src/app/statistics-page/community-statistics-page/themed-community-statistics-page.component.ts @@ -7,10 +7,10 @@ import { CommunityStatisticsPageComponent } from './community-statistics-page.co * Themed wrapper for CommunityStatisticsPageComponent */ @Component({ - selector: 'ds-themed-collection-statistics-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-collection-statistics-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedCommunityStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts index 8544d1a1eb..f5f3361cce 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts @@ -1,9 +1,15 @@ import { CommonModule } from '@angular/common'; import { DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -11,6 +17,7 @@ import { AuthService } from '../../core/auth/auth.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { Item } from '../../core/shared/item.model'; +import { UsageReport } from '../../core/statistics/models/usage-report.model'; import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; @@ -62,21 +69,21 @@ describe('ItemStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, ItemStatisticsPageComponent, - StatisticsTableComponent - ], - providers: [ + StatisticsTableComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: UsageReportDataService, useValue: usageReportService }, { provide: DSpaceObjectDataService, useValue: {} }, { provide: DSONameService, useValue: nameService }, { provide: AuthService, useValue: authService }, - ] -}) + ], + }) .compileComponents(); })); diff --git a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts index 4673301764..e6aaeada81 100644 --- a/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts +++ b/src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts @@ -1,20 +1,21 @@ -import { Component } from '@angular/core'; -import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; -import { Item } from '../../core/shared/item.model'; -import { TranslateModule } from '@ngx-translate/core'; -import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { Item } from '../../core/shared/item.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { VarDirective } from '../../shared/utils/var.directive'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; +import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; /** * Component representing the statistics page for an item. */ @Component({ - selector: 'ds-item-statistics-page', - templateUrl: '../statistics-page/statistics-page.component.html', - styleUrls: ['./item-statistics-page.component.scss'], - standalone: true, + selector: 'ds-item-statistics-page', + templateUrl: '../statistics-page/statistics-page.component.html', + styleUrls: ['./item-statistics-page.component.scss'], + standalone: true, imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], }) export class ItemStatisticsPageComponent extends StatisticsPageDirective { diff --git a/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts b/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts index c85cc852fa..c487ae6a9f 100644 --- a/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts +++ b/src/app/statistics-page/item-statistics-page/themed-item-statistics-page.component.ts @@ -7,10 +7,10 @@ import { ItemStatisticsPageComponent } from './item-statistics-page.component'; * Themed wrapper for ItemStatisticsPageComponent */ @Component({ - selector: 'ds-themed-item-statistics-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-item-statistics-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedItemStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts index 6e07c296b5..9b23afdd74 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts @@ -1,9 +1,15 @@ import { CommonModule } from '@angular/common'; import { DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { UsageReport } from '../../core/statistics/models/usage-report.model'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; @@ -12,6 +18,7 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { SiteDataService } from '../../core/data/site-data.service'; import { Site } from '../../core/shared/site.model'; +import { UsageReport } from '../../core/statistics/models/usage-report.model'; import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; import { SiteStatisticsPageComponent } from './site-statistics-page.component'; @@ -62,13 +69,13 @@ describe('SiteStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, SiteStatisticsPageComponent, - StatisticsTableComponent - ], - providers: [ + StatisticsTableComponent, + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: UsageReportDataService, useValue: usageReportService }, @@ -76,8 +83,8 @@ describe('SiteStatisticsPageComponent', () => { { provide: DSONameService, useValue: nameService }, { provide: SiteDataService, useValue: siteService }, { provide: AuthService, useValue: authService }, - ] -}) + ], + }) .compileComponents(); })); diff --git a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts index 6ee5f7d7c0..8f13a56e47 100644 --- a/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts +++ b/src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts @@ -1,14 +1,14 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; -import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; -import { Site } from '../../core/shared/site.model'; +import { TranslateModule } from '@ngx-translate/core'; import { switchMap } from 'rxjs/operators'; -import { TranslateModule } from '@ngx-translate/core'; -import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../shared/utils/var.directive'; import { SiteDataService } from '../../core/data/site-data.service'; +import { Site } from '../../core/shared/site.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; +import { StatisticsTableComponent } from '../statistics-table/statistics-table.component'; /** * Component representing the site-wide statistics page. diff --git a/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts b/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts index 5e7a097048..0044556106 100644 --- a/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts +++ b/src/app/statistics-page/site-statistics-page/themed-site-statistics-page.component.ts @@ -7,10 +7,10 @@ import { SiteStatisticsPageComponent } from './site-statistics-page.component'; * Themed wrapper for SiteStatisticsPageComponent */ @Component({ - selector: 'ds-themed-site-statistics-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-site-statistics-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSiteStatisticsPageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/statistics-page/statistics-page-routes.ts b/src/app/statistics-page/statistics-page-routes.ts index b048f63377..58d7b271f8 100644 --- a/src/app/statistics-page/statistics-page-routes.ts +++ b/src/app/statistics-page/statistics-page-routes.ts @@ -1,27 +1,22 @@ import { Route } from '@angular/router'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; + import { CollectionPageResolver } from '../collection-page/collection-page.resolver'; import { CommunityPageResolver } from '../community-page/community-page.resolver'; -import { - ThemedCollectionStatisticsPageComponent -} from './collection-statistics-page/themed-collection-statistics-page.component'; -import { - ThemedCommunityStatisticsPageComponent -} from './community-statistics-page/themed-community-statistics-page.component'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; +import { StatisticsAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard'; +import { ItemResolver } from '../item-page/item.resolver'; +import { ThemedCollectionStatisticsPageComponent } from './collection-statistics-page/themed-collection-statistics-page.component'; +import { ThemedCommunityStatisticsPageComponent } from './community-statistics-page/themed-community-statistics-page.component'; import { ThemedItemStatisticsPageComponent } from './item-statistics-page/themed-item-statistics-page.component'; import { ThemedSiteStatisticsPageComponent } from './site-statistics-page/themed-site-statistics-page.component'; -import { ItemResolver } from '../item-page/item.resolver'; -import { - StatisticsAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/statistics-administrator.guard'; const providers = [ I18nBreadcrumbResolver, I18nBreadcrumbsService, CollectionPageResolver, CommunityPageResolver, - ItemResolver + ItemResolver, ]; export const ROUTES: Route[] = [ @@ -29,11 +24,11 @@ export const ROUTES: Route[] = [ path: '', providers, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'statistics.title', - breadcrumbKey: 'statistics' + breadcrumbKey: 'statistics', }, children: [ { @@ -41,48 +36,48 @@ export const ROUTES: Route[] = [ component: ThemedSiteStatisticsPageComponent, }, ], - canActivate: [StatisticsAdministratorGuard] + canActivate: [StatisticsAdministratorGuard], }, { path: `items/:id`, providers, resolve: { scope: ItemResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'statistics.title', - breadcrumbKey: 'statistics' + breadcrumbKey: 'statistics', }, component: ThemedItemStatisticsPageComponent, - canActivate: [StatisticsAdministratorGuard] + canActivate: [StatisticsAdministratorGuard], }, { path: `collections/:id`, providers, resolve: { scope: CollectionPageResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'statistics.title', - breadcrumbKey: 'statistics' + breadcrumbKey: 'statistics', }, component: ThemedCollectionStatisticsPageComponent, - canActivate: [StatisticsAdministratorGuard] + canActivate: [StatisticsAdministratorGuard], }, { path: `communities/:id`, providers, resolve: { scope: CommunityPageResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'statistics.title', - breadcrumbKey: 'statistics' + breadcrumbKey: 'statistics', }, component: ThemedCommunityStatisticsPageComponent, - canActivate: [StatisticsAdministratorGuard] + canActivate: [StatisticsAdministratorGuard], }, ]; diff --git a/src/app/statistics-page/statistics-page.module.ts b/src/app/statistics-page/statistics-page.module.ts index 3f53e87f91..e1ca4dc7a1 100644 --- a/src/app/statistics-page/statistics-page.module.ts +++ b/src/app/statistics-page/statistics-page.module.ts @@ -1,15 +1,12 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; + import { UsageReportDataService } from '../core/statistics/usage-report-data.service'; import { StatisticsModule } from '../statistics/statistics.module'; import { CollectionStatisticsPageComponent } from './collection-statistics-page/collection-statistics-page.component'; -import { - ThemedCollectionStatisticsPageComponent -} from './collection-statistics-page/themed-collection-statistics-page.component'; +import { ThemedCollectionStatisticsPageComponent } from './collection-statistics-page/themed-collection-statistics-page.component'; import { CommunityStatisticsPageComponent } from './community-statistics-page/community-statistics-page.component'; -import { - ThemedCommunityStatisticsPageComponent -} from './community-statistics-page/themed-community-statistics-page.component'; +import { ThemedCommunityStatisticsPageComponent } from './community-statistics-page/themed-community-statistics-page.component'; import { ItemStatisticsPageComponent } from './item-statistics-page/item-statistics-page.component'; import { ThemedItemStatisticsPageComponent } from './item-statistics-page/themed-item-statistics-page.component'; import { SiteStatisticsPageComponent } from './site-statistics-page/site-statistics-page.component'; @@ -29,14 +26,14 @@ const components = [ ]; @NgModule({ - imports: [ - CommonModule, - StatisticsModule.forRoot(), - ...components - ], - providers: [ - UsageReportDataService, - ], + imports: [ + CommonModule, + StatisticsModule.forRoot(), + ...components, + ], + providers: [ + UsageReportDataService, + ], exports: components, }) diff --git a/src/app/statistics-page/statistics-page/statistics-page.directive.ts b/src/app/statistics-page/statistics-page/statistics-page.directive.ts index c6bbd93bfa..e781b89487 100644 --- a/src/app/statistics-page/statistics-page/statistics-page.directive.ts +++ b/src/app/statistics-page/statistics-page/statistics-page.directive.ts @@ -1,5 +1,6 @@ import { - Directive, inject, + Directive, + inject, OnInit, } from '@angular/core'; import { diff --git a/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts b/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts index 454fffea3b..105a7623d6 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.spec.ts @@ -20,16 +20,16 @@ describe('StatisticsTableComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - StatisticsTableComponent - ], - providers: [ + StatisticsTableComponent, + ], + providers: [ { provide: DSpaceObjectDataService, useValue: {} }, { provide: DSONameService, useValue: {} }, - ] -}) - .compileComponents(); + ], + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/statistics-page/statistics-table/statistics-table.component.ts b/src/app/statistics-page/statistics-table/statistics-table.component.ts index 37c1d72839..4a176c0616 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.ts @@ -1,24 +1,44 @@ -import { Component, Input, OnInit, } from '@angular/core'; -import { Observable, of, } from 'rxjs'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { getFinishedRemoteData, getRemoteDataPayload, } from '../../core/shared/operators'; -import { Point, UsageReport, } from '../../core/statistics/models/usage-report.model'; +import { + getFinishedRemoteData, + getRemoteDataPayload, +} from '../../core/shared/operators'; +import { + Point, + UsageReport, +} from '../../core/statistics/models/usage-report.model'; import { isEmpty } from '../../shared/empty.util'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; /** * Component representing a statistics table for a given usage report. */ @Component({ - selector: 'ds-statistics-table', - templateUrl: './statistics-table.component.html', - styleUrls: ['./statistics-table.component.scss'], - standalone: true, - imports: [NgIf, NgFor, AsyncPipe, TranslateModule] + selector: 'ds-statistics-table', + templateUrl: './statistics-table.component.html', + styleUrls: ['./statistics-table.component.scss'], + standalone: true, + imports: [NgIf, NgFor, AsyncPipe, TranslateModule], }) export class StatisticsTableComponent implements OnInit { diff --git a/src/app/statistics/angulartics/dspace/view-tracker.component.ts b/src/app/statistics/angulartics/dspace/view-tracker.component.ts index 392b492b47..801f4fd2cb 100644 --- a/src/app/statistics/angulartics/dspace/view-tracker.component.ts +++ b/src/app/statistics/angulartics/dspace/view-tracker.component.ts @@ -16,10 +16,10 @@ import { hasValue } from '../../../shared/empty.util'; * This component triggers a page view statistic */ @Component({ - selector: 'ds-view-tracker', - styleUrls: ['./view-tracker.component.scss'], - templateUrl: './view-tracker.component.html', - standalone: true + selector: 'ds-view-tracker', + styleUrls: ['./view-tracker.component.scss'], + templateUrl: './view-tracker.component.html', + standalone: true, }) export class ViewTrackerComponent implements OnInit, OnDestroy { /** diff --git a/src/app/statistics/statistics.module.ts b/src/app/statistics/statistics.module.ts index 000226c578..ccaaa8f240 100644 --- a/src/app/statistics/statistics.module.ts +++ b/src/app/statistics/statistics.module.ts @@ -1,5 +1,9 @@ import { CommonModule } from '@angular/common'; -import { ModuleWithProviders, NgModule, } from '@angular/core'; +import { + ModuleWithProviders, + NgModule, +} from '@angular/core'; + import { ViewTrackerComponent } from './angulartics/dspace/view-tracker.component'; import { StatisticsEndpoint } from './statistics-endpoint.model'; @@ -11,12 +15,12 @@ export const models = [ ]; @NgModule({ - imports: [ - CommonModule, - ViewTrackerComponent - ], - exports: [ - ViewTrackerComponent, + imports: [ + CommonModule, + ViewTrackerComponent, + ], + exports: [ + ViewTrackerComponent, ], }) /** diff --git a/src/app/submission/edit/submission-edit.component.spec.ts b/src/app/submission/edit/submission-edit.component.spec.ts index e002cd486f..ffac7959eb 100644 --- a/src/app/submission/edit/submission-edit.component.spec.ts +++ b/src/app/submission/edit/submission-edit.component.spec.ts @@ -1,35 +1,42 @@ -import { ComponentFixture, fakeAsync, TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { ActivatedRoute, Router } from '@angular/router'; import { NO_ERRORS_SCHEMA } from '@angular/core'; - -import { of, of as observableOf } from 'rxjs'; +import { + ComponentFixture, + fakeAsync, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { + of as observableOf, + of, +} from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; +import { AuthService } from '../../core/auth/auth.service'; import { ItemDataService } from '../../core/data/item-data.service'; +import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; import { SubmissionJsonPatchOperationsService } from '../../core/submission/submission-json-patch-operations.service'; import { mockSubmissionObject } from '../../shared/mocks/submission.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; -import { SubmissionService } from '../submission.service'; -import { SubmissionServiceStub } from '../../shared/testing/submission-service.stub'; - -import { RouterStub } from '../../shared/testing/router.stub'; -import { - SubmissionJsonPatchOperationsServiceStub -} from '../../shared/testing/submission-json-patch-operations-service.stub'; -import { SubmissionEditComponent } from './submission-edit.component'; import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; -import { AuthService } from '../../core/auth/auth.service'; -import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; -import { SectionsService } from '../sections/sections.service'; +import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub'; +import { RouterStub } from '../../shared/testing/router.stub'; import { SectionsServiceStub } from '../../shared/testing/sections-service.stub'; +import { SubmissionJsonPatchOperationsServiceStub } from '../../shared/testing/submission-json-patch-operations-service.stub'; +import { SubmissionServiceStub } from '../../shared/testing/submission-service.stub'; import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { provideMockStore } from '@ngrx/store/testing'; -import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface'; +import { SectionsService } from '../sections/sections.service'; +import { SubmissionService } from '../submission.service'; +import { SubmissionEditComponent } from './submission-edit.component'; describe('SubmissionEditComponent Component', () => { @@ -53,18 +60,18 @@ describe('SubmissionEditComponent Component', () => { }); halService = jasmine.createSpyObj('halService', { - getEndpoint: of('fake-url') + getEndpoint: of('fake-url'), }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([ - { path: ':id/edit', component: SubmissionEditComponent, pathMatch: 'full' }, + { path: ':id/edit', component: SubmissionEditComponent, pathMatch: 'full' }, ]), - SubmissionEditComponent - ], - providers: [ + SubmissionEditComponent, + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, @@ -77,10 +84,10 @@ describe('SubmissionEditComponent Component', () => { { provide: SectionsService, useValue: new SectionsServiceStub() }, { provide: ThemeService, useValue: themeService }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - provideMockStore() - ], + provideMockStore(), + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/submission/edit/submission-edit.component.ts b/src/app/submission/edit/submission-edit.component.ts index 2931450d47..4b05891512 100644 --- a/src/app/submission/edit/submission-edit.component.ts +++ b/src/app/submission/edit/submission-edit.component.ts @@ -1,8 +1,24 @@ -import { ChangeDetectorRef, Component, OnDestroy, OnInit, } from '@angular/core'; -import { ActivatedRoute, ParamMap, Router, } from '@angular/router'; +import { + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + ParamMap, + Router, +} from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { BehaviorSubject, Subscription, } from 'rxjs'; -import { debounceTime, filter, switchMap, } from 'rxjs/operators'; +import { + BehaviorSubject, + Subscription, +} from 'rxjs'; +import { + debounceTime, + filter, + switchMap, +} from 'rxjs/operators'; import { SubmissionDefinitionsModel } from '../../core/config/models/config-submission-definitions.model'; import { ItemDataService } from '../../core/data/item-data.service'; @@ -13,12 +29,17 @@ import { getAllSucceededRemoteData } from '../../core/shared/operators'; import { SubmissionObject } from '../../core/submission/models/submission-object.model'; import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model'; import { SubmissionJsonPatchOperationsService } from '../../core/submission/submission-json-patch-operations.service'; -import { hasValue, isEmpty, isNotEmptyOperator, isNotNull, } from '../../shared/empty.util'; +import { + hasValue, + isEmpty, + isNotEmptyOperator, + isNotNull, +} from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { SubmissionFormComponent } from '../form/submission-form.component'; import { SubmissionError } from '../objects/submission-error.model'; import { SubmissionService } from '../submission.service'; import parseSectionErrors from '../utils/parseSectionErrors'; -import { SubmissionFormComponent } from '../form/submission-form.component'; /** * This component allows to edit an existing workspaceitem/workflowitem. @@ -29,8 +50,8 @@ import { SubmissionFormComponent } from '../form/submission-form.component'; templateUrl: './submission-edit.component.html', standalone: true, imports: [ - SubmissionFormComponent - ] + SubmissionFormComponent, + ], }) export class SubmissionEditComponent implements OnDestroy, OnInit { diff --git a/src/app/submission/edit/themed-submission-edit.component.ts b/src/app/submission/edit/themed-submission-edit.component.ts index b4a25f8ef7..bb4e64befc 100644 --- a/src/app/submission/edit/themed-submission-edit.component.ts +++ b/src/app/submission/edit/themed-submission-edit.component.ts @@ -7,10 +7,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { SubmissionEditComponent } from './submission-edit.component'; @Component({ - selector: 'ds-themed-submission-edit', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-submission-edit', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSubmissionEditComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/submission/form/collection/submission-form-collection.component.spec.ts b/src/app/submission/form/collection/submission-form-collection.component.spec.ts index d8d18aa770..540c2ba561 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.spec.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.spec.ts @@ -1,6 +1,21 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement, } from '@angular/core'; -import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + inject, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; @@ -14,23 +29,20 @@ import { CommunityDataService } from '../../../core/data/community-data.service' import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { Collection } from '../../../core/shared/collection.model'; -import { - SubmissionJsonPatchOperationsService -} from '../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; +import { ThemedCollectionDropdownComponent } from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock'; -import { mockSubmissionId, mockSubmissionRestResponse, } from '../../../shared/mocks/submission.mock'; -import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { - SubmissionJsonPatchOperationsServiceStub -} from '../../../shared/testing/submission-json-patch-operations-service.stub'; + mockSubmissionId, + mockSubmissionRestResponse, +} from '../../../shared/mocks/submission.mock'; +import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; +import { SubmissionJsonPatchOperationsServiceStub } from '../../../shared/testing/submission-json-patch-operations-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; import { SectionsService } from '../../sections/sections.service'; import { SubmissionService } from '../../submission.service'; import { SubmissionFormCollectionComponent } from './submission-form-collection.component'; -import { - ThemedCollectionDropdownComponent -} from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; describe('SubmissionFormCollectionComponent Component', () => { @@ -133,15 +145,15 @@ describe('SubmissionFormCollectionComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, NgbModule, TranslateModule.forRoot(), SubmissionFormCollectionComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CollectionDataService, useValue: collectionDataService }, { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, @@ -152,11 +164,11 @@ describe('SubmissionFormCollectionComponent Component', () => { { provide: SectionsService, useValue: sectionsService }, ChangeDetectorRef, SubmissionFormCollectionComponent, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) .overrideComponent(SubmissionFormCollectionComponent, { - remove: { imports: [ThemedCollectionDropdownComponent]} + remove: { imports: [ThemedCollectionDropdownComponent] }, }) .compileComponents(); })); @@ -299,12 +311,12 @@ describe('SubmissionFormCollectionComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [FormsModule, - ReactiveFormsModule, - NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + NgbModule], }) class TestComponent { diff --git a/src/app/submission/form/collection/submission-form-collection.component.ts b/src/app/submission/form/collection/submission-form-collection.component.ts index f5efad5431..ec978ba3b3 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -1,3 +1,4 @@ +import { CommonModule } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -9,8 +10,19 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { BehaviorSubject, Observable, of as observableOf, Subscription, } from 'rxjs'; -import { find, map, mergeMap, } from 'rxjs/operators'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + find, + map, + mergeMap, +} from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; @@ -20,20 +32,16 @@ import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/jso import { Collection } from '../../../core/shared/collection.model'; import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; import { SubmissionObject } from '../../../core/submission/models/submission-object.model'; -import { - SubmissionJsonPatchOperationsService -} from '../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; import { CollectionDropdownComponent } from '../../../shared/collection-dropdown/collection-dropdown.component'; -import { hasValue, isNotEmpty, } from '../../../shared/empty.util'; +import { ThemedCollectionDropdownComponent } from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; +import { + hasValue, + isNotEmpty, +} from '../../../shared/empty.util'; import { SectionsService } from '../../sections/sections.service'; import { SectionsType } from '../../sections/sections-type'; import { SubmissionService } from '../../submission.service'; -import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { - ThemedCollectionDropdownComponent -} from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; /** * This component allows to show the current collection the submission belonging to and to change it. @@ -47,8 +55,8 @@ import { CommonModule, TranslateModule, NgbDropdownModule, - ThemedCollectionDropdownComponent - ] + ThemedCollectionDropdownComponent, + ], }) export class SubmissionFormCollectionComponent implements OnChanges, OnInit { diff --git a/src/app/submission/form/footer/submission-form-footer.component.spec.ts b/src/app/submission/form/footer/submission-form-footer.component.spec.ts index 2158fee2d1..4c6d04c970 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.spec.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.spec.ts @@ -1,9 +1,26 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, SimpleChange, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + SimpleChange, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { NgbModal, NgbModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModule, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { cold, getTestScheduler, hot, } from 'jasmine-marbles'; +import { + cold, + getTestScheduler, + hot, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; @@ -29,21 +46,21 @@ describe('SubmissionFormFooterComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, TranslateModule.forRoot(), SubmissionFormFooterComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: SubmissionService, useValue: submissionServiceStub }, { provide: SubmissionRestService, useClass: SubmissionRestServiceStub }, ChangeDetectorRef, NgbModal, SubmissionFormFooterComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -243,10 +260,10 @@ describe('SubmissionFormFooterComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [NgbModule], }) class TestComponent { diff --git a/src/app/submission/form/footer/submission-form-footer.component.ts b/src/app/submission/form/footer/submission-form-footer.component.ts index 539a5de6a4..712a944a84 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.ts @@ -1,25 +1,33 @@ -import { Component, Input, OnChanges, SimpleChanges, } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { + Component, + Input, + OnChanges, + SimpleChanges, +} from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { Observable, of as observableOf, } from 'rxjs'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { SubmissionRestService } from '../../../core/submission/submission-rest.service'; import { SubmissionScopeType } from '../../../core/submission/submission-scope-type'; import { isNotEmpty } from '../../../shared/empty.util'; -import { CommonModule } from '@angular/common'; import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe'; -import { TranslateModule } from '@ngx-translate/core'; import { SubmissionService } from '../../submission.service'; /** * This component represents submission form footer bar. */ @Component({ - selector: 'ds-submission-form-footer', - styleUrls: ['./submission-form-footer.component.scss'], - templateUrl: './submission-form-footer.component.html', - standalone: true, - imports: [CommonModule, BrowserOnlyPipe, TranslateModule] + selector: 'ds-submission-form-footer', + styleUrls: ['./submission-form-footer.component.scss'], + templateUrl: './submission-form-footer.component.html', + standalone: true, + imports: [CommonModule, BrowserOnlyPipe, TranslateModule], }) export class SubmissionFormFooterComponent implements OnChanges { diff --git a/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts b/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts index 8744fda5bb..5aaf9203c0 100644 --- a/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts +++ b/src/app/submission/form/section-add/submission-form-section-add.component.spec.ts @@ -1,5 +1,17 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement, } from '@angular/core'; -import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, + DebugElement, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + inject, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; @@ -7,7 +19,10 @@ import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { HostWindowService } from '../../../shared/host-window.service'; -import { mockSubmissionCollectionId, mockSubmissionId, } from '../../../shared/mocks/submission.mock'; +import { + mockSubmissionCollectionId, + mockSubmissionId, +} from '../../../shared/mocks/submission.mock'; import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; @@ -56,22 +71,22 @@ describe('SubmissionFormSectionAddComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, TranslateModule.forRoot(), SubmissionFormSectionAddComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: HostWindowService, useValue: window }, { provide: SubmissionService, useValue: submissionServiceStub }, { provide: SectionsService, useClass: SectionsServiceStub }, { provide: Store, useValue: store }, ChangeDetectorRef, SubmissionFormSectionAddComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -204,10 +219,10 @@ describe('SubmissionFormSectionAddComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [NgbModule], }) class TestComponent { diff --git a/src/app/submission/form/section-add/submission-form-section-add.component.ts b/src/app/submission/form/section-add/submission-form-section-add.component.ts index 4351e59706..4cf10e55d8 100644 --- a/src/app/submission/form/section-add/submission-form-section-add.component.ts +++ b/src/app/submission/form/section-add/submission-form-section-add.component.ts @@ -1,12 +1,16 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { HostWindowService } from '../../../shared/host-window.service'; import { SectionDataObject } from '../../sections/models/section-data.model'; -import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { SectionsService } from '../../sections/sections.service'; import { SubmissionService } from '../../submission.service'; @@ -18,7 +22,7 @@ import { SubmissionService } from '../../submission.service'; styleUrls: ['./submission-form-section-add.component.scss'], templateUrl: './submission-form-section-add.component.html', standalone: true, - imports: [CommonModule, TranslateModule, NgbDropdownModule,] + imports: [CommonModule, TranslateModule, NgbDropdownModule], }) export class SubmissionFormSectionAddComponent implements OnInit { diff --git a/src/app/submission/form/submission-form.component.spec.ts b/src/app/submission/form/submission-form.component.spec.ts index 3242892e6b..58e3dd5c05 100644 --- a/src/app/submission/form/submission-form.component.spec.ts +++ b/src/app/submission/form/submission-form.component.spec.ts @@ -1,12 +1,26 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA, SimpleChange, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { cold, getTestScheduler, } from 'jasmine-marbles'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, + SimpleChange, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + cold, + getTestScheduler, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../../core/auth/auth.service'; import { HALEndpointService } from '../../core/shared/hal-endpoint.service'; import { Item } from '../../core/shared/item.model'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { mockSectionsData, mockSectionsList, @@ -17,22 +31,21 @@ import { mockSubmissionSelfUrl, mockSubmissionState, } from '../../shared/mocks/submission.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; import { AuthServiceStub } from '../../shared/testing/auth-service.stub'; import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service.stub'; import { SubmissionServiceStub } from '../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../shared/testing/utils.test'; +import { ThemeService } from '../../shared/theme-support/theme.service'; +import { SubmissionSectionContainerComponent } from '../sections/container/section-container.component'; import { SectionsService } from '../sections/sections.service'; import { VisibilityType } from '../sections/visibility-type'; -import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { SubmissionSectionContainerComponent } from '../sections/container/section-container.component'; -import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component'; -import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component'; -import { SubmissionFormCollectionComponent } from './collection/submission-form-collection.component'; -import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component'; import { SubmissionService } from '../submission.service'; +import { SubmissionFormCollectionComponent } from './collection/submission-form-collection.component'; +import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component'; +import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component'; import { SubmissionFormComponent } from './submission-form.component'; +import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component'; describe('SubmissionFormComponent Component', () => { @@ -54,9 +67,9 @@ describe('SubmissionFormComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [SubmissionFormComponent, TestComponent, + imports: [SubmissionFormComponent, TestComponent, ], - providers: [ + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: SubmissionService, useValue: submissionServiceStub }, @@ -64,9 +77,9 @@ describe('SubmissionFormComponent Component', () => { { provide: ThemeService, useValue: getMockThemeService() }, ChangeDetectorRef, SubmissionFormComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(SubmissionFormComponent, { remove: { imports: [ @@ -75,8 +88,8 @@ describe('SubmissionFormComponent Component', () => { SubmissionFormFooterComponent, SubmissionUploadFilesComponent, SubmissionFormCollectionComponent, - SubmissionFormSectionAddComponent - ]} + SubmissionFormSectionAddComponent, + ] }, }) .compileComponents(); })); @@ -262,9 +275,9 @@ describe('SubmissionFormComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/submission/form/submission-form.component.ts b/src/app/submission/form/submission-form.component.ts index 7b11d16473..d81435cef6 100644 --- a/src/app/submission/form/submission-form.component.ts +++ b/src/app/submission/form/submission-form.component.ts @@ -1,3 +1,4 @@ +import { CommonModule } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -31,9 +32,11 @@ import { isNotEmpty, isNotUndefined, } from '../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { UploaderOptions } from '../../shared/upload/uploader/uploader-options.model'; import { SubmissionError } from '../objects/submission-error.model'; import { SubmissionObjectEntry } from '../objects/submission-objects.reducer'; +import { SubmissionSectionContainerComponent } from '../sections/container/section-container.component'; import { SectionDataObject } from '../sections/models/section-data.model'; import { SectionsService } from '../sections/sections.service'; import { SectionsType } from '../sections/sections-type'; @@ -43,13 +46,10 @@ import { SubmissionSectionModel, SubmissionSectionVisibility, } from './../../core/config/models/config-submission-section.model'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { SubmissionSectionContainerComponent } from '../sections/container/section-container.component'; -import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component'; -import { CommonModule } from '@angular/common'; -import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component'; import { SubmissionFormCollectionComponent } from './collection/submission-form-collection.component'; +import { SubmissionFormFooterComponent } from './footer/submission-form-footer.component'; import { SubmissionFormSectionAddComponent } from './section-add/submission-form-section-add.component'; +import { SubmissionUploadFilesComponent } from './submission-upload-files/submission-upload-files.component'; /** * This component represents the submission form. @@ -65,9 +65,9 @@ import { SubmissionFormSectionAddComponent } from './section-add/submission-form SubmissionFormFooterComponent, SubmissionUploadFilesComponent, SubmissionFormCollectionComponent, - SubmissionFormSectionAddComponent + SubmissionFormSectionAddComponent, ], - standalone: true + standalone: true, }) export class SubmissionFormComponent implements OnChanges, OnDestroy { diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts index 27614da9bc..72ae72b846 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts @@ -1,13 +1,26 @@ -import { ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + CUSTOM_ELEMENTS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { Store } from '@ngrx/store'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { cold, hot, } from 'jasmine-marbles'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + cold, + hot, +} from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; -import { - SubmissionJsonPatchOperationsService -} from '../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; import { mockSectionsData, mockSubmissionCollectionId, @@ -21,9 +34,7 @@ import { getMockTranslateService } from '../../../shared/mocks/translate.service import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; -import { - SubmissionJsonPatchOperationsServiceStub -} from '../../../shared/testing/submission-json-patch-operations-service.stub'; +import { SubmissionJsonPatchOperationsServiceStub } from '../../../shared/testing/submission-json-patch-operations-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; import { UploaderOptions } from '../../../shared/upload/uploader/uploader-options.model'; @@ -53,12 +64,12 @@ describe('SubmissionUploadFilesComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SubmissionUploadFilesComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: SectionsService, useClass: SectionsServiceStub }, @@ -67,9 +78,9 @@ describe('SubmissionUploadFilesComponent Component', () => { { provide: Store, useValue: store }, ChangeDetectorRef, SubmissionUploadFilesComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); describe('', () => { @@ -201,9 +212,9 @@ describe('SubmissionUploadFilesComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts index e83884720f..3a5fd306fd 100644 --- a/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts +++ b/src/app/submission/form/submission-upload-files/submission-upload-files.component.ts @@ -1,20 +1,33 @@ -import { Component, Input, OnChanges, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Input, + OnChanges, +} from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; -import { first, take, } from 'rxjs/operators'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + first, + take, +} from 'rxjs/operators'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; -import { - SubmissionJsonPatchOperationsService -} from '../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; import { normalizeSectionData } from '../../../core/submission/submission-response-parsing.service'; -import { hasValue, isEmpty, isNotEmpty, } from '../../../shared/empty.util'; +import { + hasValue, + isEmpty, + isNotEmpty, +} from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { UploaderComponent } from '../../../shared/upload/uploader/uploader.component'; import { UploaderOptions } from '../../../shared/upload/uploader/uploader-options.model'; import { SectionsService } from '../../sections/sections.service'; import { SectionsType } from '../../sections/sections-type'; -import { UploaderComponent } from '../../../shared/upload/uploader/uploader.component'; -import { NgIf } from '@angular/common'; import { SubmissionService } from '../../submission.service'; import parseSectionErrors from '../../utils/parseSectionErrors'; @@ -26,9 +39,9 @@ import parseSectionErrors from '../../utils/parseSectionErrors'; templateUrl: './submission-upload-files.component.html', imports: [ UploaderComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class SubmissionUploadFilesComponent implements OnChanges { diff --git a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.spec.ts b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.spec.ts index 166eac3eb3..8653060489 100644 --- a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.spec.ts +++ b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.spec.ts @@ -1,14 +1,22 @@ -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { CollectionListEntry } from '../../../shared/collection-dropdown/collection-dropdown.component'; -import { createTestComponent } from '../../../shared/testing/utils.test'; -import { SubmissionImportExternalCollectionComponent } from './submission-import-external-collection.component'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; +import { createTestComponent } from '../../../shared/testing/utils.test'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; +import { SubmissionImportExternalCollectionComponent } from './submission-import-external-collection.component'; describe('SubmissionImportExternalCollectionComponent test suite', () => { let comp: SubmissionImportExternalCollectionComponent; @@ -21,12 +29,12 @@ describe('SubmissionImportExternalCollectionComponent test suite', () => { imports: [ TranslateModule.forRoot(), SubmissionImportExternalCollectionComponent, - TestComponent + TestComponent, ], providers: [ NgbActiveModal, SubmissionImportExternalCollectionComponent, - {provide: ThemeService, useValue: themeService}, + { provide: ThemeService, useValue: themeService }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents().then(); @@ -136,9 +144,9 @@ describe('SubmissionImportExternalCollectionComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts index 3c58f5c7f8..03bd10cfc2 100644 --- a/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts +++ b/src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts @@ -1,17 +1,18 @@ +import { + NgClass, + NgIf, +} from '@angular/common'; import { Component, EventEmitter, Output, } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { - ThemedCollectionDropdownComponent -} from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; import { TranslateModule } from '@ngx-translate/core'; -import { NgClass, NgIf } from '@angular/common'; import { CollectionListEntry } from '../../../shared/collection-dropdown/collection-dropdown.component'; +import { ThemedCollectionDropdownComponent } from '../../../shared/collection-dropdown/themed-collection-dropdown.component'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; /** * Wrap component for 'ds-collection-dropdown'. @@ -25,9 +26,9 @@ import { CollectionListEntry } from '../../../shared/collection-dropdown/collect ThemedCollectionDropdownComponent, TranslateModule, NgClass, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class SubmissionImportExternalCollectionComponent { /** diff --git a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts index af70280add..f53a5d812c 100644 --- a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts +++ b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts @@ -57,21 +57,21 @@ describe('SubmissionImportExternalPreviewComponent test suite', () => { beforeEach(waitForAsync(() => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SubmissionImportExternalPreviewComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: Router, useValue: new RouterStub() }, { provide: SubmissionService, useValue: new SubmissionServiceStub() }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: NgbModal, useValue: ngbModal }, { provide: NgbActiveModal, useValue: ngbActiveModal }, SubmissionImportExternalPreviewComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); // First test to check the correct component creation @@ -169,9 +169,9 @@ describe('SubmissionImportExternalPreviewComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts index b2c00b5544..f38446fc06 100644 --- a/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts +++ b/src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts @@ -9,6 +9,7 @@ import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { mergeMap } from 'rxjs/operators'; import { ExternalSourceEntry } from '../../../core/shared/external-source-entry.model'; @@ -19,7 +20,6 @@ import { CollectionListEntry } from '../../../shared/collection-dropdown/collect import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { SubmissionService } from '../../submission.service'; import { SubmissionImportExternalCollectionComponent } from '../import-external-collection/submission-import-external-collection.component'; -import { TranslateModule } from '@ngx-translate/core'; /** * This component display a preview of an external source item. @@ -29,9 +29,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./submission-import-external-preview.component.scss'], templateUrl: './submission-import-external-preview.component.html', imports: [ - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class SubmissionImportExternalPreviewComponent implements OnInit { /** diff --git a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts index 87dd9519f5..9005dc1589 100644 --- a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts +++ b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts @@ -53,19 +53,19 @@ describe('SubmissionImportExternalSearchbarComponent test suite', () => { beforeEach(waitForAsync(() => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SubmissionImportExternalSearchbarComponent, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: ExternalSourceDataService, useValue: mockExternalSourceService }, ChangeDetectorRef, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, SubmissionImportExternalSearchbarComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); // First test to check the correct component creation @@ -180,9 +180,9 @@ describe('SubmissionImportExternalSearchbarComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { initExternalSourceData = { entity: 'Publication', query: 'dummy', sourceId: 'ciencia' }; diff --git a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts index 61292c7ce0..aace4de79a 100644 --- a/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts +++ b/src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts @@ -1,3 +1,4 @@ +import { CommonModule } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -7,6 +8,10 @@ import { OnInit, Output, } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; import { Observable, of as observableOf, @@ -34,11 +39,6 @@ import { PageInfo } from '../../../core/shared/page-info.model'; import { hasValue } from '../../../shared/empty.util'; import { HostWindowService } from '../../../shared/host-window.service'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; -import { TranslateModule } from '@ngx-translate/core'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { FormsModule } from '@angular/forms'; -import { CommonModule } from '@angular/common'; /** * Interface for the selected external source element. @@ -69,9 +69,9 @@ export interface ExternalSourceData { TranslateModule, InfiniteScrollModule, NgbDropdownModule, - FormsModule + FormsModule, ], - standalone: true + standalone: true, }) export class SubmissionImportExternalSearchbarComponent implements OnInit, OnDestroy { /** diff --git a/src/app/submission/import-external/submission-import-external.component.spec.ts b/src/app/submission/import-external/submission-import-external.component.spec.ts index 1628f79f5e..0364040c51 100644 --- a/src/app/submission/import-external/submission-import-external.component.spec.ts +++ b/src/app/submission/import-external/submission-import-external.component.spec.ts @@ -1,8 +1,19 @@ -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { getTestScheduler } from 'jasmine-marbles'; @@ -13,7 +24,12 @@ import { ExternalSourceDataService } from '../../core/data/external-source-data. import { RouteService } from '../../core/services/route.service'; import { ExternalSourceEntry } from '../../core/shared/external-source-entry.model'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { AlertComponent } from '../../shared/alert/alert.component'; +import { HostWindowService } from '../../shared/host-window.service'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; import { getMockExternalSourceService } from '../../shared/mocks/external-source.service.mock'; +import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; +import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { createFailedRemoteDataObject$, @@ -21,25 +37,19 @@ import { createSuccessfulRemoteDataObject$, } from '../../shared/remote-data.utils'; import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model'; +import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; +import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub'; import { routeServiceStub } from '../../shared/testing/route-service.stub'; import { RouterStub } from '../../shared/testing/router.stub'; -import { createPaginatedList, createTestComponent, } from '../../shared/testing/utils.test'; -import { VarDirective } from '../../shared/utils/var.directive'; import { - SubmissionImportExternalPreviewComponent -} from './import-external-preview/submission-import-external-preview.component'; -import { SubmissionImportExternalComponent } from './submission-import-external.component'; -import { HostWindowService } from '../../shared/host-window.service'; -import { HostWindowServiceStub } from '../../shared/testing/host-window-service.stub'; -import { ActivatedRouteStub } from '../../shared/testing/active-router.stub'; -import { - SubmissionImportExternalSearchbarComponent -} from './import-external-searchbar/submission-import-external-searchbar.component'; + createPaginatedList, + createTestComponent, +} from '../../shared/testing/utils.test'; import { ThemeService } from '../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../shared/mocks/theme-service.mock'; -import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { SubmissionImportExternalPreviewComponent } from './import-external-preview/submission-import-external-preview.component'; +import { SubmissionImportExternalSearchbarComponent } from './import-external-searchbar/submission-import-external-searchbar.component'; +import { SubmissionImportExternalComponent } from './submission-import-external.component'; describe('SubmissionImportExternalComponent test suite', () => { let comp: SubmissionImportExternalComponent; @@ -61,14 +71,14 @@ describe('SubmissionImportExternalComponent test suite', () => { beforeEach(waitForAsync (() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), BrowserAnimationsModule, SubmissionImportExternalComponent, TestComponent, VarDirective, - ], - providers: [ + ], + providers: [ { provide: ExternalSourceDataService, useValue: mockExternalSourceService }, { provide: SearchConfigurationService, useValue: searchConfigServiceStub }, { provide: RouteService, useValue: routeServiceStub }, @@ -78,9 +88,9 @@ describe('SubmissionImportExternalComponent test suite', () => { { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, { provide: ThemeService, useValue: getMockThemeService() }, SubmissionImportExternalComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(SubmissionImportExternalComponent, { remove: { imports: [ @@ -88,8 +98,8 @@ describe('SubmissionImportExternalComponent test suite', () => { ThemedLoadingComponent, AlertComponent, SubmissionImportExternalSearchbarComponent, - ] - } + ], + }, }) .compileComponents().then(); })); @@ -532,9 +542,9 @@ describe('SubmissionImportExternalComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true + selector: 'ds-test-cmp', + template: ``, + standalone: true, }) class TestComponent { diff --git a/src/app/submission/import-external/submission-import-external.component.ts b/src/app/submission/import-external/submission-import-external.component.ts index fab5975ed8..ee7e2c82ce 100644 --- a/src/app/submission/import-external/submission-import-external.component.ts +++ b/src/app/submission/import-external/submission-import-external.component.ts @@ -1,16 +1,40 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { Router, RouterLink } from '@angular/router'; -import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { BehaviorSubject, combineLatest, Subscription, } from 'rxjs'; -import { filter, mergeMap, switchMap, take, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, + Subscription, +} from 'rxjs'; +import { + filter, + mergeMap, + switchMap, + take, + tap, +} from 'rxjs/operators'; import { AlertType } from 'src/app/shared/alert/alert-type'; import { ExternalSourceDataService } from '../../core/data/external-source-data.service'; import { - ExternalSourceData, - SubmissionImportExternalSearchbarComponent -} from './import-external-searchbar/submission-import-external-searchbar.component'; -import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model'; + buildPaginatedList, + PaginatedList, +} from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { RouteService } from '../../core/services/route.service'; import { Context } from '../../core/shared/context.model'; @@ -19,19 +43,22 @@ import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type import { getFinishedRemoteData } from '../../core/shared/operators'; import { PageInfo } from '../../core/shared/page-info.model'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; +import { AlertComponent } from '../../shared/alert/alert.component'; import { fadeIn } from '../../shared/animations/fade'; -import { hasValue, isNotEmpty, } from '../../shared/empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; -import { - SubmissionImportExternalPreviewComponent -} from './import-external-preview/submission-import-external-preview.component'; -import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; -import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; -import { AlertComponent } from '../../shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { VarDirective } from '../../shared/utils/var.directive'; +import { SubmissionImportExternalPreviewComponent } from './import-external-preview/submission-import-external-preview.component'; +import { + ExternalSourceData, + SubmissionImportExternalSearchbarComponent, +} from './import-external-searchbar/submission-import-external-searchbar.component'; /** * This component allows to submit a new workspaceitem importing the data from an external source. @@ -50,9 +77,9 @@ import { VarDirective } from '../../shared/utils/var.directive'; SubmissionImportExternalSearchbarComponent, TranslateModule, VarDirective, - RouterLink + RouterLink, ], - standalone: true + standalone: true, }) export class SubmissionImportExternalComponent implements OnInit, OnDestroy { diff --git a/src/app/submission/import-external/themed-submission-import-external.component.ts b/src/app/submission/import-external/themed-submission-import-external.component.ts index 630d80c156..b130325c8f 100644 --- a/src/app/submission/import-external/themed-submission-import-external.component.ts +++ b/src/app/submission/import-external/themed-submission-import-external.component.ts @@ -7,10 +7,10 @@ import { SubmissionImportExternalComponent } from './submission-import-external. * Themed wrapper for SubmissionImportExternalComponent */ @Component({ - selector: 'ds-themed-submission-import-external', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-submission-import-external', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSubmissionImportExternalComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/submission/provide-submission.ts b/src/app/submission/provide-submission.ts index f7e74b05b4..235bb416d2 100644 --- a/src/app/submission/provide-submission.ts +++ b/src/app/submission/provide-submission.ts @@ -1,9 +1,20 @@ -import { importProvidersFrom, makeEnvironmentProviders } from '@angular/core'; +import { + importProvidersFrom, + makeEnvironmentProviders, +} from '@angular/core'; import { EffectsModule } from '@ngrx/effects'; -import { submissionEffects } from './submission.effects'; -import { submissionReducers, SubmissionState } from './submission.reducers'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; + import { storeModuleConfig } from '../app.reducer'; +import { submissionEffects } from './submission.effects'; +import { + submissionReducers, + SubmissionState, +} from './submission.reducers'; export const provideSubmission = () => { return makeEnvironmentProviders([ diff --git a/src/app/submission/sections/accesses/section-accesses.component.ts b/src/app/submission/sections/accesses/section-accesses.component.ts index 5744d7a00e..b47f1cf8ff 100644 --- a/src/app/submission/sections/accesses/section-accesses.component.ts +++ b/src/app/submission/sections/accesses/section-accesses.component.ts @@ -1,12 +1,10 @@ -import { Component, Inject, ViewChild, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + Component, + Inject, + ViewChild, +} from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; - -import { filter, map, mergeMap, take } from 'rxjs/operators'; -import { combineLatest, Observable, of, Subscription } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; -import { SectionDataObject } from '../models/section-data.model'; -import { SectionsService } from '../sections.service'; -import { SectionModelComponent } from '../models/section.model'; import { DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX, DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER, @@ -22,24 +20,40 @@ import { } from '@ng-dynamic-forms/core'; import { DynamicDateControlValue } from '@ng-dynamic-forms/core/lib/model/dynamic-date-control.model'; import { DynamicFormControlCondition } from '@ng-dynamic-forms/core/lib/model/misc/dynamic-form-control-relation.model'; +import { TranslateService } from '@ngx-translate/core'; +import { + combineLatest, + Observable, + of, + Subscription, +} from 'rxjs'; +import { + filter, + map, + mergeMap, + take, +} from 'rxjs/operators'; import { AccessesConditionOption } from '../../../core/config/models/config-accesses-conditions-options.model'; import { SubmissionAccessesConfigDataService } from '../../../core/config/submission-accesses-config-data.service'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; -import { - WorkspaceitemSectionAccessesObject -} from '../../../core/submission/models/workspaceitem-section-accesses.model'; -import { - SubmissionJsonPatchOperationsService -} from '../../../core/submission/submission-json-patch-operations.service'; +import { WorkspaceitemSectionAccessesObject } from '../../../core/submission/models/workspaceitem-section-accesses.model'; +import { SubmissionJsonPatchOperationsService } from '../../../core/submission/submission-json-patch-operations.service'; import { dateToISOFormat } from '../../../shared/date.util'; -import { hasValue, isNotEmpty, isNotNull, } from '../../../shared/empty.util'; +import { + hasValue, + isNotEmpty, + isNotNull, +} from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormComponent } from '../../../shared/form/form.component'; import { FormService } from '../../../shared/form/form.service'; import { SectionFormOperationsService } from '../form/section-form-operations.service'; +import { SectionModelComponent } from '../models/section.model'; +import { SectionDataObject } from '../models/section-data.model'; +import { SectionsService } from '../sections.service'; import { ACCESS_CONDITION_GROUP_CONFIG, ACCESS_CONDITION_GROUP_LAYOUT, @@ -54,7 +68,6 @@ import { FORM_ACCESS_CONDITION_TYPE_CONFIG, FORM_ACCESS_CONDITION_TYPE_LAYOUT, } from './section-accesses.model'; -import { NgIf } from '@angular/common'; import { SectionAccessesService } from './section-accesses.service'; /** @@ -66,9 +79,9 @@ import { SectionAccessesService } from './section-accesses.service'; styleUrls: ['./section-accesses.component.scss'], imports: [ FormComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class SubmissionSectionAccessesComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/accesses/section-accesses.service.ts b/src/app/submission/sections/accesses/section-accesses.service.ts index b73e2e2fd3..4fa3a632d6 100644 --- a/src/app/submission/sections/accesses/section-accesses.service.ts +++ b/src/app/submission/sections/accesses/section-accesses.service.ts @@ -14,7 +14,7 @@ import { SubmissionState } from '../../submission.reducers'; /** * A service that provides methods to handle submission item's accesses condition state. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SectionAccessesService { /** diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts index 13b1fd37a6..7b540ecd91 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts @@ -1,12 +1,14 @@ import { DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { SectionsService } from '../sections.service'; -import { SectionDataObject } from '../models/section-data.model'; -import { SectionsType } from '../sections-type'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; +import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; @@ -15,11 +17,13 @@ import { SUBMISSION_CC_LICENSE } from '../../../core/submission/models/submissio import { SubmissionCcLicence } from '../../../core/submission/models/submission-cc-license.model'; import { SubmissionCcLicenseDataService } from '../../../core/submission/submission-cc-license-data.service'; import { SubmissionCcLicenseUrlDataService } from '../../../core/submission/submission-cc-license-url-data.service'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { createPaginatedList } from '../../../shared/testing/utils.test'; +import { SectionDataObject } from '../models/section-data.model'; +import { SectionsService } from '../sections.service'; +import { SectionsType } from '../sections-type'; import { SubmissionSectionCcLicensesComponent } from './submission-section-cc-licenses.component'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service'; describe('SubmissionSectionCcLicensesComponent', () => { @@ -170,11 +174,11 @@ describe('SubmissionSectionCcLicensesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - SubmissionSectionCcLicensesComponent - ], - providers: [ + SubmissionSectionCcLicensesComponent, + ], + providers: [ { provide: SubmissionCcLicenseDataService, useValue: submissionCcLicensesDataService }, { provide: SubmissionCcLicenseUrlDataService, useValue: submissionCcLicenseUrlDataService }, { provide: SectionsService, useValue: sectionService }, @@ -184,15 +188,15 @@ describe('SubmissionSectionCcLicensesComponent', () => { { provide: 'sectionDataProvider', useValue: Object.assign({}, sectionObject) }, { provide: 'submissionIdProvider', useValue: 'test submission id' }, { provide: FormBuilderService, useValue: {} }, - ] -}) -.overrideComponent(SubmissionSectionCcLicensesComponent, { - remove: { - imports:[ - ThemedLoadingComponent, - ] - } -}) + ], + }) + .overrideComponent(SubmissionSectionCcLicensesComponent, { + remove: { + imports:[ + ThemedLoadingComponent, + ], + }, + }) .compileComponents(); })); diff --git a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts index 4a3a6ef5a2..d286a830e2 100644 --- a/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts +++ b/src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts @@ -1,7 +1,28 @@ -import { Component, Inject, } from '@angular/core'; -import { NgbModal, NgbModalRef, } from '@ng-bootstrap/ng-bootstrap'; -import { Observable, of as observableOf, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, map, take, } from 'rxjs/operators'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, +} from '@angular/core'; +import { + NgbModal, + NgbModalRef, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + map, + take, +} from 'rxjs/operators'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; @@ -11,22 +32,22 @@ import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; -import { Field, Option, SubmissionCcLicence, } from '../../../core/submission/models/submission-cc-license.model'; import { - WorkspaceitemSectionCcLicenseObject -} from '../../../core/submission/models/workspaceitem-section-cc-license.model'; + Field, + Option, + SubmissionCcLicence, +} from '../../../core/submission/models/submission-cc-license.model'; +import { WorkspaceitemSectionCcLicenseObject } from '../../../core/submission/models/workspaceitem-section-cc-license.model'; import { SubmissionCcLicenseDataService } from '../../../core/submission/submission-cc-license-data.service'; -import { SectionsType } from '../sections-type'; import { SubmissionCcLicenseUrlDataService } from '../../../core/submission/submission-cc-license-url-data.service'; +import { DsSelectComponent } from '../../../shared/ds-select/ds-select.component'; import { isNotEmpty } from '../../../shared/empty.util'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; -import { DsSelectComponent } from '../../../shared/ds-select/ds-select.component'; +import { SectionsType } from '../sections-type'; /** * This component represents the submission section to select the Creative Commons license. @@ -42,9 +63,9 @@ import { DsSelectComponent } from '../../../shared/ds-select/ds-select.component AsyncPipe, VarDirective, NgForOf, - DsSelectComponent + DsSelectComponent, ], - standalone: true + standalone: true, }) export class SubmissionSectionCcLicensesComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/container/section-container.component.spec.ts b/src/app/submission/sections/container/section-container.component.spec.ts index 6ebf7d43ec..4dfa65a13b 100644 --- a/src/app/submission/sections/container/section-container.component.spec.ts +++ b/src/app/submission/sections/container/section-container.component.spec.ts @@ -1,12 +1,23 @@ // Load the implementations that should be tested -import { Component, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + Component, + CUSTOM_ELEMENTS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; -import { mockSubmissionCollectionId, mockSubmissionId, } from '../../../shared/mocks/submission.mock'; +import { + mockSubmissionCollectionId, + mockSubmissionId, +} from '../../../shared/mocks/submission.mock'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; @@ -65,20 +76,20 @@ describe('SubmissionSectionContainerComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, TranslateModule.forRoot(), SubmissionSectionContainerComponent, SectionsDirective, - TestComponent - ], - providers: [ + TestComponent, + ], + providers: [ { provide: SectionsService, useValue: sectionsServiceStub }, { provide: SubmissionService, useValue: submissionServiceStub }, SubmissionSectionContainerComponent, - ], + ], schemas: [CUSTOM_ELEMENTS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); @@ -221,11 +232,11 @@ describe('SubmissionSectionContainerComponent test suite', () => { // declare a test component @Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: '', - template: ``, - standalone: true, - imports: [NgbModule] + // eslint-disable-next-line @angular-eslint/component-selector + selector: '', + template: ``, + standalone: true, + imports: [NgbModule], }) class TestComponent { diff --git a/src/app/submission/sections/container/section-container.component.ts b/src/app/submission/sections/container/section-container.component.ts index 2c2a8df260..6f4126a173 100644 --- a/src/app/submission/sections/container/section-container.component.ts +++ b/src/app/submission/sections/container/section-container.component.ts @@ -1,13 +1,25 @@ -import { Component, Injector, Input, OnInit, ViewChild, } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Injector, + Input, + OnInit, + ViewChild, +} from '@angular/core'; +import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsDirective } from '../sections.directive'; import { rendersSectionType } from '../sections-decorator'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgForOf, NgIf } from '@angular/common'; -import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule } from '@ngx-translate/core'; /** * This component represents a section that contains the submission license form. @@ -25,9 +37,9 @@ import { TranslateModule } from '@ngx-translate/core'; NgClass, NgIf, AsyncPipe, - SectionsDirective + SectionsDirective, ], - standalone: true + standalone: true, }) export class SubmissionSectionContainerComponent implements OnInit { diff --git a/src/app/submission/sections/form/section-form-operations.service.spec.ts b/src/app/submission/sections/form/section-form-operations.service.spec.ts index f2e0c7b31c..cd169a76ac 100644 --- a/src/app/submission/sections/form/section-form-operations.service.spec.ts +++ b/src/app/submission/sections/form/section-form-operations.service.spec.ts @@ -13,6 +13,7 @@ import { TranslateModule, } from '@ngx-translate/core'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model'; @@ -35,7 +36,6 @@ import { } from '../../../shared/mocks/form-models.mock'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { SectionFormOperationsService } from './section-form-operations.service'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; describe('SectionFormOperationsService test suite', () => { let formBuilderService: any; diff --git a/src/app/submission/sections/form/section-form-operations.service.ts b/src/app/submission/sections/form/section-form-operations.service.ts index 3ffda99beb..808591bdb3 100644 --- a/src/app/submission/sections/form/section-form-operations.service.ts +++ b/src/app/submission/sections/form/section-form-operations.service.ts @@ -39,7 +39,7 @@ import { FormFieldPreviousValueObject } from '../../../shared/form/builder/model /** * The service handling all form section operations */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SectionFormOperationsService { /** diff --git a/src/app/submission/sections/form/section-form.component.spec.ts b/src/app/submission/sections/form/section-form.component.spec.ts index a87bde56fd..da5a620d1a 100644 --- a/src/app/submission/sections/form/section-form.component.spec.ts +++ b/src/app/submission/sections/form/section-form.component.spec.ts @@ -1,9 +1,27 @@ import { CommonModule } from '@angular/common'; -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { DynamicFormControlEvent, DynamicFormControlEventType, } from '@ng-dynamic-forms/core'; -import { TranslateModule, TranslateService, } from '@ngx-translate/core'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + DynamicFormControlEvent, + DynamicFormControlEventType, +} from '@ng-dynamic-forms/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; @@ -16,9 +34,7 @@ import { WorkflowItem } from '../../../core/submission/models/workflowitem.model import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { SubmissionObjectDataService } from '../../../core/submission/submission-object-data.service'; import { DsDynamicInputModel } from '../../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-input.model'; -import { - DynamicRowGroupModel -} from '../../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; +import { DynamicRowGroupModel } from '../../../shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormFieldModel } from '../../../shared/form/builder/models/form-field.model'; import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model'; @@ -32,6 +48,7 @@ import { mockSubmissionId, mockUploadResponse1ParsedErrors, } from '../../../shared/mocks/submission.mock'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; @@ -39,6 +56,7 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications- import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; import { SubmissionSectionError } from '../../objects/submission-section-error.model'; import { SubmissionService } from '../../submission.service'; import { SectionDataObject } from '../models/section-data.model'; @@ -46,8 +64,6 @@ import { SectionsService } from '../sections.service'; import { SectionsType } from '../sections-type'; import { SubmissionSectionFormComponent } from './section-form.component'; import { SectionFormOperationsService } from './section-form-operations.service'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; function getMockSubmissionFormsConfigService(): SubmissionFormsConfigDataService { return jasmine.createSpyObj('FormOperationsService', { @@ -162,7 +178,7 @@ describe('SubmissionSectionFormComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, ReactiveFormsModule, @@ -170,8 +186,8 @@ describe('SubmissionSectionFormComponent test suite', () => { FormComponent, SubmissionSectionFormComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: FormBuilderService, useValue: getMockFormBuilderService() }, { provide: SectionFormOperationsService, useValue: getMockFormOperationsService() }, { provide: FormService, useValue: formService }, @@ -191,9 +207,9 @@ describe('SubmissionSectionFormComponent test suite', () => { { provide: SubmissionObjectDataService, useValue: { getHrefByID: () => observableOf('testUrl'), findById: () => createSuccessfulRemoteDataObject$(new WorkspaceItem()) } }, ChangeDetectorRef, SubmissionSectionFormComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); describe('', () => { @@ -635,9 +651,9 @@ describe('SubmissionSectionFormComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [CommonModule, FormsModule, ReactiveFormsModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [CommonModule, FormsModule, ReactiveFormsModule], }) class TestComponent {} diff --git a/src/app/submission/sections/form/section-form.component.ts b/src/app/submission/sections/form/section-form.component.ts index 3fcee58eff..4173ad1a0b 100644 --- a/src/app/submission/sections/form/section-form.component.ts +++ b/src/app/submission/sections/form/section-form.component.ts @@ -1,10 +1,31 @@ -import { ChangeDetectorRef, Component, Inject, ViewChild, } from '@angular/core'; -import { DynamicFormControlEvent, DynamicFormControlModel, } from '@ng-dynamic-forms/core'; +import { NgIf } from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Inject, + ViewChild, +} from '@angular/core'; +import { + DynamicFormControlEvent, + DynamicFormControlModel, +} from '@ng-dynamic-forms/core'; import { TranslateService } from '@ngx-translate/core'; import findIndex from 'lodash/findIndex'; import isEqual from 'lodash/isEqual'; -import { combineLatest as observableCombineLatest, Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, find, map, mergeMap, take, tap, } from 'rxjs/operators'; +import { + combineLatest as observableCombineLatest, + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + find, + map, + mergeMap, + take, + tap, +} from 'rxjs/operators'; import { environment } from '../../../../environments/environment'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; @@ -15,18 +36,27 @@ import { SubmissionFormsConfigDataService } from '../../../core/config/submissio import { RemoteData } from '../../../core/data/remote-data'; import { RequestService } from '../../../core/data/request.service'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; -import { getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; +import { + getFirstSucceededRemoteData, + getRemoteDataPayload, +} from '../../../core/shared/operators'; import { SubmissionObject } from '../../../core/submission/models/submission-object.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { WorkspaceitemSectionFormObject } from '../../../core/submission/models/workspaceitem-section-form.model'; import { SubmissionObjectDataService } from '../../../core/submission/submission-object-data.service'; import { SubmissionScopeType } from '../../../core/submission/submission-scope-type'; -import { hasValue, isEmpty, isNotEmpty, isUndefined, } from '../../../shared/empty.util'; +import { + hasValue, + isEmpty, + isNotEmpty, + isUndefined, +} from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormFieldPreviousValueObject } from '../../../shared/form/builder/models/form-field-previous-value-object'; import { FormComponent } from '../../../shared/form/form.component'; import { FormService } from '../../../shared/form/form.service'; +import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { difference } from '../../../shared/object.util'; import { followLink } from '../../../shared/utils/follow-link-config.model'; @@ -37,8 +67,6 @@ import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; import { SectionFormOperationsService } from './section-form-operations.service'; -import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component'; -import { NgIf } from '@angular/common'; /** * This component represents a section that contains a Form. @@ -50,9 +78,9 @@ import { NgIf } from '@angular/common'; imports: [ FormComponent, ThemedLoadingComponent, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class SubmissionSectionFormComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts b/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts index 3403e65104..8aa760bb3e 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.spec.ts @@ -1,7 +1,19 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; @@ -10,27 +22,28 @@ import { of as observableOf } from 'rxjs'; import { SubmissionFormsConfigDataService } from '../../../core/config/submission-forms-config-data.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; +import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { PaginationService } from '../../../core/pagination/pagination.service'; import { Collection } from '../../../core/shared/collection.model'; +import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; import { Item } from '../../../core/shared/item.model'; import { License } from '../../../core/shared/license.model'; -import { - WorkspaceitemSectionIdentifiersObject -} from '../../../core/submission/models/workspaceitem-section-identifiers.model'; +import { WorkspaceitemSectionIdentifiersObject } from '../../../core/submission/models/workspaceitem-section-identifiers.model'; import { SubmissionScopeType } from '../../../core/submission/submission-scope-type'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormService } from '../../../shared/form/form.service'; import { getMockFormOperationsService } from '../../../shared/mocks/form-operations-service.mock'; import { getMockFormService } from '../../../shared/mocks/form-service.mock'; -import { mockSubmissionCollectionId, mockSubmissionId, } from '../../../shared/mocks/submission.mock'; +import { + mockSubmissionCollectionId, + mockSubmissionId, +} from '../../../shared/mocks/submission.mock'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub'; -import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; -import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; @@ -127,9 +140,9 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), { name: 'test', values: [ - 'org.dspace.ctask.general.ProfileFormats = test' - ] - })) + 'org.dspace.ctask.general.ProfileFormats = test', + ], + })), }); const licenseText = 'License text'; @@ -148,7 +161,7 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, ReactiveFormsModule, @@ -158,9 +171,9 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { SubmissionSectionIdentifiersComponent, TestComponent, ObjNgFor, - VarDirective - ], - providers: [ + VarDirective, + ], + providers: [ { provide: CollectionDataService, useValue: getMockCollectionDataService() }, { provide: SectionFormOperationsService, useValue: getMockFormOperationsService() }, { provide: FormService, useValue: getMockFormService() }, @@ -177,9 +190,9 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { ChangeDetectorRef, FormBuilderService, SubmissionSectionIdentifiersComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); // First test to check the correct component creation @@ -259,14 +272,14 @@ describe('SubmissionSectionIdentifiersComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - NgxPaginationModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [ + CommonModule, + FormsModule, + ReactiveFormsModule, + NgxPaginationModule], }) class TestComponent { diff --git a/src/app/submission/sections/identifiers/section-identifiers.component.ts b/src/app/submission/sections/identifiers/section-identifiers.component.ts index 92dd486574..1483ea47b7 100644 --- a/src/app/submission/sections/identifiers/section-identifiers.component.ts +++ b/src/app/submission/sections/identifiers/section-identifiers.component.ts @@ -1,18 +1,30 @@ -import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; - -import { Observable, of as observableOf, Subscription } from 'rxjs'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; - import { - WorkspaceitemSectionIdentifiersObject -} from '../../../core/submission/models/workspaceitem-section-identifiers.model'; + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, + Inject, +} from '@angular/core'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, + Subscription, +} from 'rxjs'; + +import { WorkspaceitemSectionIdentifiersObject } from '../../../core/submission/models/workspaceitem-section-identifiers.model'; import { AlertType } from '../../../shared/alert/alert-type'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { SubmissionService } from '../../submission.service'; import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { VarDirective } from '../../../shared/utils/var.directive'; /** * This simple component displays DOI, handle and other identifiers that are already minted for the item in @@ -30,9 +42,9 @@ import { VarDirective } from '../../../shared/utils/var.directive'; NgForOf, NgIf, AsyncPipe, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class SubmissionSectionIdentifiersComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/license/section-license.component.spec.ts b/src/app/submission/sections/license/section-license.component.spec.ts index bd6fd8fee0..e742ff1050 100644 --- a/src/app/submission/sections/license/section-license.component.spec.ts +++ b/src/app/submission/sections/license/section-license.component.spec.ts @@ -1,11 +1,35 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { DynamicCheckboxModel, DynamicFormControlEvent, DynamicFormControlEventType, } from '@ng-dynamic-forms/core'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + DynamicCheckboxModel, + DynamicFormControlEvent, + DynamicFormControlEventType, +} from '@ng-dynamic-forms/core'; +import { provideMockStore } from '@ngrx/store/testing'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; +import { DsDynamicTypeBindRelationService } from 'src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; +import { + APP_CONFIG, + APP_DATA_SERVICES_MAP, + APP_DYNAMIC_FORM_CONTROL_FN, +} from 'src/config/app-config.interface'; +import { environment } from 'src/environments/environment.test'; import { SubmissionFormsConfigDataService } from '../../../core/config/submission-forms-config-data.service'; import { CollectionDataService } from '../../../core/data/collection-data.service'; @@ -13,6 +37,7 @@ import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { Collection } from '../../../core/shared/collection.model'; import { License } from '../../../core/shared/license.model'; +import { dsDynamicFormControlMapFn } from '../../../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormFieldMetadataValueObject } from '../../../shared/form/builder/models/form-field-metadata-value.model'; import { FormComponent } from '../../../shared/form/form.component'; @@ -36,21 +61,12 @@ import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; import { SectionsType } from '../sections-type'; import { SubmissionSectionLicenseComponent } from './section-license.component'; -import { provideMockStore } from '@ngrx/store/testing'; -import { - DsDynamicTypeBindRelationService -} from 'src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP, APP_DYNAMIC_FORM_CONTROL_FN } from 'src/config/app-config.interface'; -import { environment } from 'src/environments/environment.test'; -import { - dsDynamicFormControlMapFn -} from '../../../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-map-fn'; function getMockDsDynamicTypeBindRelationService(): DsDynamicTypeBindRelationService { return jasmine.createSpyObj('DsDynamicTypeBindRelationService', { getRelatedFormModel: jasmine.createSpy('getRelatedFormModel'), matchesCondition: jasmine.createSpy('matchesCondition'), - subscribeRelations: jasmine.createSpy('subscribeRelations') + subscribeRelations: jasmine.createSpy('subscribeRelations'), }); } @@ -132,7 +148,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { 'cache/object-updates': {}, 'data/request': {}, 'index': {}, - } + }, }; beforeEach(waitForAsync(() => { void TestBed.configureTestingModule({ @@ -158,7 +174,7 @@ describe('SubmissionSectionLicenseComponent test suite', () => { { provide: 'sectionDataProvider', useValue: Object.assign({}, sectionObject) }, { provide: 'submissionIdProvider', useValue: submissionId }, ChangeDetectorRef, - provideMockStore({initialState}), + provideMockStore({ initialState }), FormBuilderService, { provide: DsDynamicTypeBindRelationService, useValue: getMockDsDynamicTypeBindRelationService() }, { provide: APP_CONFIG, useValue: environment }, @@ -351,8 +367,8 @@ describe('SubmissionSectionLicenseComponent test suite', () => { CommonModule, FormsModule, FormComponent, - ReactiveFormsModule - ] + ReactiveFormsModule, + ], }) class TestComponent { diff --git a/src/app/submission/sections/license/section-license.component.ts b/src/app/submission/sections/license/section-license.component.ts index 13bdd45c71..86a0455c30 100644 --- a/src/app/submission/sections/license/section-license.component.ts +++ b/src/app/submission/sections/license/section-license.component.ts @@ -1,4 +1,14 @@ -import { AfterViewChecked, ChangeDetectorRef, Component, Inject, ViewChild, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + AfterViewChecked, + ChangeDetectorRef, + Component, + Inject, + ViewChild, +} from '@angular/core'; import { DynamicCheckboxModel, DynamicFormControlEvent, @@ -6,8 +16,19 @@ import { DynamicFormLayout, } from '@ng-dynamic-forms/core'; import { TranslateService } from '@ngx-translate/core'; -import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, find, map, mergeMap, startWith, take, } from 'rxjs/operators'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + distinctUntilChanged, + filter, + find, + map, + mergeMap, + startWith, + take, +} from 'rxjs/operators'; import { CollectionDataService } from '../../../core/data/collection-data.service'; import { RemoteData } from '../../../core/data/remote-data'; @@ -16,7 +37,12 @@ import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/jso import { Collection } from '../../../core/shared/collection.model'; import { License } from '../../../core/shared/license.model'; import { WorkspaceitemSectionLicenseObject } from '../../../core/submission/models/workspaceitem-section-license.model'; -import { hasValue, isNotEmpty, isNotNull, isNotUndefined, } from '../../../shared/empty.util'; +import { + hasValue, + isNotEmpty, + isNotNull, + isNotUndefined, +} from '../../../shared/empty.util'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormComponent } from '../../../shared/form/form.component'; import { FormService } from '../../../shared/form/form.service'; @@ -26,8 +52,10 @@ import { SectionFormOperationsService } from '../form/section-form-operations.se import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; -import { SECTION_LICENSE_FORM_LAYOUT, SECTION_LICENSE_FORM_MODEL } from './section-license.model'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { + SECTION_LICENSE_FORM_LAYOUT, + SECTION_LICENSE_FORM_MODEL, +} from './section-license.model'; /** * This component represents a section that contains the submission license form. @@ -42,7 +70,7 @@ import { AsyncPipe, NgIf } from '@angular/common'; NgIf, AsyncPipe, ], - standalone: true + standalone: true, }) export class SubmissionSectionLicenseComponent extends SectionModelComponent implements AfterViewChecked { @@ -187,7 +215,7 @@ export class SubmissionSectionLicenseComponent extends SectionModelComponent i // Remove any section's errors this.sectionService.dispatchRemoveSectionErrors(this.submissionId, this.sectionData.id); } - }) + }), ); } diff --git a/src/app/submission/sections/section-coar-notify/coar-notify-config-data.service.ts b/src/app/submission/sections/section-coar-notify/coar-notify-config-data.service.ts index e272eff852..20786e27f0 100644 --- a/src/app/submission/sections/section-coar-notify/coar-notify-config-data.service.ts +++ b/src/app/submission/sections/section-coar-notify/coar-notify-config-data.service.ts @@ -47,7 +47,7 @@ import { SubmissionCoarNotifyConfig } from './submission-coar-notify.config'; /** * A service responsible for fetching/sending data from/to the REST API on the CoarNotifyConfig endpoint */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) @dataService(SUBMISSION_COAR_NOTIFY_CONFIG) export class CoarNotifyConfigDataService extends IdentifiableDataService implements FindAllData, DeleteData, PatchData, CreateData { createData: CreateDataImpl; diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.spec.ts b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.spec.ts index 4e9e1cbf04..635b0a9f44 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.spec.ts +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.spec.ts @@ -66,8 +66,8 @@ describe('SubmissionSectionCoarNotifyComponent', () => { }); await TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SubmissionSectionCoarNotifyComponent], - providers: [ + imports: [TranslateModule.forRoot(), SubmissionSectionCoarNotifyComponent], + providers: [ { provide: LdnServicesService, useValue: ldnServicesService }, { provide: CoarNotifyConfigDataService, useValue: coarNotifyConfigDataService }, { provide: JsonPatchOperationsBuilder, useValue: operationsBuilder }, @@ -77,8 +77,8 @@ describe('SubmissionSectionCoarNotifyComponent', () => { { provide: 'sectionDataProvider', useValue: { id: 'sectionId', data: {} } }, { provide: 'submissionIdProvider', useValue: 'submissionId' }, NgbDropdown, - ] -}).compileComponents(); + ], + }).compileComponents(); fixture = TestBed.createComponent(SubmissionSectionCoarNotifyComponent); component = fixture.componentInstance; diff --git a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts index 94f1922886..fc501c3cd9 100644 --- a/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts +++ b/src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts @@ -1,31 +1,54 @@ -import { ChangeDetectorRef, Component, Inject } from '@angular/core'; -import { Observable, Subscription } from 'rxjs'; -import { SectionModelComponent } from '../models/section.model'; -import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; -import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; -import { SectionsService } from '../sections.service'; -import { SectionDataObject } from '../models/section-data.model'; -import { NgbDropdown, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { filter, map, take, tap, } from 'rxjs/operators'; - -import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; - import { - getFirstCompletedRemoteData, - getPaginatedListPayload, - getRemoteDataPayload -} from '../../../core/shared/operators'; + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Inject, +} from '@angular/core'; +import { + NgbDropdown, + NgbDropdownModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; +import { + Observable, + Subscription, +} from 'rxjs'; +import { + filter, + map, + take, + tap, +} from 'rxjs/operators'; + import { LdnServicesService } from '../../../admin/admin-ldn-services/ldn-services-data/ldn-services-data.service'; import { LdnService, LdnServiceByPattern, } from '../../../admin/admin-ldn-services/ldn-services-model/ldn-services.model'; -import { CoarNotifyConfigDataService } from './coar-notify-config-data.service'; +import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; +import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; +import { + getFirstCompletedRemoteData, + getPaginatedListPayload, + getRemoteDataPayload, +} from '../../../core/shared/operators'; +import { + hasValue, + isEmpty, + isNotEmpty, +} from '../../../shared/empty.util'; import { SubmissionSectionError } from '../../objects/submission-section-error.model'; +import { SectionModelComponent } from '../models/section.model'; +import { SectionDataObject } from '../models/section-data.model'; +import { SectionsService } from '../sections.service'; +import { CoarNotifyConfigDataService } from './coar-notify-config-data.service'; import { LdnPattern } from './submission-coar-notify.config'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; /** * This component represents a section that contains the submission section-coar-notify form. @@ -42,7 +65,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll'; TranslateModule, NgbDropdownModule, NgClass, - InfiniteScrollModule + InfiniteScrollModule, ], providers: [NgbDropdown], }) diff --git a/src/app/submission/sections/sections-decorator.ts b/src/app/submission/sections/sections-decorator.ts index 1fc35c34d8..1147281579 100644 --- a/src/app/submission/sections/sections-decorator.ts +++ b/src/app/submission/sections/sections-decorator.ts @@ -1,12 +1,12 @@ -import { SectionsType } from './sections-type'; import { SubmissionSectionAccessesComponent } from './accesses/section-accesses.component'; -import { SubmissionSectionLicenseComponent } from './license/section-license.component'; import { SubmissionSectionCcLicensesComponent } from './cc-license/submission-section-cc-licenses.component'; -import { SubmissionSectionSherpaPoliciesComponent } from './sherpa-policies/section-sherpa-policies.component'; -import { SubmissionSectionUploadComponent } from './upload/section-upload.component'; import { SubmissionSectionFormComponent } from './form/section-form.component'; import { SubmissionSectionIdentifiersComponent } from './identifiers/section-identifiers.component'; +import { SubmissionSectionLicenseComponent } from './license/section-license.component'; import { SubmissionSectionCoarNotifyComponent } from './section-coar-notify/section-coar-notify.component'; +import { SectionsType } from './sections-type'; +import { SubmissionSectionSherpaPoliciesComponent } from './sherpa-policies/section-sherpa-policies.component'; +import { SubmissionSectionUploadComponent } from './upload/section-upload.component'; const submissionSectionsMap = new Map(); diff --git a/src/app/submission/sections/sections.directive.ts b/src/app/submission/sections/sections.directive.ts index 60f86eda77..7cf1921ff0 100644 --- a/src/app/submission/sections/sections.directive.ts +++ b/src/app/submission/sections/sections.directive.ts @@ -27,9 +27,9 @@ import { SectionsType } from './sections-type'; * Directive for handling generic section functionality */ @Directive({ - selector: '[dsSection]', - exportAs: 'sectionRef', - standalone: true + selector: '[dsSection]', + exportAs: 'sectionRef', + standalone: true, }) export class SectionsDirective implements OnDestroy, OnInit { diff --git a/src/app/submission/sections/sections.service.ts b/src/app/submission/sections/sections.service.ts index 70490ff1e6..8d86ee84b5 100644 --- a/src/app/submission/sections/sections.service.ts +++ b/src/app/submission/sections/sections.service.ts @@ -63,7 +63,7 @@ import { SectionsType } from './sections-type'; /** * A service that provides methods used in submission process. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SectionsService { /** diff --git a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.spec.ts b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.spec.ts index f012221eff..2abe8e02ec 100644 --- a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.spec.ts @@ -21,17 +21,17 @@ describe('ContentAccordionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), NgbCollapseModule, - ContentAccordionComponent - ], -}) + ContentAccordionComponent, + ], + }) .compileComponents(); }); diff --git a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts index b68eb1935f..2fde4f37cd 100644 --- a/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts +++ b/src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts @@ -1,12 +1,16 @@ +import { + NgForOf, + NgIf, + TitleCasePipe, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { PermittedVersions } from '../../../../core/submission/models/sherpa-policies-details.model'; -import { NgForOf, NgIf, TitleCasePipe } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; /** * This component represents a section that contains the inner accordions for the publisher policy versions. @@ -20,9 +24,9 @@ import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; TranslateModule, NgIf, NgbCollapseModule, - TitleCasePipe + TitleCasePipe, ], - standalone: true + standalone: true, }) export class ContentAccordionComponent { /** diff --git a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.spec.ts b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.spec.ts index d5b9fe09e6..5accbf3c5f 100644 --- a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.spec.ts @@ -20,16 +20,16 @@ describe('MetadataInformationComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - MetadataInformationComponent - ], -}) + MetadataInformationComponent, + ], + }) .compileComponents(); }); diff --git a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts index 41e61c0f3c..3c30038a9a 100644 --- a/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts +++ b/src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts @@ -1,11 +1,14 @@ +import { + DatePipe, + NgIf, +} from '@angular/common'; import { Component, Input, } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Metadata } from '../../../../core/submission/models/sherpa-policies-details.model'; -import { DatePipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; /** * This component represents a section that contains the matadata informations. @@ -17,9 +20,9 @@ import { TranslateModule } from '@ngx-translate/core'; imports: [ NgIf, TranslateModule, - DatePipe + DatePipe, ], - standalone: true + standalone: true, }) export class MetadataInformationComponent { /** diff --git a/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.spec.ts b/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.spec.ts index 37f62f74a3..fae68cd8a4 100644 --- a/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.spec.ts @@ -1,7 +1,13 @@ import { DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { SherpaDataResponse } from '../../../../shared/mocks/section-sherpa-policies.service.mock'; import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock'; @@ -15,16 +21,16 @@ describe('PublicationInformationComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), - PublicationInformationComponent - ], -}) + PublicationInformationComponent, + ], + }) .compileComponents(); }); diff --git a/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.ts b/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.ts index 7a56b1022e..8f256700a0 100644 --- a/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.ts +++ b/src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.ts @@ -1,8 +1,14 @@ -import { Component, Input, } from '@angular/core'; +import { + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Journal } from '../../../../core/submission/models/sherpa-policies-details.model'; -import { NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; /** * This component represents a section that contains the journal publication information. @@ -14,9 +20,9 @@ import { TranslateModule } from '@ngx-translate/core'; imports: [ NgIf, TranslateModule, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class PublicationInformationComponent { /** diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.spec.ts b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.spec.ts index afb768705b..773c416f1c 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.spec.ts @@ -1,7 +1,13 @@ import { DebugElement } from '@angular/core'; -import { ComponentFixture, TestBed, } from '@angular/core/testing'; +import { + ComponentFixture, + TestBed, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { SherpaDataResponse } from '../../../../shared/mocks/section-sherpa-policies.service.mock'; import { TranslateLoaderMock } from '../../../../shared/mocks/translate-loader.mock'; @@ -15,21 +21,21 @@ describe('PublisherPolicyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, + loader: { + provide: TranslateLoader, useClass: TranslateLoaderMock, }, }), PublisherPolicyComponent, - ] -}) -.overrideComponent(PublisherPolicyComponent, { - remove: { - imports: [ContentAccordionComponent] - } -}) + ], + }) + .overrideComponent(PublisherPolicyComponent, { + remove: { + imports: [ContentAccordionComponent], + }, + }) .compileComponents(); }); diff --git a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts index adf1a3c50a..6852a32473 100644 --- a/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts +++ b/src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts @@ -1,10 +1,17 @@ -import { Component, Input, } from '@angular/core'; +import { + KeyValuePipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Policy } from '../../../../core/submission/models/sherpa-policies-details.model'; import { AlertType } from '../../../../shared/alert/alert-type'; import { ContentAccordionComponent } from '../content-accordion/content-accordion.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { KeyValuePipe, NgForOf, NgIf } from '@angular/common'; /** * This component represents a section that contains the publisher policy informations. @@ -18,9 +25,9 @@ import { KeyValuePipe, NgForOf, NgIf } from '@angular/common'; TranslateModule, KeyValuePipe, NgForOf, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class PublisherPolicyComponent { diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts index 08f30ddb27..5882a277e6 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts @@ -1,26 +1,36 @@ -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { DebugElement } from '@angular/core'; -import { ComponentFixture, inject, TestBed, } from '@angular/core/testing'; -import { BrowserModule, By, } from '@angular/platform-browser'; +import { + ComponentFixture, + inject, + TestBed, +} from '@angular/core/testing'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; import { Store } from '@ngrx/store'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { AppState } from '../../../app.reducer'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { SherpaDataResponse } from '../../../shared/mocks/section-sherpa-policies.service.mock'; import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { SubmissionService } from '../../submission.service'; import { SectionsService } from '../sections.service'; -import { SubmissionSectionSherpaPoliciesComponent } from './section-sherpa-policies.component'; import { MetadataInformationComponent } from './metadata-information/metadata-information.component'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.component'; import { PublicationInformationComponent } from './publication-information/publication-information.component'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; +import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.component'; +import { SubmissionSectionSherpaPoliciesComponent } from './section-sherpa-policies.component'; describe('SubmissionSectionSherpaPoliciesComponent', () => { let component: SubmissionSectionSherpaPoliciesComponent; @@ -55,35 +65,35 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - BrowserModule, - NoopAnimationsModule, - TranslateModule.forRoot({ + imports: [ + BrowserModule, + NoopAnimationsModule, + TranslateModule.forRoot({ loader: { - provide: TranslateLoader, + provide: TranslateLoader, useClass: TranslateLoaderMock, }, - }), - NgbCollapseModule, - SubmissionSectionSherpaPoliciesComponent - ], - providers: [ - { provide: SectionsService, useValue: sectionsServiceStub }, - { provide: JsonPatchOperationsBuilder, useValue: operationsBuilder }, - { provide: SubmissionService, useValue: SubmissionServiceStub }, - { provide: Store, useValue: storeStub }, - { provide: 'sectionDataProvider', useValue: sectionData }, - { provide: 'submissionIdProvider', useValue: '1508' }, - { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - ] -}) + }), + NgbCollapseModule, + SubmissionSectionSherpaPoliciesComponent, + ], + providers: [ + { provide: SectionsService, useValue: sectionsServiceStub }, + { provide: JsonPatchOperationsBuilder, useValue: operationsBuilder }, + { provide: SubmissionService, useValue: SubmissionServiceStub }, + { provide: Store, useValue: storeStub }, + { provide: 'sectionDataProvider', useValue: sectionData }, + { provide: 'submissionIdProvider', useValue: '1508' }, + { provide: APP_DATA_SERVICES_MAP, useValue: {} }, + ], + }) .overrideComponent(SubmissionSectionSherpaPoliciesComponent, { remove: { imports: [ - MetadataInformationComponent, - AlertComponent, - PublisherPolicyComponent, - PublicationInformationComponent, - ]} + MetadataInformationComponent, + AlertComponent, + PublisherPolicyComponent, + PublicationInformationComponent, + ] }, }) .compileComponents(); }); diff --git a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts index 9bd578641e..dd614abef6 100644 --- a/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts +++ b/src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts @@ -1,25 +1,38 @@ -import { Component, Inject, } from '@angular/core'; -import { BehaviorSubject, Observable, of, Subscription, } from 'rxjs'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, +} from '@angular/core'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + Observable, + of, + Subscription, +} from 'rxjs'; import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; -import { - WorkspaceitemSectionSherpaPoliciesObject -} from '../../../core/submission/models/workspaceitem-section-sherpa-policies.model'; +import { WorkspaceitemSectionSherpaPoliciesObject } from '../../../core/submission/models/workspaceitem-section-sherpa-policies.model'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; +import { + hasValue, + isEmpty, +} from '../../../shared/empty.util'; +import { VarDirective } from '../../../shared/utils/var.directive'; import { SubmissionService } from '../../submission.service'; import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; import { MetadataInformationComponent } from './metadata-information/metadata-information.component'; -import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; import { PublicationInformationComponent } from './publication-information/publication-information.component'; -import { VarDirective } from '../../../shared/utils/var.directive'; -import { hasValue, isEmpty } from '../../../shared/empty.util'; +import { PublisherPolicyComponent } from './publisher-policy/publisher-policy.component'; /** * This component represents a section for the sherpa policy informations structure. @@ -38,9 +51,9 @@ import { hasValue, isEmpty } from '../../../shared/empty.util'; PublicationInformationComponent, AsyncPipe, VarDirective, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class SubmissionSectionSherpaPoliciesComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/upload/accessConditions/submission-section-upload-access-conditions.component.ts b/src/app/submission/sections/upload/accessConditions/submission-section-upload-access-conditions.component.ts index 67aae6471d..95297772a3 100644 --- a/src/app/submission/sections/upload/accessConditions/submission-section-upload-access-conditions.component.ts +++ b/src/app/submission/sections/upload/accessConditions/submission-section-upload-access-conditions.component.ts @@ -1,4 +1,12 @@ -import { Component, Input, OnInit, } from '@angular/core'; +import { + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + Input, + OnInit, +} from '@angular/core'; import { find } from 'rxjs/operators'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @@ -7,7 +15,6 @@ import { GroupDataService } from '../../../../core/eperson/group-data.service'; import { Group } from '../../../../core/eperson/models/group.model'; import { ResourcePolicy } from '../../../../core/resource-policy/models/resource-policy.model'; import { isEmpty } from '../../../../shared/empty.util'; -import { NgForOf, NgIf } from '@angular/common'; /** * This component represents a badge that describe an access condition @@ -17,9 +24,9 @@ import { NgForOf, NgIf } from '@angular/common'; templateUrl: './submission-section-upload-access-conditions.component.html', imports: [ NgForOf, - NgIf + NgIf, ], - standalone: true + standalone: true, }) export class SubmissionSectionUploadAccessConditionsComponent implements OnInit { diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts index c1908b082a..8543ee4089 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts @@ -1,35 +1,48 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing'; import { CommonModule } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { NgbActiveModal, NgbModal, } from '@ng-bootstrap/ng-bootstrap'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + NgbActiveModal, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormArrayModel, DynamicFormControlEvent, DynamicFormGroupModel, DynamicSelectModel, } from '@ng-dynamic-forms/core'; +import { provideMockStore } from '@ngrx/store/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgxMaskModule } from 'ngx-mask'; import { of } from 'rxjs'; import { - JsonPatchOperationPathCombiner -} from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner'; + APP_CONFIG, + APP_DATA_SERVICES_MAP, +} from '../../../../../../config/app-config.interface'; +import { environment } from '../../../../../../environments/environment.test'; +import { JsonPatchOperationPathCombiner } from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../../../core/json-patch/builder/json-patch-operations-builder'; -import { - SubmissionJsonPatchOperationsService -} from '../../../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../../../core/submission/submission-json-patch-operations.service'; import { dateToISOFormat } from '../../../../../shared/date.util'; -import { - DynamicCustomSwitchModel -} from '../../../../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; +import { DsDynamicTypeBindRelationService } from '../../../../../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; +import { DynamicCustomSwitchModel } from '../../../../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import { FormBuilderService } from '../../../../../shared/form/builder/form-builder.service'; -import { SubmissionServiceStub } from '../../../../../shared/testing/submission-service.stub'; -import { SubmissionService } from '../../../../submission.service'; -import { SubmissionSectionUploadFileEditComponent } from './section-upload-file-edit.component'; -import { - FormFieldMetadataValueObject -} from '../../../../../shared/form/builder/models/form-field-metadata-value.model'; +import { FormFieldMetadataValueObject } from '../../../../../shared/form/builder/models/form-field-metadata-value.model'; import { FormComponent } from '../../../../../shared/form/form.component'; import { FormService } from '../../../../../shared/form/form.service'; import { getMockFormService } from '../../../../../shared/mocks/form-service.mock'; @@ -43,25 +56,19 @@ import { mockUploadConfigResponseMetadata, mockUploadFiles, } from '../../../../../shared/mocks/submission.mock'; -import { - SubmissionJsonPatchOperationsServiceStub -} from '../../../../../shared/testing/submission-json-patch-operations-service.stub'; +import { SubmissionJsonPatchOperationsServiceStub } from '../../../../../shared/testing/submission-json-patch-operations-service.stub'; +import { SubmissionServiceStub } from '../../../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../../../shared/testing/utils.test'; +import { SubmissionService } from '../../../../submission.service'; import { SectionUploadService } from '../../section-upload.service'; -import { provideMockStore } from '@ngrx/store/testing'; -import { - DsDynamicTypeBindRelationService -} from '../../../../../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-type-bind-relation.service'; -import { APP_CONFIG, APP_DATA_SERVICES_MAP } from '../../../../../../config/app-config.interface'; -import { environment } from '../../../../../../environments/environment.test'; -import { NgxMaskModule } from 'ngx-mask'; import { POLICY_DEFAULT_WITH_LIST } from '../../section-upload-constants'; +import { SubmissionSectionUploadFileEditComponent } from './section-upload-file-edit.component'; function getMockDsDynamicTypeBindRelationService(): DsDynamicTypeBindRelationService { return jasmine.createSpyObj('DsDynamicTypeBindRelationService', { getRelatedFormModel: jasmine.createSpy('getRelatedFormModel'), matchesCondition: jasmine.createSpy('matchesCondition'), - subscribeRelations: jasmine.createSpy('subscribeRelations') + subscribeRelations: jasmine.createSpy('subscribeRelations'), }); } @@ -86,7 +93,7 @@ const initialState: any = { 'json/patch': {}, 'metaTag': {}, 'route': {}, - } + }, }; describe('SubmissionSectionUploadFileEditComponent test suite', () => { @@ -117,12 +124,12 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { delete noAccessConditionsMock.accessConditions; const mockCdRef = Object.assign({ - detectChanges: () => undefined + detectChanges: () => undefined, }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, ReactiveFormsModule, @@ -131,25 +138,25 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { SubmissionSectionUploadFileEditComponent, TestComponent, NgxMaskModule.forRoot(), - ], - providers: [ + ], + providers: [ { provide: FormService, useValue: getMockFormService() }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: SubmissionJsonPatchOperationsService, useValue: submissionJsonPatchOperationsServiceStub }, { provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder }, { provide: SectionUploadService, useValue: getMockSectionUploadService() }, - provideMockStore({initialState}), + provideMockStore({ initialState }), FormBuilderService, - {provide: ChangeDetectorRef, useValue: mockCdRef}, + { provide: ChangeDetectorRef, useValue: mockCdRef }, SubmissionSectionUploadFileEditComponent, NgbModal, NgbActiveModal, { provide: DsDynamicTypeBindRelationService, useValue: getMockDsDynamicTypeBindRelationService() }, { provide: APP_CONFIG, useValue: environment }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents().then(); + }).compileComponents().then(); })); describe('', () => { @@ -397,8 +404,8 @@ describe('SubmissionSectionUploadFileEditComponent test suite', () => { CommonModule, FormsModule, FormComponent, - ReactiveFormsModule - ] + ReactiveFormsModule, + ], }) class TestComponent { } diff --git a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts index 652c4d26bb..ecfbaa8d55 100644 --- a/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts +++ b/src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts @@ -1,4 +1,11 @@ -import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild, } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { + ChangeDetectorRef, + Component, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { @@ -14,36 +21,39 @@ import { } from '@ng-dynamic-forms/core'; import { DynamicDateControlValue } from '@ng-dynamic-forms/core/lib/model/dynamic-date-control.model'; import { DynamicFormControlCondition } from '@ng-dynamic-forms/core/lib/model/misc/dynamic-form-control-relation.model'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { filter, mergeMap, take, } from 'rxjs/operators'; import { - DynamicCustomSwitchModel -} from 'src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; + filter, + mergeMap, + take, +} from 'rxjs/operators'; +import { SubmissionObject } from 'src/app/core/submission/models/submission-object.model'; +import { WorkspaceitemSectionUploadObject } from 'src/app/core/submission/models/workspaceitem-section-upload.model'; +import { DynamicCustomSwitchModel } from 'src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import { AccessConditionOption } from '../../../../../core/config/models/config-access-condition-option.model'; import { SubmissionFormsModel } from '../../../../../core/config/models/config-submission-forms.model'; -import { - JsonPatchOperationPathCombiner -} from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner'; +import { JsonPatchOperationPathCombiner } from '../../../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../../../core/json-patch/builder/json-patch-operations-builder'; import { SubmissionObject } from '../../../../../core/submission/models/submission-object.model'; -import { - WorkspaceitemSectionUploadObject -} from '../../../../../core/submission/models/workspaceitem-section-upload.model'; -import { - WorkspaceitemSectionUploadFileObject -} from '../../../../../core/submission/models/workspaceitem-section-upload-file.model'; -import { - SubmissionJsonPatchOperationsService -} from '../../../../../core/submission/submission-json-patch-operations.service'; +import { WorkspaceitemSectionUploadObject } from '../../../../../core/submission/models/workspaceitem-section-upload.model'; +import { WorkspaceitemSectionUploadFileObject } from '../../../../../core/submission/models/workspaceitem-section-upload-file.model'; +import { SubmissionJsonPatchOperationsService } from '../../../../../core/submission/submission-json-patch-operations.service'; import { dateToISOFormat } from '../../../../../shared/date.util'; -import { hasNoValue, hasValue, isNotEmpty, isNotNull, } from '../../../../../shared/empty.util'; +import { + hasNoValue, + hasValue, + isNotEmpty, + isNotNull, +} from '../../../../../shared/empty.util'; import { FormBuilderService } from '../../../../../shared/form/builder/form-builder.service'; import { FormFieldModel } from '../../../../../shared/form/builder/models/form-field.model'; import { FormComponent } from '../../../../../shared/form/form.component'; import { FormService } from '../../../../../shared/form/form.service'; import { SubmissionService } from '../../../../submission.service'; import { SectionUploadService } from '../../section-upload.service'; +import { POLICY_DEFAULT_WITH_LIST } from '../../section-upload-constants'; import { BITSTREAM_ACCESS_CONDITION_GROUP_CONFIG, BITSTREAM_ACCESS_CONDITION_GROUP_LAYOUT, @@ -60,11 +70,6 @@ import { BITSTREAM_METADATA_FORM_GROUP_CONFIG, BITSTREAM_METADATA_FORM_GROUP_LAYOUT, } from './section-upload-file-edit.model'; -import { NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { POLICY_DEFAULT_WITH_LIST } from '../../section-upload-constants'; -import { SubmissionObject } from 'src/app/core/submission/models/submission-object.model'; -import { WorkspaceitemSectionUploadObject } from 'src/app/core/submission/models/workspaceitem-section-upload.model'; /** * This component represents the edit form for bitstream @@ -76,9 +81,9 @@ import { WorkspaceitemSectionUploadObject } from 'src/app/core/submission/models imports: [ FormComponent, NgIf, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class SubmissionSectionUploadFileEditComponent implements OnInit, OnDestroy { diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts index 40795d4a19..57972526ca 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.spec.ts @@ -1,18 +1,33 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { + AsyncPipe, + CommonModule, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { AsyncPipe, CommonModule } from '@angular/common'; - -import { of, of as observableOf } from 'rxjs'; -import { NgbModal, NgbModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModule, +} from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { + of as observableOf, + of, +} from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../../../config/app-config.interface'; import { JsonPatchOperationPathCombiner } from '../../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../../core/json-patch/builder/json-patch-operations-builder'; import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service'; -import { - SubmissionJsonPatchOperationsService -} from '../../../../core/submission/submission-json-patch-operations.service'; +import { SubmissionJsonPatchOperationsService } from '../../../../core/submission/submission-json-patch-operations.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { FormService } from '../../../../shared/form/form.service'; import { getMockFormService } from '../../../../shared/mocks/form-service.mock'; @@ -23,22 +38,19 @@ import { mockUploadConfigResponse, mockUploadFiles, } from '../../../../shared/mocks/submission.mock'; +import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; import { HALEndpointServiceStub } from '../../../../shared/testing/hal-endpoint-service.stub'; -import { - SubmissionJsonPatchOperationsServiceStub -} from '../../../../shared/testing/submission-json-patch-operations-service.stub'; +import { SubmissionJsonPatchOperationsServiceStub } from '../../../../shared/testing/submission-json-patch-operations-service.stub'; import { SubmissionServiceStub } from '../../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../../shared/testing/utils.test'; +import { ThemeService } from '../../../../shared/theme-support/theme.service'; import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { SubmissionService } from '../../../submission.service'; import { SectionUploadService } from '../section-upload.service'; +import { POLICY_DEFAULT_WITH_LIST } from '../section-upload-constants'; import { SubmissionSectionUploadFileEditComponent } from './edit/section-upload-file-edit.component'; import { SubmissionSectionUploadFileComponent } from './section-upload-file.component'; import { SubmissionSectionUploadFileViewComponent } from './view/section-upload-file-view.component'; -import { ThemeService } from '../../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../../shared/mocks/theme-service.mock'; -import { POLICY_DEFAULT_WITH_LIST } from '../section-upload-constants'; -import { APP_DATA_SERVICES_MAP } from '../../../../../config/app-config.interface'; const configMetadataFormMock = { rows: [{ @@ -83,15 +95,15 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, TranslateModule.forRoot(), FileSizePipe, SubmissionSectionUploadFileComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: FormService, useValue: getMockFormService() }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder }, @@ -105,13 +117,13 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { SubmissionSectionUploadFileComponent, SubmissionSectionUploadFileEditComponent, FormBuilderService, - ], - schemas: [NO_ERRORS_SCHEMA], -}) + ], + schemas: [NO_ERRORS_SCHEMA], + }) .overrideComponent(SubmissionSectionUploadFileComponent, { remove: { imports: [ - SubmissionSectionUploadFileViewComponent, - ]} + SubmissionSectionUploadFileViewComponent, + ] }, }) .compileComponents().then(); })); @@ -266,14 +278,14 @@ describe('SubmissionSectionUploadFileComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [ - SubmissionSectionUploadFileComponent, - CommonModule, - AsyncPipe, - NgbModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [ + SubmissionSectionUploadFileComponent, + CommonModule, + AsyncPipe, + NgbModule], }) class TestComponent { diff --git a/src/app/submission/sections/upload/file/section-upload-file.component.ts b/src/app/submission/sections/upload/file/section-upload-file.component.ts index 0a7d0f4ddb..fca6ea8f30 100644 --- a/src/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/section-upload-file.component.ts @@ -1,3 +1,7 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component, Input, @@ -8,8 +12,12 @@ import { ViewChild, } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap/modal/modal-config'; +import { + NgbModalOptions, + NgbModalOptions, +} from '@ng-bootstrap/ng-bootstrap/modal/modal-config'; import { DynamicFormControlModel } from '@ng-dynamic-forms/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -20,26 +28,23 @@ import { filter } from 'rxjs/operators'; import { SubmissionFormsModel } from '../../../../core/config/models/config-submission-forms.model'; import { JsonPatchOperationPathCombiner } from '../../../../core/json-patch/builder/json-patch-operation-path-combiner'; import { JsonPatchOperationsBuilder } from '../../../../core/json-patch/builder/json-patch-operations-builder'; -import { Bitstream } from '../../../../core/shared/bitstream.model'; +import { + Bitstream, + Bitstream, +} from '../../../../core/shared/bitstream.model'; import { WorkspaceitemSectionUploadFileObject } from '../../../../core/submission/models/workspaceitem-section-upload-file.model'; import { SubmissionJsonPatchOperationsService } from '../../../../core/submission/submission-json-patch-operations.service'; import { hasValue, isNotUndefined, } from '../../../../shared/empty.util'; +import { ThemedFileDownloadLinkComponent } from '../../../../shared/file-download-link/themed-file-download-link.component'; import { FormService } from '../../../../shared/form/form.service'; +import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; import { SubmissionService } from '../../../submission.service'; import { SectionUploadService } from '../section-upload.service'; import { SubmissionSectionUploadFileEditComponent } from './edit/section-upload-file-edit.component'; -import { Bitstream } from '../../../../core/shared/bitstream.model'; -import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap/modal/modal-config'; -import { TranslateModule } from '@ngx-translate/core'; import { SubmissionSectionUploadFileViewComponent } from './view/section-upload-file-view.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../shared/file-download-link/themed-file-download-link.component'; -import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; /** * This component represents a single bitstream contained in the submission @@ -54,9 +59,9 @@ import { FileSizePipe } from '../../../../shared/utils/file-size-pipe'; NgIf, AsyncPipe, ThemedFileDownloadLinkComponent, - FileSizePipe + FileSizePipe, ], - standalone: true + standalone: true, }) export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, OnDestroy { /** diff --git a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts index 76ec199cfc..5478754da8 100644 --- a/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts +++ b/src/app/submission/sections/upload/file/themed-section-upload-file.component.ts @@ -10,8 +10,8 @@ import { SubmissionSectionUploadFileComponent } from './section-upload-file.comp @Component({ selector: 'ds-themed-submission-upload-section-file', styleUrls: [], - templateUrl: '../../../../shared/theme-support/themed.component.html', - standalone: true + templateUrl: '../../../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSubmissionSectionUploadFileComponent extends ThemedComponent { diff --git a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.spec.ts b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.spec.ts index 5678115a93..1ff35abc48 100644 --- a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.spec.ts +++ b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.spec.ts @@ -1,5 +1,14 @@ -import { ChangeDetectionStrategy, Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + ChangeDetectionStrategy, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { Metadata } from '../../../../../core/shared/metadata.utils'; @@ -7,10 +16,8 @@ import { FormComponent } from '../../../../../shared/form/form.component'; import { mockUploadFiles } from '../../../../../shared/mocks/submission.mock'; import { createTestComponent } from '../../../../../shared/testing/utils.test'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; +import { SubmissionSectionUploadAccessConditionsComponent } from '../../accessConditions/submission-section-upload-access-conditions.component'; import { SubmissionSectionUploadFileViewComponent } from './section-upload-file-view.component'; -import { - SubmissionSectionUploadAccessConditionsComponent -} from '../../accessConditions/submission-section-upload-access-conditions.component'; describe('SubmissionSectionUploadFileViewComponent test suite', () => { @@ -36,11 +43,11 @@ describe('SubmissionSectionUploadFileViewComponent test suite', () => { }) .overrideComponent(SubmissionSectionUploadFileViewComponent, { remove: { - imports: [SubmissionSectionUploadAccessConditionsComponent] + imports: [SubmissionSectionUploadAccessConditionsComponent], }, add: { - changeDetection: ChangeDetectionStrategy.Default - } + changeDetection: ChangeDetectionStrategy.Default, + }, }) .compileComponents().then(); })); @@ -102,7 +109,7 @@ describe('SubmissionSectionUploadFileViewComponent test suite', () => { @Component({ selector: 'ds-test-cmp', template: ``, - standalone: true + standalone: true, }) class TestComponent { diff --git a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts index 2268463850..0630a28a76 100644 --- a/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts +++ b/src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts @@ -1,17 +1,23 @@ -import { Component, Input, OnInit, } from '@angular/core'; - -import { MetadataMap, MetadataValue, } from '../../../../../core/shared/metadata.models'; -import { Metadata } from '../../../../../core/shared/metadata.utils'; import { - WorkspaceitemSectionUploadFileObject -} from '../../../../../core/submission/models/workspaceitem-section-upload-file.model'; -import { isNotEmpty } from '../../../../../shared/empty.util'; + NgForOf, + NgIf, +} from '@angular/common'; import { - SubmissionSectionUploadAccessConditionsComponent -} from '../../accessConditions/submission-section-upload-access-conditions.component'; + Component, + Input, + OnInit, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + +import { + MetadataMap, + MetadataValue, +} from '../../../../../core/shared/metadata.models'; +import { Metadata } from '../../../../../core/shared/metadata.utils'; +import { WorkspaceitemSectionUploadFileObject } from '../../../../../core/submission/models/workspaceitem-section-upload-file.model'; +import { isNotEmpty } from '../../../../../shared/empty.util'; import { TruncatePipe } from '../../../../../shared/utils/truncate.pipe'; -import { NgForOf, NgIf } from '@angular/common'; +import { SubmissionSectionUploadAccessConditionsComponent } from '../../accessConditions/submission-section-upload-access-conditions.component'; /** * This component allow to show bitstream's metadata @@ -24,9 +30,9 @@ import { NgForOf, NgIf } from '@angular/common'; TranslateModule, TruncatePipe, NgIf, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) export class SubmissionSectionUploadFileViewComponent implements OnInit { diff --git a/src/app/submission/sections/upload/section-upload.component.spec.ts b/src/app/submission/sections/upload/section-upload.component.spec.ts index 1247fd50c2..61db6c6885 100644 --- a/src/app/submission/sections/upload/section-upload.component.spec.ts +++ b/src/app/submission/sections/upload/section-upload.component.spec.ts @@ -1,10 +1,20 @@ -import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; import { CommonModule } from '@angular/common'; +import { + ChangeDetectorRef, + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + inject, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { TranslateModule } from '@ngx-translate/core'; import { cold } from 'jasmine-marbles'; import { of as observableOf } from 'rxjs'; +import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { SubmissionUploadsModel } from '../../../core/config/models/config-submission-uploads.model'; import { SubmissionFormsConfigDataService } from '../../../core/config/submission-forms-config-data.service'; import { SubmissionUploadsConfigDataService } from '../../../core/config/submission-uploads-config-data.service'; @@ -16,6 +26,7 @@ import { ResourcePolicy } from '../../../core/resource-policy/models/resource-po import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { Collection } from '../../../core/shared/collection.model'; import { PageInfo } from '../../../core/shared/page-info.model'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { getMockSectionUploadService } from '../../../shared/mocks/section-upload.service.mock'; import { mockGroup, @@ -27,10 +38,12 @@ import { mockUploadFiles, mockUploadFilesData, } from '../../../shared/mocks/submission.mock'; +import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils'; import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub'; import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub'; import { createTestComponent } from '../../../shared/testing/utils.test'; +import { ThemeService } from '../../../shared/theme-support/theme.service'; import { SubmissionObjectState } from '../../objects/submission-objects.reducer'; import { SubmissionService } from '../../submission.service'; import { SectionDataObject } from '../models/section-data.model'; @@ -38,10 +51,6 @@ import { SectionsService } from '../sections.service'; import { SectionsType } from '../sections-type'; import { SubmissionSectionUploadComponent } from './section-upload.component'; import { SectionUploadService } from './section-upload.service'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { ThemeService } from '../../../shared/theme-support/theme.service'; -import { getMockThemeService } from '../../../shared/mocks/theme-service.mock'; -import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; function getMockSubmissionUploadsConfigService(): SubmissionFormsConfigDataService { return jasmine.createSpyObj('SubmissionUploadsConfigService', { @@ -167,13 +176,13 @@ describe('SubmissionSectionUploadComponent test suite', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot(), SubmissionSectionUploadComponent, TestComponent, - ], - providers: [ + ], + providers: [ { provide: CollectionDataService, useValue: collectionDataService }, { provide: GroupDataService, useValue: groupService }, { provide: ResourcePolicyDataService, useValue: resourcePolicyService }, @@ -183,19 +192,19 @@ describe('SubmissionSectionUploadComponent test suite', () => { { provide: SectionUploadService, useValue: bitstreamService }, { provide: 'sectionDataProvider', useValue: sectionObject }, { provide: 'submissionIdProvider', useValue: submissionId }, - { provide: ThemeService, useValue: getMockThemeService()}, + { provide: ThemeService, useValue: getMockThemeService() }, { provide: APP_DATA_SERVICES_MAP, useValue: {} }, ChangeDetectorRef, SubmissionSectionUploadComponent, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(SubmissionSectionUploadComponent, { - remove: { - imports: [AlertComponent] - } -}) -.compileComponents().then(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(SubmissionSectionUploadComponent, { + remove: { + imports: [AlertComponent], + }, + }) + .compileComponents().then(); })); describe('', () => { @@ -370,11 +379,11 @@ describe('SubmissionSectionUploadComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: ``, - standalone: true, - imports: [ - CommonModule] + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [ + CommonModule], }) class TestComponent { diff --git a/src/app/submission/sections/upload/section-upload.component.ts b/src/app/submission/sections/upload/section-upload.component.ts index d2c3fcf19f..5e7388902e 100644 --- a/src/app/submission/sections/upload/section-upload.component.ts +++ b/src/app/submission/sections/upload/section-upload.component.ts @@ -1,4 +1,14 @@ -import { ChangeDetectorRef, Component, Inject, } from '@angular/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectorRef, + Component, + Inject, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, @@ -6,7 +16,14 @@ import { Observable, Subscription, } from 'rxjs'; -import { distinctUntilChanged, filter, map, mergeMap, switchMap, tap, } from 'rxjs/operators'; +import { + distinctUntilChanged, + filter, + map, + mergeMap, + switchMap, + tap, +} from 'rxjs/operators'; import { WorkspaceitemSectionUploadObject } from 'src/app/core/submission/models/workspaceitem-section-upload.model'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @@ -21,21 +38,22 @@ import { Group } from '../../../core/eperson/models/group.model'; import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { Collection } from '../../../core/shared/collection.model'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; +import { AlertComponent } from '../../../shared/alert/alert.component'; import { AlertType } from '../../../shared/alert/alert-type'; -import { hasValue, isNotEmpty, isNotUndefined, isUndefined, } from '../../../shared/empty.util'; +import { + hasValue, + isNotEmpty, + isNotUndefined, + isUndefined, +} from '../../../shared/empty.util'; import { followLink } from '../../../shared/utils/follow-link-config.model'; import { SubmissionObjectEntry } from '../../objects/submission-objects.reducer'; import { SubmissionService } from '../../submission.service'; import { SectionModelComponent } from '../models/section.model'; import { SectionDataObject } from '../models/section-data.model'; import { SectionsService } from '../sections.service'; +import { SubmissionSectionUploadAccessConditionsComponent } from './accessConditions/submission-section-upload-access-conditions.component'; import { ThemedSubmissionSectionUploadFileComponent } from './file/themed-section-upload-file.component'; -import { - SubmissionSectionUploadAccessConditionsComponent -} from './accessConditions/submission-section-upload-access-conditions.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { AlertComponent } from '../../../shared/alert/alert.component'; -import { TranslateModule } from '@ngx-translate/core'; import { SectionUploadService } from './section-upload.service'; export const POLICY_DEFAULT_NO_LIST = 1; // Banner1 @@ -60,9 +78,9 @@ export interface AccessConditionGroupsMapEntry { AlertComponent, TranslateModule, NgForOf, - AsyncPipe + AsyncPipe, ], - standalone: true + standalone: true, }) export class SubmissionSectionUploadComponent extends SectionModelComponent { diff --git a/src/app/submission/sections/upload/section-upload.service.ts b/src/app/submission/sections/upload/section-upload.service.ts index 39b181b7ad..b4abe366c0 100644 --- a/src/app/submission/sections/upload/section-upload.service.ts +++ b/src/app/submission/sections/upload/section-upload.service.ts @@ -28,7 +28,7 @@ import { SubmissionState } from '../../submission.reducers'; /** * A service that provides methods to handle submission's bitstream state. */ -@Injectable({providedIn: 'root'}) +@Injectable({ providedIn: 'root' }) export class SectionUploadService { /** diff --git a/src/app/submission/submission.module.ts b/src/app/submission/submission.module.ts index 35cd2a1c9c..cbf9ac80b5 100644 --- a/src/app/submission/submission.module.ts +++ b/src/app/submission/submission.module.ts @@ -1,12 +1,19 @@ -import { CommonModule, NgOptimizedImage, } from '@angular/common'; +import { + CommonModule, + NgOptimizedImage, +} from '@angular/common'; import { NgModule } from '@angular/core'; - -import { SubmissionSectionFormComponent } from './sections/form/section-form.component'; -import { SectionsDirective } from './sections/sections.directive'; -import { SectionsService } from './sections/sections.service'; -import { NgbAccordionModule, NgbCollapseModule, NgbModalModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbAccordionModule, + NgbCollapseModule, + NgbModalModule, +} from '@ng-bootstrap/ng-bootstrap'; import { EffectsModule } from '@ngrx/effects'; -import { Action, StoreConfig, StoreModule, } from '@ngrx/store'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; import { LdnServicesService } from '../admin/admin-ldn-services/ldn-services-data/ldn-services-data.service'; import { storeModuleConfig } from '../app.reducer'; @@ -21,55 +28,43 @@ import { SubmissionFormFooterComponent } from './form/footer/submission-form-foo import { SubmissionFormSectionAddComponent } from './form/section-add/submission-form-section-add.component'; import { SubmissionFormComponent } from './form/submission-form.component'; import { SubmissionUploadFilesComponent } from './form/submission-upload-files/submission-upload-files.component'; -import { - SubmissionImportExternalCollectionComponent -} from './import-external/import-external-collection/submission-import-external-collection.component'; -import { - SubmissionImportExternalPreviewComponent -} from './import-external/import-external-preview/submission-import-external-preview.component'; -import { - SubmissionImportExternalSearchbarComponent -} from './import-external/import-external-searchbar/submission-import-external-searchbar.component'; +import { SubmissionImportExternalCollectionComponent } from './import-external/import-external-collection/submission-import-external-collection.component'; +import { SubmissionImportExternalPreviewComponent } from './import-external/import-external-preview/submission-import-external-preview.component'; +import { SubmissionImportExternalSearchbarComponent } from './import-external/import-external-searchbar/submission-import-external-searchbar.component'; import { SubmissionImportExternalComponent } from './import-external/submission-import-external.component'; -import { SubmissionSectionCcLicensesComponent } from './sections/cc-license/submission-section-cc-licenses.component'; -import { ThemedSubmissionSubmitComponent } from './submit/themed-submission-submit.component'; import { ThemedSubmissionImportExternalComponent } from './import-external/themed-submission-import-external.component'; -import { - ThemedSubmissionSectionUploadFileComponent -} from './sections/upload/file/themed-section-upload-file.component'; import { SubmissionSectionAccessesComponent } from './sections/accesses/section-accesses.component'; import { SectionAccessesService } from './sections/accesses/section-accesses.service'; +import { SubmissionSectionCcLicensesComponent } from './sections/cc-license/submission-section-cc-licenses.component'; import { SubmissionSectionContainerComponent } from './sections/container/section-container.component'; import { SubmissionSectionDuplicatesComponent } from './sections/duplicates/section-duplicates.component'; +import { SubmissionSectionFormComponent } from './sections/form/section-form.component'; import { SectionFormOperationsService } from './sections/form/section-form-operations.service'; import { SubmissionSectionIdentifiersComponent } from './sections/identifiers/section-identifiers.component'; import { SubmissionSectionLicenseComponent } from './sections/license/section-license.component'; import { CoarNotifyConfigDataService } from './sections/section-coar-notify/coar-notify-config-data.service'; import { SubmissionSectionCoarNotifyComponent } from './sections/section-coar-notify/section-coar-notify.component'; +import { SectionsDirective } from './sections/sections.directive'; +import { SectionsService } from './sections/sections.service'; import { ContentAccordionComponent } from './sections/sherpa-policies/content-accordion/content-accordion.component'; -import { - MetadataInformationComponent -} from './sections/sherpa-policies/metadata-information/metadata-information.component'; -import { - PublicationInformationComponent -} from './sections/sherpa-policies/publication-information/publication-information.component'; +import { MetadataInformationComponent } from './sections/sherpa-policies/metadata-information/metadata-information.component'; +import { PublicationInformationComponent } from './sections/sherpa-policies/publication-information/publication-information.component'; import { PublisherPolicyComponent } from './sections/sherpa-policies/publisher-policy/publisher-policy.component'; import { SubmissionSectionSherpaPoliciesComponent } from './sections/sherpa-policies/section-sherpa-policies.component'; -import { - SubmissionSectionUploadAccessConditionsComponent -} from './sections/upload/accessConditions/submission-section-upload-access-conditions.component'; -import { - SubmissionSectionUploadFileEditComponent -} from './sections/upload/file/edit/section-upload-file-edit.component'; +import { SubmissionSectionUploadAccessConditionsComponent } from './sections/upload/accessConditions/submission-section-upload-access-conditions.component'; +import { SubmissionSectionUploadFileEditComponent } from './sections/upload/file/edit/section-upload-file-edit.component'; import { SubmissionSectionUploadFileComponent } from './sections/upload/file/section-upload-file.component'; -import { - SubmissionSectionUploadFileViewComponent -} from './sections/upload/file/view/section-upload-file-view.component'; +import { ThemedSubmissionSectionUploadFileComponent } from './sections/upload/file/themed-section-upload-file.component'; +import { SubmissionSectionUploadFileViewComponent } from './sections/upload/file/view/section-upload-file-view.component'; import { SubmissionSectionUploadComponent } from './sections/upload/section-upload.component'; import { SectionUploadService } from './sections/upload/section-upload.service'; import { submissionEffects } from './submission.effects'; -import { submissionReducers, SubmissionState, } from './submission.reducers'; +import { + submissionReducers, + SubmissionState, +} from './submission.reducers'; import { SubmissionSubmitComponent } from './submit/submission-submit.component'; +import { ThemedSubmissionSubmitComponent } from './submit/themed-submission-submit.component'; const ENTRY_COMPONENTS = [ // put only entry components that use custom decorator @@ -126,20 +121,20 @@ const DECLARATIONS = [ NgbAccordionModule, UploadModule, NgOptimizedImage, - ...DECLARATIONS + ...DECLARATIONS, ], - exports: [ - ...DECLARATIONS, - FormModule, - ], - providers: [ - SectionUploadService, - SectionsService, - SubmissionUploadsConfigDataService, - SubmissionAccessesConfigDataService, - SectionAccessesService, - SectionFormOperationsService, - CoarNotifyConfigDataService, + exports: [ + ...DECLARATIONS, + FormModule, + ], + providers: [ + SectionUploadService, + SectionsService, + SubmissionUploadsConfigDataService, + SubmissionAccessesConfigDataService, + SectionAccessesService, + SectionFormOperationsService, + CoarNotifyConfigDataService, LdnServicesService, ], }) diff --git a/src/app/submission/submit/submission-submit.component.spec.ts b/src/app/submission/submit/submission-submit.component.spec.ts index dc1952d2da..d54eaaeccb 100644 --- a/src/app/submission/submit/submission-submit.component.spec.ts +++ b/src/app/submission/submit/submission-submit.component.spec.ts @@ -45,14 +45,14 @@ describe('SubmissionSubmitComponent Component', () => { findByHref: createSuccessfulRemoteDataObject$(submissionObject.item), }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([ - { path: '', component: SubmissionSubmitComponent, pathMatch: 'full' }, + { path: '', component: SubmissionSubmitComponent, pathMatch: 'full' }, ]), - SubmissionSubmitComponent - ], - providers: [ + SubmissionSubmitComponent, + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: ItemDataService, useValue: itemDataService }, @@ -60,9 +60,9 @@ describe('SubmissionSubmitComponent Component', () => { { provide: Router, useValue: new RouterStub() }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, ViewContainerRef, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/submission/submit/submission-submit.component.ts b/src/app/submission/submit/submission-submit.component.ts index 9f8ebb0040..84e1232147 100644 --- a/src/app/submission/submit/submission-submit.component.ts +++ b/src/app/submission/submit/submission-submit.component.ts @@ -39,10 +39,10 @@ import { SubmissionService } from '../submission.service'; * This component allows to submit a new workspaceitem. */ @Component({ - selector: 'ds-submission-submit', - styleUrls: ['./submission-submit.component.scss'], - templateUrl: './submission-submit.component.html', - standalone: true + selector: 'ds-submission-submit', + styleUrls: ['./submission-submit.component.scss'], + templateUrl: './submission-submit.component.html', + standalone: true, }) export class SubmissionSubmitComponent implements OnDestroy, OnInit { diff --git a/src/app/submission/submit/themed-submission-submit.component.ts b/src/app/submission/submit/themed-submission-submit.component.ts index c6309f2597..15faf2c420 100644 --- a/src/app/submission/submit/themed-submission-submit.component.ts +++ b/src/app/submission/submit/themed-submission-submit.component.ts @@ -7,10 +7,10 @@ import { SubmissionSubmitComponent } from './submission-submit.component'; * Themed wrapper for SubmissionSubmitComponent */ @Component({ - selector: 'ds-themed-submission-submit', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-submission-submit', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedSubmissionSubmitComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/submit-page/submit-page-routes.ts b/src/app/submit-page/submit-page-routes.ts index d6b9512d2f..80c48e20fc 100644 --- a/src/app/submit-page/submit-page-routes.ts +++ b/src/app/submit-page/submit-page-routes.ts @@ -1,9 +1,9 @@ import { Route } from '@angular/router'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { ThemedSubmissionSubmitComponent } from '../submission/submit/themed-submission-submit.component'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { provideSubmission } from '../submission/provide-submission'; +import { ThemedSubmissionSubmitComponent } from '../submission/submit/themed-submission-submit.component'; export const ROUTES: Route[] = [ { @@ -12,11 +12,11 @@ export const ROUTES: Route[] = [ pathMatch: 'full', component: ThemedSubmissionSubmitComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, providers: [ provideSubmission(), ], - data: {title: 'submission.submit.title', breadcrumbKey: 'submission.submit'} - } + data: { title: 'submission.submit.title', breadcrumbKey: 'submission.submit' }, + }, ]; diff --git a/src/app/subscriptions-page/subscriptions-page-routes.ts b/src/app/subscriptions-page/subscriptions-page-routes.ts index 01decefee2..0dbdad2f02 100644 --- a/src/app/subscriptions-page/subscriptions-page-routes.ts +++ b/src/app/subscriptions-page/subscriptions-page-routes.ts @@ -1,4 +1,5 @@ import { Route } from '@angular/router'; + import { SubscriptionsPageComponent } from './subscriptions-page.component'; export const ROUTES: Route[] = [ @@ -12,6 +13,6 @@ export const ROUTES: Route[] = [ path: '', component: SubscriptionsPageComponent, }, - ] + ], }, ]; diff --git a/src/app/subscriptions-page/subscriptions-page.component.spec.ts b/src/app/subscriptions-page/subscriptions-page.component.spec.ts index ff155055a5..cd582ddf41 100644 --- a/src/app/subscriptions-page/subscriptions-page.component.spec.ts +++ b/src/app/subscriptions-page/subscriptions-page.component.spec.ts @@ -1,19 +1,35 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; -import { BrowserModule, By, } from '@angular/platform-browser'; +import { + DebugElement, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader, TranslateModule, } from '@ngx-translate/core'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../core/auth/auth.service'; import { buildPaginatedList } from '../core/data/paginated-list.model'; import { PaginationService } from '../core/pagination/pagination.service'; import { PageInfo } from '../core/shared/page-info.model'; +import { AlertComponent } from '../shared/alert/alert.component'; +import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; import { MockActivatedRoute } from '../shared/mocks/active-router.mock'; import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock'; +import { PaginationComponent } from '../shared/pagination/pagination.component'; import { createSuccessfulRemoteDataObject$ } from '../shared/remote-data.utils'; import { SubscriptionViewComponent } from '../shared/subscriptions/subscription-view/subscription-view.component'; import { SubscriptionsDataService } from '../shared/subscriptions/subscriptions-data.service'; @@ -24,9 +40,6 @@ import { subscriptionMock2, } from '../shared/testing/subscriptions-data.mock'; import { VarDirective } from '../shared/utils/var.directive'; -import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { PaginationComponent } from '../shared/pagination/pagination.component'; -import { AlertComponent } from '../shared/alert/alert.component'; import { SubscriptionsPageComponent } from './subscriptions-page.component'; describe('SubscriptionsPageComponent', () => { @@ -67,7 +80,7 @@ describe('SubscriptionsPageComponent', () => { }, }), NoopAnimationsModule, - SubscriptionsPageComponent, SubscriptionViewComponent, VarDirective + SubscriptionsPageComponent, SubscriptionViewComponent, VarDirective, ], providers: [ { provide: SubscriptionsDataService, useValue: subscriptionServiceStub }, @@ -79,8 +92,8 @@ describe('SubscriptionsPageComponent', () => { }) .overrideComponent(SubscriptionsPageComponent, { remove: { - imports: [ThemedLoadingComponent, PaginationComponent, AlertComponent] - } + imports: [ThemedLoadingComponent, PaginationComponent, AlertComponent], + }, }) .compileComponents(); })); diff --git a/src/app/subscriptions-page/subscriptions-page.component.ts b/src/app/subscriptions-page/subscriptions-page.component.ts index 0ba8096f45..5d0b4b258d 100644 --- a/src/app/subscriptions-page/subscriptions-page.component.ts +++ b/src/app/subscriptions-page/subscriptions-page.component.ts @@ -1,33 +1,55 @@ -import { Component, OnDestroy, OnInit, } from '@angular/core'; -import { BehaviorSubject, combineLatestWith, Observable, shareReplay, Subscription as rxjsSubscription, } from 'rxjs'; -import { map, switchMap, take, tap, } from 'rxjs/operators'; +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; +import { + Component, + OnDestroy, + OnInit, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatestWith, + Observable, + shareReplay, + Subscription as rxjsSubscription, +} from 'rxjs'; +import { + map, + switchMap, + take, + tap, +} from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; -import { buildPaginatedList, PaginatedList, } from '../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../core/data/paginated-list.model'; import { RemoteData } from '../core/data/remote-data'; import { EPerson } from '../core/eperson/models/eperson.model'; import { PaginationService } from '../core/pagination/pagination.service'; import { getAllCompletedRemoteData } from '../core/shared/operators'; import { PageInfo } from '../core/shared/page-info.model'; +import { AlertComponent } from '../shared/alert/alert.component'; import { AlertType } from '../shared/alert/alert-type'; import { hasValue } from '../shared/empty.util'; -import { TranslateModule } from '@ngx-translate/core'; -import { AlertComponent } from '../shared/alert/alert.component'; -import { SubscriptionViewComponent } from '../shared/subscriptions/subscription-view/subscription-view.component'; -import { PaginationComponent } from '../shared/pagination/pagination.component'; -import { VarDirective } from '../shared/utils/var.directive'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; +import { PaginationComponent } from '../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; import { Subscription } from '../shared/subscriptions/models/subscription.model'; +import { SubscriptionViewComponent } from '../shared/subscriptions/subscription-view/subscription-view.component'; import { SubscriptionsDataService } from '../shared/subscriptions/subscriptions-data.service'; +import { VarDirective } from '../shared/utils/var.directive'; @Component({ - selector: 'ds-subscriptions-page', - templateUrl: './subscriptions-page.component.html', - styleUrls: ['./subscriptions-page.component.scss'], - standalone: true, - imports: [NgIf, ThemedLoadingComponent, VarDirective, PaginationComponent, NgFor, SubscriptionViewComponent, AlertComponent, AsyncPipe, TranslateModule] + selector: 'ds-subscriptions-page', + templateUrl: './subscriptions-page.component.html', + styleUrls: ['./subscriptions-page.component.scss'], + standalone: true, + imports: [NgIf, ThemedLoadingComponent, VarDirective, PaginationComponent, NgFor, SubscriptionViewComponent, AlertComponent, AsyncPipe, TranslateModule], }) /** * List and allow to manage all the active subscription for the current user diff --git a/src/app/subscriptions-page/subscriptions-page.module.ts b/src/app/subscriptions-page/subscriptions-page.module.ts index f1b9592f75..12187ad79e 100644 --- a/src/app/subscriptions-page/subscriptions-page.module.ts +++ b/src/app/subscriptions-page/subscriptions-page.module.ts @@ -1,13 +1,14 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; + import { SubscriptionsModule } from '../shared/subscriptions/subscriptions.module'; import { SubscriptionsPageComponent } from './subscriptions-page.component'; @NgModule({ - imports: [ - CommonModule, - SubscriptionsModule, - SubscriptionsPageComponent - ], + imports: [ + CommonModule, + SubscriptionsModule, + SubscriptionsPageComponent, + ], }) export class SubscriptionsPageModule { } diff --git a/src/app/suggestions-page/suggestions-page-routes.ts b/src/app/suggestions-page/suggestions-page-routes.ts index 251361fa03..494ab0da15 100644 --- a/src/app/suggestions-page/suggestions-page-routes.ts +++ b/src/app/suggestions-page/suggestions-page-routes.ts @@ -1,26 +1,27 @@ -import { SuggestionsPageResolver } from './suggestions-page.resolver'; -import { SuggestionsPageComponent } from './suggestions-page.component'; +import { Route } from '@angular/router'; + import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { PublicationClaimBreadcrumbResolver } from '../core/breadcrumbs/publication-claim-breadcrumb.resolver'; -import { Route } from '@angular/router'; import { provideSuggestionNotifications } from '../notifications/provide-suggestion-notifications'; +import { SuggestionsPageComponent } from './suggestions-page.component'; +import { SuggestionsPageResolver } from './suggestions-page.resolver'; export const ROUTES: Route[] = [ { path: ':targetId', resolve: { suggestionTargets: SuggestionsPageResolver, - breadcrumb: PublicationClaimBreadcrumbResolver//I18nBreadcrumbResolver + breadcrumb: PublicationClaimBreadcrumbResolver,//I18nBreadcrumbResolver }, data: { title: 'admin.notifications.publicationclaim.page.title', breadcrumbKey: 'admin.notifications.publicationclaim', - showBreadcrumbsFluid: false + showBreadcrumbsFluid: false, }, providers: [ SuggestionsPageResolver, PublicationClaimBreadcrumbResolver, - provideSuggestionNotifications() + provideSuggestionNotifications(), ], canActivate: [AuthenticatedGuard], runGuardsAndResolvers: 'always', diff --git a/src/app/suggestions-page/suggestions-page.component.spec.ts b/src/app/suggestions-page/suggestions-page.component.spec.ts index df663ff9b7..8da48d740f 100644 --- a/src/app/suggestions-page/suggestions-page.component.spec.ts +++ b/src/app/suggestions-page/suggestions-page.component.spec.ts @@ -23,10 +23,9 @@ import { TestScheduler } from 'rxjs/testing'; import { AuthService } from '../core/auth/auth.service'; import { PaginationService } from '../core/pagination/pagination.service'; import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service'; +import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; import { SuggestionEvidencesComponent } from '../notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component'; -import { - SuggestionListElementComponent, -} from '../notifications/suggestion-list-element/suggestion-list-element.component'; +import { SuggestionListElementComponent } from '../notifications/suggestion-list-element/suggestion-list-element.component'; import { SuggestionTargetsStateService } from '../notifications/suggestion-targets/suggestion-targets.state.service'; import { SuggestionsService } from '../notifications/suggestions.service'; import { @@ -47,7 +46,6 @@ import { RouterStub } from '../shared/testing/router.stub'; import { ObjectKeysPipe } from '../shared/utils/object-keys-pipe'; import { VarDirective } from '../shared/utils/var.directive'; import { SuggestionsPageComponent } from './suggestions-page.component'; -import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; describe('SuggestionPageComponent', () => { let component: SuggestionsPageComponent; @@ -74,7 +72,7 @@ describe('SuggestionPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, CommonModule, TranslateModule.forRoot(), @@ -83,8 +81,8 @@ describe('SuggestionPageComponent', () => { SuggestionsPageComponent, ObjectKeysPipe, VarDirective, - ], - providers: [ + ], + providers: [ { provide: AuthService, useValue: authService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: WorkspaceitemDataService, useValue: workspaceitemServiceMock }, @@ -95,9 +93,9 @@ describe('SuggestionPageComponent', () => { { provide: TranslateService, useValue: getMockTranslateService() }, { provide: PaginationService, useValue: paginationService }, SuggestionsPageComponent, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents().then(); })); diff --git a/src/app/suggestions-page/suggestions-page.component.ts b/src/app/suggestions-page/suggestions-page.component.ts index 454b20e33c..89d75f33b2 100644 --- a/src/app/suggestions-page/suggestions-page.component.ts +++ b/src/app/suggestions-page/suggestions-page.component.ts @@ -1,36 +1,65 @@ -import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Data, Router, RouterLink } from '@angular/router'; - -import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; -import { distinctUntilChanged, map, switchMap, take } from 'rxjs/operators'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Data, + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + BehaviorSubject, + combineLatest, + Observable, +} from 'rxjs'; +import { + distinctUntilChanged, + map, + switchMap, + take, +} from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; -import { SortDirection, SortOptions, } from '../core/cache/models/sort-options.model'; +import { + SortDirection, + SortOptions, +} from '../core/cache/models/sort-options.model'; import { FindListOptions } from '../core/data/find-list-options.model'; import { PaginatedList } from '../core/data/paginated-list.model'; import { RemoteData } from '../core/data/remote-data'; import { Suggestion } from '../core/notifications/models/suggestion.model'; import { SuggestionTarget } from '../core/notifications/models/suggestion-target.model'; -import { SuggestionBulkResult, SuggestionsService } from '../notifications/suggestions.service'; -import { SuggestionTargetsStateService } from '../notifications/suggestion-targets/suggestion-targets.state.service'; -import { - SuggestionApproveAndImport, - SuggestionListElementComponent -} from '../notifications/suggestion-list-element/suggestion-list-element.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { VarDirective } from '../shared/utils/var.directive'; -import { SuggestionActionsComponent } from '../notifications/suggestion-actions/suggestion-actions.component'; -import { LoadingComponent } from '../shared/loading/loading.component'; -import { PaginationComponent } from '../shared/pagination/pagination.component'; -import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; import { PaginationService } from '../core/pagination/pagination.service'; import { redirectOn4xx } from '../core/shared/authorized.operators'; import { getFirstSucceededRemoteDataPayload } from '../core/shared/operators'; import { WorkspaceItem } from '../core/submission/models/workspaceitem.model'; import { WorkspaceitemDataService } from '../core/submission/workspaceitem-data.service'; +import { SuggestionActionsComponent } from '../notifications/suggestion-actions/suggestion-actions.component'; +import { SuggestionApproveAndImport } from '../notifications/suggestion-list-element/suggestion-approve-and-import'; +import { + SuggestionApproveAndImport, + SuggestionListElementComponent, +} from '../notifications/suggestion-list-element/suggestion-list-element.component'; +import { SuggestionTargetsStateService } from '../notifications/suggestion-targets/suggestion-targets.state.service'; +import { + SuggestionBulkResult, + SuggestionsService, +} from '../notifications/suggestions.service'; +import { LoadingComponent } from '../shared/loading/loading.component'; import { NotificationsService } from '../shared/notifications/notifications.service'; +import { PaginationComponent } from '../shared/pagination/pagination.component'; import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model'; +import { VarDirective } from '../shared/utils/var.directive'; import { getWorkspaceItemEditRoute } from '../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; @Component({ @@ -47,9 +76,9 @@ import { getWorkspaceItemEditRoute } from '../workflowitems-edit-page/workflowit LoadingComponent, PaginationComponent, SuggestionListElementComponent, - NgForOf + NgForOf, ], - standalone: true + standalone: true, }) /** diff --git a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.spec.ts b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.spec.ts index 67a252cbcd..a1d6e3b27e 100644 --- a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.spec.ts +++ b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.spec.ts @@ -49,12 +49,12 @@ describe('SystemWideAlertBannerComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SystemWideAlertBannerComponent], - providers: [ + imports: [TranslateModule.forRoot(), SystemWideAlertBannerComponent], + providers: [ { provide: SystemWideAlertDataService, useValue: systemWideAlertDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts index e6b9704e21..79ecf2117a 100644 --- a/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts +++ b/src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts @@ -1,26 +1,48 @@ -import { AsyncPipe, isPlatformBrowser, NgIf } from '@angular/common'; -import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID, } from '@angular/core'; +import { + AsyncPipe, + isPlatformBrowser, + NgIf, +} from '@angular/common'; +import { + Component, + Inject, + OnDestroy, + OnInit, + PLATFORM_ID, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { zonedTimeToUtc } from 'date-fns-tz'; -import { BehaviorSubject, EMPTY, interval, Subscription, } from 'rxjs'; -import { filter, map, switchMap, } from 'rxjs/operators'; +import { + BehaviorSubject, + EMPTY, + interval, + Subscription, +} from 'rxjs'; +import { + filter, + map, + switchMap, +} from 'rxjs/operators'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { SystemWideAlertDataService } from '../../core/data/system-wide-alert-data.service'; import { getAllSucceededRemoteDataPayload } from '../../core/shared/operators'; -import { hasValue, isNotEmpty, } from '../../shared/empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { SystemWideAlert } from '../system-wide-alert.model'; -import { TranslateModule } from '@ngx-translate/core'; /** * Component responsible for rendering a banner and the countdown for an active system-wide alert */ @Component({ - selector: 'ds-system-wide-alert-banner', - styleUrls: ['./system-wide-alert-banner.component.scss'], - templateUrl: './system-wide-alert-banner.component.html', - standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + selector: 'ds-system-wide-alert-banner', + styleUrls: ['./system-wide-alert-banner.component.scss'], + templateUrl: './system-wide-alert-banner.component.html', + standalone: true, + imports: [NgIf, AsyncPipe, TranslateModule], }) export class SystemWideAlertBannerComponent implements OnInit, OnDestroy { diff --git a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts index 7cfcb17691..32afa2cb4c 100644 --- a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts +++ b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts @@ -63,14 +63,14 @@ describe('SystemWideAlertFormComponent', () => { router = new RouterStub(); TestBed.configureTestingModule({ - imports: [FormsModule, SystemWideAlertModule, UiSwitchModule, TranslateModule.forRoot(), SystemWideAlertFormComponent], - providers: [ + imports: [FormsModule, SystemWideAlertModule, UiSwitchModule, TranslateModule.forRoot(), SystemWideAlertFormComponent], + providers: [ { provide: SystemWideAlertDataService, useValue: systemWideAlertDataService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Router, useValue: router }, { provide: RequestService, useValue: requestService }, ], -}).compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts index d9d01555f6..5a0ab9d3e2 100644 --- a/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts +++ b/src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts @@ -1,4 +1,11 @@ -import { Component, OnInit, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { FormsModule, ReactiveFormsModule, @@ -8,33 +15,51 @@ import { Validators, } from '@angular/forms'; import { Router } from '@angular/router'; -import { NgbDatepickerModule, NgbDateStruct, NgbTimepickerModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { utcToZonedTime, zonedTimeToUtc, } from 'date-fns-tz'; -import { BehaviorSubject, Observable, } from 'rxjs'; -import { filter, map, } from 'rxjs/operators'; +import { + NgbDatepickerModule, + NgbDateStruct, + NgbTimepickerModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + utcToZonedTime, + zonedTimeToUtc, +} from 'date-fns-tz'; +import { UiSwitchModule } from 'ngx-ui-switch'; +import { + BehaviorSubject, + Observable, +} from 'rxjs'; +import { + filter, + map, +} from 'rxjs/operators'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { RemoteData } from '../../core/data/remote-data'; import { RequestService } from '../../core/data/request.service'; import { SystemWideAlertDataService } from '../../core/data/system-wide-alert-data.service'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; -import { hasValue, isNotEmpty, } from '../../shared/empty.util'; +import { + hasValue, + isNotEmpty, +} from '../../shared/empty.util'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { SystemWideAlert } from '../system-wide-alert.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { UiSwitchModule } from 'ngx-ui-switch'; /** * Component responsible for rendering the form to update a system-wide alert */ @Component({ - selector: 'ds-system-wide-alert-form', - styleUrls: ['./system-wide-alert-form.component.scss'], - templateUrl: './system-wide-alert-form.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, UiSwitchModule, NgIf, NgbDatepickerModule, NgbTimepickerModule, AsyncPipe, TranslateModule] + selector: 'ds-system-wide-alert-form', + styleUrls: ['./system-wide-alert-form.component.scss'], + templateUrl: './system-wide-alert-form.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, UiSwitchModule, NgIf, NgbDatepickerModule, NgbTimepickerModule, AsyncPipe, TranslateModule], }) export class SystemWideAlertFormComponent implements OnInit { diff --git a/src/app/system-wide-alert/system-wide-alert-routes.ts b/src/app/system-wide-alert/system-wide-alert-routes.ts index 6b58399ec3..435ff8c900 100644 --- a/src/app/system-wide-alert/system-wide-alert-routes.ts +++ b/src/app/system-wide-alert/system-wide-alert-routes.ts @@ -1,9 +1,8 @@ -import { - SiteAdministratorGuard -} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; -import { SystemWideAlertFormComponent } from './alert-form/system-wide-alert-form.component'; import { Route } from '@angular/router'; +import { SiteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; +import { SystemWideAlertFormComponent } from './alert-form/system-wide-alert-form.component'; + export const ROUTES: Route[] = [ { path: '', diff --git a/src/app/system-wide-alert/system-wide-alert.module.ts b/src/app/system-wide-alert/system-wide-alert.module.ts index 13b9dffbc4..d974a89d50 100644 --- a/src/app/system-wide-alert/system-wide-alert.module.ts +++ b/src/app/system-wide-alert/system-wide-alert.module.ts @@ -1,6 +1,9 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NgbDatepickerModule, NgbTimepickerModule, } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbDatepickerModule, + NgbTimepickerModule, +} from '@ng-bootstrap/ng-bootstrap'; import { UiSwitchModule } from 'ngx-ui-switch'; import { SystemWideAlertDataService } from '../core/data/system-wide-alert-data.service'; @@ -8,18 +11,18 @@ import { SystemWideAlertBannerComponent } from './alert-banner/system-wide-alert import { SystemWideAlertFormComponent } from './alert-form/system-wide-alert-form.component'; @NgModule({ - imports: [ - FormsModule, - UiSwitchModule, - NgbTimepickerModule, - NgbDatepickerModule, - SystemWideAlertBannerComponent, + imports: [ + FormsModule, + UiSwitchModule, + NgbTimepickerModule, + NgbDatepickerModule, + SystemWideAlertBannerComponent, SystemWideAlertFormComponent, - ], - exports: [ - SystemWideAlertBannerComponent - ], - providers: [ + ], + exports: [ + SystemWideAlertBannerComponent, + ], + providers: [ SystemWideAlertDataService, ], }) diff --git a/src/app/thumbnail/themed-thumbnail.component.ts b/src/app/thumbnail/themed-thumbnail.component.ts index 5b1684197b..a9a324aa41 100644 --- a/src/app/thumbnail/themed-thumbnail.component.ts +++ b/src/app/thumbnail/themed-thumbnail.component.ts @@ -9,10 +9,10 @@ import { ThemedComponent } from '../shared/theme-support/themed.component'; import { ThumbnailComponent } from './thumbnail.component'; @Component({ - selector: 'ds-themed-thumbnail', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-thumbnail', + styleUrls: [], + templateUrl: '../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedThumbnailComponent extends ThemedComponent { diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index 7fc99bce58..78afc42051 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -9,6 +9,7 @@ import { waitForAsync, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; +import { TranslateModule } from '@ngx-translate/core'; import { of as observableOf } from 'rxjs'; import { AuthService } from '../core/auth/auth.service'; @@ -16,21 +17,20 @@ import { AuthorizationDataService } from '../core/data/feature-authorization/aut import { RemoteData } from '../core/data/remote-data'; import { Bitstream } from '../core/shared/bitstream.model'; import { FileService } from '../core/shared/file.service'; +import { getMockThemeService } from '../shared/mocks/theme-service.mock'; import { createFailedRemoteDataObject, createSuccessfulRemoteDataObject, } from '../shared/remote-data.utils'; +import { ThemeService } from '../shared/theme-support/theme.service'; import { SafeUrlPipe } from '../shared/utils/safe-url-pipe'; import { VarDirective } from '../shared/utils/var.directive'; import { ThumbnailComponent } from './thumbnail.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { getMockThemeService } from '../shared/mocks/theme-service.mock'; -import { ThemeService } from '../shared/theme-support/theme.service'; @Pipe({ // eslint-disable-next-line @angular-eslint/pipe-prefix - name: 'translate', - standalone: true + name: 'translate', + standalone: true, }) class MockTranslatePipe implements PipeTransform { transform(key: string): string { @@ -62,23 +62,23 @@ describe('ThumbnailComponent', () => { fileService.retrieveFileDownloadLink.and.callFake((url) => observableOf(`${url}?authentication-token=fake`)); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot(), - ThumbnailComponent, - SafeUrlPipe, - MockTranslatePipe, - VarDirective - ], - providers: [ + imports: [ + TranslateModule.forRoot(), + ThumbnailComponent, + SafeUrlPipe, + MockTranslatePipe, + VarDirective, + ], + providers: [ { provide: AuthService, useValue: authService }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: FileService, useValue: fileService }, - { provide: ThemeService, useValue: getMockThemeService() } - ] -}).overrideComponent(ThumbnailComponent, { - add: { - imports: [MockTranslatePipe] - } + { provide: ThemeService, useValue: getMockThemeService() }, + ], + }).overrideComponent(ThumbnailComponent, { + add: { + imports: [MockTranslatePipe], + }, }) .compileComponents(); })); diff --git a/src/app/thumbnail/thumbnail.component.ts b/src/app/thumbnail/thumbnail.component.ts index 839950c429..96d3965a4e 100644 --- a/src/app/thumbnail/thumbnail.component.ts +++ b/src/app/thumbnail/thumbnail.component.ts @@ -1,5 +1,15 @@ -import { Component, Input, OnChanges, SimpleChanges, } from '@angular/core'; -import { BehaviorSubject, of as observableOf, } from 'rxjs'; +import { CommonModule } from '@angular/common'; +import { + Component, + Input, + OnChanges, + SimpleChanges, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { + BehaviorSubject, + of as observableOf, +} from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { AuthService } from '../core/auth/auth.service'; @@ -8,12 +18,13 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { RemoteData } from '../core/data/remote-data'; import { Bitstream } from '../core/shared/bitstream.model'; import { FileService } from '../core/shared/file.service'; -import { SafeUrlPipe } from '../shared/utils/safe-url-pipe'; -import { TranslateModule } from '@ngx-translate/core'; +import { + hasNoValue, + hasValue, +} from '../shared/empty.util'; import { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; +import { SafeUrlPipe } from '../shared/utils/safe-url-pipe'; import { VarDirective } from '../shared/utils/var.directive'; -import { CommonModule } from '@angular/common'; -import { hasNoValue, hasValue, } from '../shared/empty.util'; /** * This component renders a given Bitstream as a thumbnail. @@ -25,7 +36,7 @@ import { hasNoValue, hasValue, } from '../shared/empty.util'; styleUrls: ['./thumbnail.component.scss'], templateUrl: './thumbnail.component.html', standalone: true, - imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe] + imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], }) export class ThumbnailComponent implements OnChanges { /** diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.spec.ts index 2479c1c1a0..d370c83a93 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.spec.ts @@ -4,8 +4,8 @@ import { } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { AdvancedWorkflowActionsLoaderComponent } from '../advanced-workflow-actions-loader/advanced-workflow-actions-loader.component'; +import { AdvancedWorkflowActionsLoaderComponent } from '../advanced-workflow-actions-loader/advanced-workflow-actions-loader.component'; import { AdvancedWorkflowActionPageComponent } from './advanced-workflow-action-page.component'; describe('AdvancedWorkflowActionPageComponent', () => { @@ -14,26 +14,26 @@ describe('AdvancedWorkflowActionPageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), AdvancedWorkflowActionPageComponent, - ], - providers: [ + ], + providers: [ { - provide: ActivatedRoute, - useValue: { - snapshot: { - queryParams: { - workflow: 'testaction', - }, - }, + provide: ActivatedRoute, + useValue: { + snapshot: { + queryParams: { + workflow: 'testaction', + }, }, + }, }, - ] -}).overrideComponent(AdvancedWorkflowActionPageComponent, { - remove: { imports: [AdvancedWorkflowActionsLoaderComponent] } -}) -.compileComponents(); + ], + }).overrideComponent(AdvancedWorkflowActionPageComponent, { + remove: { imports: [AdvancedWorkflowActionsLoaderComponent] }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.ts index a72d71db90..91796e826f 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.ts @@ -3,11 +3,10 @@ import { OnInit, } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { - AdvancedWorkflowActionsLoaderComponent -} from '../advanced-workflow-actions-loader/advanced-workflow-actions-loader.component'; import { TranslateModule } from '@ngx-translate/core'; +import { AdvancedWorkflowActionsLoaderComponent } from '../advanced-workflow-actions-loader/advanced-workflow-actions-loader.component'; + /** * The Advanced Workflow page containing the correct {@link AdvancedWorkflowActionComponent} * based on the route parameters. @@ -18,9 +17,9 @@ import { TranslateModule } from '@ngx-translate/core'; styleUrls: ['./advanced-workflow-action-page.component.scss'], imports: [ AdvancedWorkflowActionsLoaderComponent, - TranslateModule + TranslateModule, ], - standalone: true + standalone: true, }) export class AdvancedWorkflowActionPageComponent implements OnInit { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts index 29468b3d02..fe45023718 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.spec.ts @@ -65,29 +65,29 @@ describe('AdvancedWorkflowActionRatingComponent', () => { workflowItemDataService = new WorkflowItemDataServiceStub(); await TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, NgbModule, ReactiveFormsModule, TranslateModule.forRoot(), AdvancedWorkflowActionRatingComponent, - VarDirective - ], - providers: [ + VarDirective, + ], + providers: [ { - provide: ActivatedRoute, - useValue: { - data: observableOf({ - id: workflowId, - wfi: createSuccessfulRemoteDataObject(workflowItem), - }), - snapshot: { - queryParams: { - claimedTask: claimedTaskId, - workflow: 'testaction', - }, - }, + provide: ActivatedRoute, + useValue: { + data: observableOf({ + id: workflowId, + wfi: createSuccessfulRemoteDataObject(workflowItem), + }), + snapshot: { + queryParams: { + claimedTask: claimedTaskId, + workflow: 'testaction', + }, }, + }, }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: Location, useValue: new LocationStub() }, @@ -97,9 +97,9 @@ describe('AdvancedWorkflowActionRatingComponent', () => { { provide: WorkflowActionDataService, useValue: workflowActionDataService }, { provide: WorkflowItemDataService, useValue: workflowItemDataService }, { provide: RequestService, useClass: RequestServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts index 256472c082..a9e70f7f17 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts @@ -1,28 +1,37 @@ -import { Component, OnInit } from '@angular/core'; +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component, + Component, + OnInit, OnInit, } from '@angular/core'; import { + ReactiveFormsModule, + UntypedFormControl, UntypedFormControl, UntypedFormGroup, + UntypedFormGroup, + Validators, Validators, } from '@angular/forms'; - -import { RatingAdvancedWorkflowInfo } from '../../../core/tasks/models/rating-advanced-workflow-info.model'; -import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; -import { rendersAdvancedWorkflowTaskOption } from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator'; -import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component'; -import { ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; -import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; -import { RatingAdvancedWorkflowInfo } from '../../../core/tasks/models/rating-advanced-workflow-info.model'; -import { - ModifyItemOverviewComponent -} from '../../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; import { NgbRatingModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; + +import { + RatingAdvancedWorkflowInfo, + RatingAdvancedWorkflowInfo, +} from '../../../core/tasks/models/rating-advanced-workflow-info.model'; +import { + WorkflowAction, + WorkflowAction, +} from '../../../core/tasks/models/workflow-action-object.model'; +import { ModifyItemOverviewComponent } from '../../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { VarDirective } from '../../../shared/utils/var.directive'; +import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component'; export const ADVANCED_WORKFLOW_TASK_OPTION_RATING = 'submit_score'; export const ADVANCED_WORKFLOW_ACTION_RATING = 'scorereviewaction'; @@ -43,9 +52,9 @@ export const ADVANCED_WORKFLOW_ACTION_RATING = 'scorereviewaction'; NgbRatingModule, NgClass, ReactiveFormsModule, - VarDirective + VarDirective, ], - standalone: true + standalone: true, }) export class AdvancedWorkflowActionRatingComponent extends AdvancedWorkflowActionComponent implements OnInit { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts index 9cb7a81a90..eb79aa390c 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.spec.ts @@ -66,26 +66,26 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { workflowItemDataService = new WorkflowItemDataServiceStub(); await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - AdvancedWorkflowActionSelectReviewerComponent - ], - providers: [ + AdvancedWorkflowActionSelectReviewerComponent, + ], + providers: [ { - provide: ActivatedRoute, - useValue: { - data: observableOf({ - id: workflowId, - wfi: createSuccessfulRemoteDataObject(workflowItem), - }), - snapshot: { - queryParams: { - claimedTask: claimedTaskId, - workflow: 'testaction', - previousSearchQuery: 'Thor%20Love%20and%20Thunder', - }, - }, + provide: ActivatedRoute, + useValue: { + data: observableOf({ + id: workflowId, + wfi: createSuccessfulRemoteDataObject(workflowItem), + }), + snapshot: { + queryParams: { + claimedTask: claimedTaskId, + workflow: 'testaction', + previousSearchQuery: 'Thor%20Love%20and%20Thunder', + }, }, + }, }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: Location, useValue: location }, @@ -95,9 +95,9 @@ describe('AdvancedWorkflowActionSelectReviewerComponent', () => { { provide: WorkflowActionDataService, useValue: workflowActionDataService }, { provide: WorkflowItemDataService, useValue: workflowItemDataService }, { provide: RequestService, useClass: RequestServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts index 413740649d..7386658550 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts @@ -1,14 +1,14 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; -import { CommonModule, Location } from '@angular/common'; -import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component'; -import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; import { - SelectReviewerAdvancedWorkflowInfo -} from '../../../core/tasks/models/select-reviewer-advanced-workflow-info.model'; -import { Location } from '@angular/common'; + CommonModule, + Location, + Location, +} from '@angular/common'; import { + Component, Component, OnDestroy, + OnDestroy, + OnInit, OnInit, } from '@angular/core'; import { @@ -16,29 +16,42 @@ import { Params, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { EPersonListActionConfig } from '../../../access-control/group-registry/group-form/members-list/members-list.component'; import { RequestService } from '../../../core/data/request.service'; -import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; +import { + WorkflowActionDataService, + WorkflowActionDataService, +} from '../../../core/data/workflow-action-data.service'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { RouteService } from '../../../core/services/route.service'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service'; -import { SelectReviewerAdvancedWorkflowInfo } from '../../../core/tasks/models/select-reviewer-advanced-workflow-info.model'; -import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; +import { + SelectReviewerAdvancedWorkflowInfo, + SelectReviewerAdvancedWorkflowInfo, +} from '../../../core/tasks/models/select-reviewer-advanced-workflow-info.model'; +import { + WorkflowAction, + WorkflowAction, +} from '../../../core/tasks/models/workflow-action-object.model'; +import { ModifyItemOverviewComponent } from '../../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { hasValue } from '../../../shared/empty.util'; import { - ModifyItemOverviewComponent -} from '../../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; + NotificationsService, + NotificationsService, +} from '../../../shared/notifications/notifications.service'; +import { + AdvancedWorkflowActionComponent, + AdvancedWorkflowActionComponent, +} from '../advanced-workflow-action/advanced-workflow-action.component'; import { ReviewersListComponent } from './reviewers-list/reviewers-list.component'; -import { rendersAdvancedWorkflowTaskOption } from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator'; -import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { AdvancedWorkflowActionComponent } from '../advanced-workflow-action/advanced-workflow-action.component'; export const ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER = 'submit_select_reviewer'; export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction'; @@ -56,7 +69,7 @@ export const ADVANCED_WORKFLOW_ACTION_SELECT_REVIEWER = 'selectrevieweraction'; TranslateModule, ReviewersListComponent, ], - standalone: true + standalone: true, }) export class AdvancedWorkflowActionSelectReviewerComponent extends AdvancedWorkflowActionComponent implements OnInit, OnDestroy { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts index 01d2db22f1..8dee58795d 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts @@ -1,15 +1,44 @@ import { CommonModule } from '@angular/common'; -import { DebugElement, NO_ERRORS_SCHEMA, SimpleChange, } from '@angular/core'; -import { ComponentFixture, fakeAsync, flush, TestBed, waitForAsync, } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, } from '@angular/forms'; -import { BrowserModule, By, } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { + DebugElement, + NO_ERRORS_SCHEMA, + SimpleChange, +} from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + flush, + TestBed, + waitForAsync, +} from '@angular/core/testing'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + BrowserModule, + By, +} from '@angular/platform-browser'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; import { RestResponse } from '../../../../core/cache/response.models'; -import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model'; +import { + buildPaginatedList, + PaginatedList, +} from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { EPersonDataService } from '../../../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../../../core/eperson/group-data.service'; @@ -17,22 +46,25 @@ import { EPerson } from '../../../../core/eperson/models/eperson.model'; import { Group } from '../../../../core/eperson/models/group.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { PageInfo } from '../../../../core/shared/page-info.model'; +import { ContextHelpDirective } from '../../../../shared/context-help.directive'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock'; import { RouterMock } from '../../../../shared/mocks/router.mock'; import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; import { createNoContentRemoteDataObject$, createSuccessfulRemoteDataObject$, } from '../../../../shared/remote-data.utils'; -import { EPersonMock, EPersonMock2, } from '../../../../shared/testing/eperson.mock'; +import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; +import { + EPersonMock, + EPersonMock2, +} from '../../../../shared/testing/eperson.mock'; import { GroupMock } from '../../../../shared/testing/group-mock'; import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub'; import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub'; -import { ContextHelpDirective } from '../../../../shared/context-help.directive'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub'; import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock'; import { ReviewersListComponent } from './reviewers-list.component'; @@ -136,14 +168,14 @@ describe('ReviewersListComponent', () => { paginationService = new PaginationServiceStub(); return TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), ReviewersListComponent], - providers: [ReviewersListComponent, + providers: [ReviewersListComponent, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -151,15 +183,15 @@ describe('ReviewersListComponent', () => { { provide: Router, useValue: new RouterMock() }, { provide: PaginationService, useValue: paginationService }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA], -}) -.overrideComponent(ReviewersListComponent, { - remove: { - imports: [ContextHelpDirective, PaginationComponent] - } -}) -.compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(ReviewersListComponent, { + remove: { + imports: [ContextHelpDirective, PaginationComponent], + }, + }) + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts index ff70b4de7f..60ab557432 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts @@ -1,7 +1,31 @@ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; -import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; -import { Router, RouterLink } from '@angular/router'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + Component, + EventEmitter, + Input, + OnChanges, + OnDestroy, + OnInit, + Output, + SimpleChanges, +} from '@angular/core'; +import { + ReactiveFormsModule, + UntypedFormBuilder, +} from '@angular/forms'; +import { + Router, + RouterLink, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { EPersonListActionConfig, @@ -16,9 +40,8 @@ import { Group } from '../../../../core/eperson/models/group.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/operators'; import { ContextHelpDirective } from '../../../../shared/context-help.directive'; -import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; /** * Keys to keep track of specific subscriptions @@ -46,7 +69,7 @@ enum SubKey { AsyncPipe, RouterLink, NgClass, - NgForOf + NgForOf, ], }) export class ReviewersListComponent extends MembersListComponent implements OnInit, OnChanges, OnDestroy { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts index d82265a772..653ffde80e 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts @@ -10,7 +10,10 @@ import { TranslateModule } from '@ngx-translate/core'; import { MockComponent } from 'ng-mocks'; import { of as observableOf } from 'rxjs'; -import { RequestService } from '../../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; import { RouteService } from '../../../core/services/route.service'; import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; @@ -19,14 +22,14 @@ import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-res import { DSOSelectorComponent } from '../../../shared/dso-selector/dso-selector/dso-selector.component'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ClaimedTaskDataServiceStub } from '../../../shared/testing/claimed-task-data-service.stub'; -import { LocationStub } from '../../../shared/testing/location.stub'; import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub'; -import { RequestServiceStub } from '../../../shared/testing/request-service.stub'; +import { + RequestServiceStub, + RequestServiceStub, +} from '../../../shared/testing/request-service.stub'; import { routeServiceStub } from '../../../shared/testing/route-service.stub'; import { WorkflowActionDataServiceStub } from '../../../shared/testing/workflow-action-data-service.stub'; import { WorkflowItemDataServiceStub } from '../../../shared/testing/workflow-item-data-service.stub'; -import { RequestService } from '../../../core/data/request.service'; -import { RequestServiceStub } from '../../../shared/testing/request-service.stub'; import { WorkflowItemActionPageDirective } from '../../workflow-item-action-page.component'; import { AdvancedWorkflowActionComponent } from './advanced-workflow-action.component'; @@ -50,26 +53,26 @@ describe('AdvancedWorkflowActionComponent', () => { mockLocation = jasmine.createSpyObj(['getState']); await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule, TestComponent, WorkflowItemActionPageDirective, - MockComponent(DSOSelectorComponent) - ], - providers: [ + MockComponent(DSOSelectorComponent), + ], + providers: [ { - provide: ActivatedRoute, - useValue: { - data: observableOf({ - id: workflowId, - }), - snapshot: { - queryParams: { - workflow: 'testaction', - }, - }, + provide: ActivatedRoute, + useValue: { + data: observableOf({ + id: workflowId, + }), + snapshot: { + queryParams: { + workflow: 'testaction', + }, }, + }, }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: Location, useValue: mockLocation }, @@ -78,7 +81,7 @@ describe('AdvancedWorkflowActionComponent', () => { { provide: WorkflowActionDataService, useValue: workflowActionDataService }, { provide: WorkflowItemDataService, useValue: workflowItemDataService }, { provide: RequestService, useClass: RequestServiceStub }, - ] + ], }) .compileComponents(); }); @@ -122,11 +125,11 @@ describe('AdvancedWorkflowActionComponent', () => { }); @Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: '', - template: '', - standalone: true, - imports: [RouterTestingModule] + // eslint-disable-next-line @angular-eslint/component-selector + selector: '', + template: '', + standalone: true, + imports: [RouterTestingModule], }) class TestComponent extends AdvancedWorkflowActionComponent { diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.ts index b3484eaf61..a09989a97a 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.ts @@ -5,26 +5,30 @@ import { } from '@angular/core'; import { ActivatedRoute, + ActivatedRoute, + Router, Router, } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { Observable } from 'rxjs'; +import { + Observable, + Observable, +} from 'rxjs'; import { map } from 'rxjs/operators'; import { RequestService } from '../../../core/data/request.service'; import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Observable } from 'rxjs'; -import { WorkflowItemActionPageDirective } from '../../workflow-item-action-page.component'; -import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; import { RouteService } from '../../../core/services/route.service'; import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; -import { WorkflowItemDataService } from '../../../core/submission/workflowitem-data.service'; +import { + WorkflowItemDataService, + WorkflowItemDataService, +} from '../../../core/submission/workflowitem-data.service'; import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; import { WorkflowAction } from '../../../core/tasks/models/workflow-action-object.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { WorkflowItemActionPageComponent } from '../../workflow-item-action-page.component'; +import { WorkflowItemActionPageDirective } from '../../workflow-item-action-page.component'; /** * Abstract component for rendering an advanced claimed task's workflow page diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts index 9002ddd690..f29278b0c1 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts @@ -1,8 +1,4 @@ /* eslint-disable max-classes-per-file */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { AdvancedWorkflowActionsLoaderComponent } from './advanced-workflow-actions-loader.component'; -import { Router } from '@angular/router'; -import { RouterStub } from '../../../shared/testing/router.stub'; import { ChangeDetectionStrategy, Component, @@ -10,31 +6,42 @@ import { Directive, Injector, NO_ERRORS_SCHEMA, - ViewContainerRef + ViewContainerRef, } from '@angular/core'; -import { - DynamicComponentLoaderDirective -} from '../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { ChangeDetectionStrategy, Component, } from '@angular/core'; import { ComponentFixture, + ComponentFixture, + TestBed, TestBed, } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Router } from '@angular/router'; +import { + Router, + Router, +} from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslateModule } from '@ngx-translate/core'; import { getMockThemeService } from 'src/app/shared/mocks/theme-service.mock'; import { ThemeService } from 'src/app/shared/theme-support/theme.service'; import { PAGE_NOT_FOUND_PATH } from '../../../app-routing-paths'; -import { DynamicComponentLoaderDirective } from '../../../shared/abstract-component-loader/dynamic-component-loader.directive'; +import { + DynamicComponentLoaderDirective, + DynamicComponentLoaderDirective, +} from '../../../shared/abstract-component-loader/dynamic-component-loader.directive'; import { rendersAdvancedWorkflowTaskOption } from '../../../shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator'; -import { RouterStub } from '../../../shared/testing/router.stub'; -import { AdvancedWorkflowActionsLoaderComponent } from './advanced-workflow-actions-loader.component'; -import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { + RouterStub, + RouterStub, +} from '../../../shared/testing/router.stub'; +import { + AdvancedWorkflowActionsLoaderComponent, + AdvancedWorkflowActionsLoaderComponent, +} from './advanced-workflow-actions-loader.component'; const ADVANCED_WORKFLOW_ACTION_TEST = 'testaction'; @@ -50,7 +57,7 @@ describe('AdvancedWorkflowActionsLoaderComponent', () => { router = new RouterStub(); mockComponentFactoryResolver = { resolveComponentFactory: jasmine.createSpy('resolveComponentFactory').and.returnValue( - AdvancedWorkflowActionTestComponent + AdvancedWorkflowActionTestComponent, ), }; themeService = getMockThemeService(); @@ -70,7 +77,7 @@ describe('AdvancedWorkflowActionsLoaderComponent', () => { ViewContainerRef, { provide: ThemeService, useValue: themeService }, ], - schemas: [NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }).overrideComponent(AdvancedWorkflowActionsLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, @@ -120,14 +127,14 @@ describe('AdvancedWorkflowActionsLoaderComponent', () => { // eslint-disable-next-line @angular-eslint/component-selector selector: '', template: '', - standalone: true + standalone: true, }) class AdvancedWorkflowActionTestComponent { } @Directive({ selector: '[dsAdvancedWorkflowActions]', - standalone: true + standalone: true, }) export class MockAdvancedWorkflowActionsDirective { constructor(public viewContainerRef: ViewContainerRef) {} diff --git a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.ts b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.ts index ab7c7f7168..799e06d863 100644 --- a/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.ts +++ b/src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.ts @@ -16,9 +16,9 @@ import { ThemeService } from '../../../shared/theme-support/theme.service'; * Component for loading a {@link AdvancedWorkflowActionComponent} depending on the "{@link type}" input */ @Component({ - selector: 'ds-advanced-workflow-actions-loader', - templateUrl: '../../../shared/abstract-component-loader/abstract-component-loader.component.html', - standalone: true, + selector: 'ds-advanced-workflow-actions-loader', + templateUrl: '../../../shared/abstract-component-loader/abstract-component-loader.component.html', + standalone: true, }) export class AdvancedWorkflowActionsLoaderComponent extends AbstractComponentLoaderComponent implements OnInit { diff --git a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts index e38e8e8a47..64fb97147b 100644 --- a/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts @@ -1,27 +1,49 @@ -import { CommonModule, Location } from '@angular/common'; -import { Component, NO_ERRORS_SCHEMA, } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing'; +import { + CommonModule, + Location, +} from '@angular/common'; +import { + Component, + NO_ERRORS_SCHEMA, +} from '@angular/core'; +import { + ComponentFixture, + TestBed, + waitForAsync, +} from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core'; -import { Observable, of as observableOf, } from 'rxjs'; -import { WorkflowItemActionPageDirective } from './workflow-item-action-page.component'; -import { NotificationsService } from '../shared/notifications/notifications.service'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; +import { + Observable, + of as observableOf, +} from 'rxjs'; + import { RequestService } from '../core/data/request.service'; import { RouteService } from '../core/services/route.service'; import { WorkflowItem } from '../core/submission/models/workflowitem.model'; import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service'; +import { ModifyItemOverviewComponent } from '../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { TranslateLoaderMock } from '../shared/mocks/translate-loader.mock'; -import { createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject$, } from '../shared/remote-data.utils'; +import { NotificationsService } from '../shared/notifications/notifications.service'; +import { + createSuccessfulRemoteDataObject, + createSuccessfulRemoteDataObject$, +} from '../shared/remote-data.utils'; import { ActivatedRouteStub } from '../shared/testing/active-router.stub'; import { LocationStub } from '../shared/testing/location.stub'; import { NotificationsServiceStub } from '../shared/testing/notifications-service.stub'; import { RequestServiceStub } from '../shared/testing/request-service.stub'; -import { - ModifyItemOverviewComponent -} from '../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { RouterStub } from '../shared/testing/router.stub'; import { VarDirective } from '../shared/utils/var.directive'; +import { WorkflowItemActionPageDirective } from './workflow-item-action-page.component'; const type = 'testType'; describe('WorkflowItemActionPageComponent', () => { @@ -45,13 +67,13 @@ describe('WorkflowItemActionPageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), TestComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), TestComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub({}, { wfi: createSuccessfulRemoteDataObject(wfi) }) }, { provide: Router, useClass: RouterStub }, { provide: RouteService, useValue: {} }, @@ -59,9 +81,9 @@ describe('WorkflowItemActionPageComponent', () => { { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: WorkflowItemDataService, useValue: wfiService }, { provide: RequestService, useClass: RequestServiceStub }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); @@ -110,7 +132,7 @@ describe('WorkflowItemActionPageComponent', () => { selector: 'ds-workflow-item-test-action-page', templateUrl: 'workflow-item-action-page.component.html', imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], - standalone: true + standalone: true, }) class TestComponent extends WorkflowItemActionPageDirective { constructor(protected route: ActivatedRoute, diff --git a/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts b/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts index 988e4855b3..6e1a9b3a31 100644 --- a/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-action-page.component.ts @@ -1,15 +1,33 @@ -import { Directive, OnInit } from '@angular/core'; import { Location } from '@angular/common'; -import { ActivatedRoute, Data, Params, Router, } from '@angular/router'; +import { + Directive, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Data, + Params, + Router, +} from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { combineLatest, Observable, } from 'rxjs'; -import { map, switchMap, take, } from 'rxjs/operators'; +import { + combineLatest, + Observable, +} from 'rxjs'; +import { + map, + switchMap, + take, +} from 'rxjs/operators'; import { RemoteData } from '../core/data/remote-data'; import { RequestService } from '../core/data/request.service'; import { RouteService } from '../core/services/route.service'; import { Item } from '../core/shared/item.model'; -import { getAllSucceededRemoteData, getRemoteDataPayload, } from '../core/shared/operators'; +import { + getAllSucceededRemoteData, + getRemoteDataPayload, +} from '../core/shared/operators'; import { WorkflowItem } from '../core/submission/models/workflowitem.model'; import { WorkflowItemDataService } from '../core/submission/workflowitem-data.service'; import { isEmpty } from '../shared/empty.util'; @@ -21,7 +39,7 @@ import { NotificationsService } from '../shared/notifications/notifications.serv @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: 'ds-workflowitem-action-page', - standalone: true + standalone: true, }) export abstract class WorkflowItemActionPageDirective implements OnInit { public type; diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts b/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts index e69c788b6a..4be1b65741 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts @@ -8,10 +8,10 @@ import { WorkflowItemDeleteComponent } from './workflow-item-delete.component'; */ @Component({ - selector: 'ds-themed-workflow-item-delete', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-workflow-item-delete', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedWorkflowItemDeleteComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts index c07b233143..801113c4ce 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts @@ -54,13 +54,13 @@ describe('WorkflowItemDeleteComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), WorkflowItemDeleteComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), WorkflowItemDeleteComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub({}, { wfi: createSuccessfulRemoteDataObject(wfi) }) }, { provide: Router, useClass: RouterStub }, { provide: RouteService, useValue: {} }, @@ -68,9 +68,9 @@ describe('WorkflowItemDeleteComponent', () => { { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: WorkflowItemDataService, useValue: wfiService }, { provide: RequestService, useValue: getMockRequestService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts index 4a64f00617..3d5fae9fe6 100644 --- a/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts @@ -1,28 +1,35 @@ -import { CommonModule, Location } from '@angular/common'; +import { + CommonModule, + Location, +} from '@angular/common'; import { Component } from '@angular/core'; +import { + ActivatedRoute, + Router, +} from '@angular/router'; +import { + TranslateModule, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.component'; -import { ActivatedRoute, Router } from '@angular/router'; -import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; -import { RouteService } from '../../core/services/route.service'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { RequestService } from '../../core/data/request.service'; import { map } from 'rxjs/operators'; import { RemoteData } from '../../core/data/remote-data'; +import { RequestService } from '../../core/data/request.service'; +import { RouteService } from '../../core/services/route.service'; import { NoContent } from '../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; +import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; +import { ModifyItemOverviewComponent } from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; import { VarDirective } from '../../shared/utils/var.directive'; -import { - ModifyItemOverviewComponent -} from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.component'; @Component({ selector: 'ds-workflow-item-delete', templateUrl: '../workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent] + imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], }) /** * Component representing a page to delete a workflow item diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts index 0d13386bcd..ecf7c965b6 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts @@ -8,10 +8,10 @@ import { WorkflowItemSendBackComponent } from './workflow-item-send-back.compone */ @Component({ - selector: 'ds-themed-workflow-item-send-back', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true + selector: 'ds-themed-workflow-item-send-back', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, }) export class ThemedWorkflowItemSendBackComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts index 682ec068fa..2a25bc0cc6 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts @@ -54,13 +54,13 @@ describe('WorkflowItemSendBackComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, - }), WorkflowItemSendBackComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, + }), WorkflowItemSendBackComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: new ActivatedRouteStub({}, { wfi: createSuccessfulRemoteDataObject(wfi) }) }, { provide: Router, useClass: RouterStub }, { provide: RouteService, useValue: {} }, @@ -68,9 +68,9 @@ describe('WorkflowItemSendBackComponent', () => { { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: WorkflowItemDataService, useValue: wfiService }, { provide: RequestService, useValue: getMockRequestService() }, - ], + ], schemas: [NO_ERRORS_SCHEMA], -}) + }) .compileComponents(); })); diff --git a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts index 0d0b66f7ec..1d9e95c14e 100644 --- a/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts +++ b/src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts @@ -1,31 +1,36 @@ -import { Location } from '@angular/common'; +import { + CommonModule, + Location, + Location, +} from '@angular/common'; import { Component } from '@angular/core'; -import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.component'; import { ActivatedRoute, Router, } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { RequestService } from '../../core/data/request.service'; +import { + RequestService, + RequestService, +} from '../../core/data/request.service'; import { RouteService } from '../../core/services/route.service'; import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; +import { ModifyItemOverviewComponent } from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { RequestService } from '../../core/data/request.service'; -import { CommonModule, Location } from '@angular/common'; -import { - ModifyItemOverviewComponent -} from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { VarDirective } from '../../shared/utils/var.directive'; -import { WorkflowItemActionPageComponent } from '../workflow-item-action-page.component'; +import { WorkflowItemActionPageDirective } from '../workflow-item-action-page.component'; @Component({ selector: 'ds-workflow-item-send-back', templateUrl: '../workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent] + imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], }) /** * Component representing a page to send back a workflow item to the submitter diff --git a/src/app/workflowitems-edit-page/workflowitems-edit-page-routes.ts b/src/app/workflowitems-edit-page/workflowitems-edit-page-routes.ts index 7b372df7e3..0b38b17364 100644 --- a/src/app/workflowitems-edit-page/workflowitems-edit-page-routes.ts +++ b/src/app/workflowitems-edit-page/workflowitems-edit-page-routes.ts @@ -1,7 +1,15 @@ import { Routes } from '@angular/router'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; +import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; +import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component'; +import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component'; +import { provideSubmission } from '../submission/provide-submission'; +import { AdvancedWorkflowActionPageComponent } from './advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component'; +import { ItemFromWorkflowResolver } from './item-from-workflow.resolver'; +import { ThemedWorkflowItemDeleteComponent } from './workflow-item-delete/themed-workflow-item-delete.component'; import { WorkflowItemPageResolver } from './workflow-item-page.resolver'; +import { ThemedWorkflowItemSendBackComponent } from './workflow-item-send-back/themed-workflow-item-send-back.component'; import { ADVANCED_WORKFLOW_PATH, WORKFLOW_ITEM_DELETE_PATH, @@ -9,23 +17,11 @@ import { WORKFLOW_ITEM_SEND_BACK_PATH, WORKFLOW_ITEM_VIEW_PATH, } from './workflowitems-edit-page-routing-paths'; -import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component'; -import { ThemedWorkflowItemDeleteComponent } from './workflow-item-delete/themed-workflow-item-delete.component'; -import { - ThemedWorkflowItemSendBackComponent -} from './workflow-item-send-back/themed-workflow-item-send-back.component'; -import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { ItemFromWorkflowResolver } from './item-from-workflow.resolver'; -import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component'; -import { - AdvancedWorkflowActionPageComponent -} from './advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component'; -import { provideSubmission } from '../submission/provide-submission'; export const ROUTES: Routes = [ { path: ':id', - resolve: {wfi: WorkflowItemPageResolver}, + resolve: { wfi: WorkflowItemPageResolver }, providers: [WorkflowItemPageResolver, ItemFromWorkflowResolver, provideSubmission()], children: [ { @@ -33,13 +29,13 @@ export const ROUTES: Routes = [ path: WORKFLOW_ITEM_EDIT_PATH, component: ThemedSubmissionEditComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, data: { title: 'workflow-item.edit.title', breadcrumbKey: 'workflow-item.edit', - collectionModifiable: false - } + collectionModifiable: false, + }, }, { canActivate: [AuthenticatedGuard], @@ -47,37 +43,37 @@ export const ROUTES: Routes = [ component: ThemedFullItemPageComponent, resolve: { dso: ItemFromWorkflowResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workflow-item.view.title', breadcrumbKey: 'workflow-item.view'} + data: { title: 'workflow-item.view.title', breadcrumbKey: 'workflow-item.view' }, }, { canActivate: [AuthenticatedGuard], path: WORKFLOW_ITEM_DELETE_PATH, component: ThemedWorkflowItemDeleteComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workflow-item.delete.title', breadcrumbKey: 'workflow-item.edit'} + data: { title: 'workflow-item.delete.title', breadcrumbKey: 'workflow-item.edit' }, }, { canActivate: [AuthenticatedGuard], path: WORKFLOW_ITEM_SEND_BACK_PATH, component: ThemedWorkflowItemSendBackComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workflow-item.send-back.title', breadcrumbKey: 'workflow-item.edit'} + data: { title: 'workflow-item.send-back.title', breadcrumbKey: 'workflow-item.edit' }, }, { canActivate: [AuthenticatedGuard], path: ADVANCED_WORKFLOW_PATH, component: AdvancedWorkflowActionPageComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workflow-item.advanced.title', breadcrumbKey: 'workflow-item.edit'} + data: { title: 'workflow-item.advanced.title', breadcrumbKey: 'workflow-item.edit' }, }, - ] - } + ], + }, ]; diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts index 424c5a1fd0..b335c1dbd0 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts @@ -1,27 +1,25 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { ModifyItemOverviewComponent } from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; import { ThemedComponent } from '../../shared/theme-support/themed.component'; import { WorkspaceItemsDeletePageComponent } from './workspaceitems-delete-page.component'; -import { - ModifyItemOverviewComponent -} from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { CommonModule } from '@angular/common'; /** * Themed wrapper for WorkspaceItemsDeletePageComponent */ @Component({ - selector: 'ds-themed-workspace-items-delete', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', - standalone: true, - imports: [ - ModifyItemOverviewComponent, - TranslateModule, - CommonModule - ] + selector: 'ds-themed-workspace-items-delete', + styleUrls: [], + templateUrl: './../../shared/theme-support/themed.component.html', + standalone: true, + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + CommonModule, + ], }) export class ThemedWorkspaceItemsDeletePageComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts index 791cee1bbf..2dd564ac56 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts @@ -54,35 +54,35 @@ describe('WorkspaceitemsDeletePageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModalModule, TranslateModule.forRoot(), - WorkspaceItemsDeletePageComponent - ], - providers: [ + WorkspaceItemsDeletePageComponent, + ], + providers: [ { - provide: ActivatedRoute, - useValue: new ActivatedRouteStub({}, { - wsi: createSuccessfulRemoteDataObject(wsi), - dso: createSuccessfulRemoteDataObject(dso), - }, + provide: ActivatedRoute, + useValue: new ActivatedRouteStub({}, { + wsi: createSuccessfulRemoteDataObject(wsi), + dso: createSuccessfulRemoteDataObject(dso), + }, ), }, { provide: Router, useValue: new RouterMock() }, { - provide: WorkspaceitemDataService, - useValue: workspaceitemDataServiceSpy, + provide: WorkspaceitemDataService, + useValue: workspaceitemDataServiceSpy, }, { provide: Location, useValue: new LocationStub() }, { - provide: NotificationsService, - useValue: new NotificationsServiceStub(), + provide: NotificationsService, + useValue: new NotificationsServiceStub(), }, { provide: TranslateService, useValue: translateServiceStub }, { provide: RouteService, useValue: routeServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] -}).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA], + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts index 5df7d0beaf..5deb449745 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts @@ -1,30 +1,52 @@ -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { NoContent } from '../../core/shared/NoContent.model'; -import { RouteService } from '../../core/services/route.service'; -import { getFirstCompletedRemoteData, getRemoteDataPayload } from '../../core/shared/operators'; -import { RemoteData } from '../../core/data/remote-data'; -import { Component, OnInit } from '@angular/core'; -import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; -import { map, Observable, switchMap, take } from 'rxjs'; -import { ActivatedRoute, Data, Params, Router } from '@angular/router'; -import { CommonModule, Location } from '@angular/common'; -import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + CommonModule, + Location, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; +import { + ActivatedRoute, + Data, + Params, + Router, +} from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { + TranslateModule, + TranslateService, + TranslateService, +} from '@ngx-translate/core'; import { map, + map, + Observable, Observable, switchMap, + switchMap, + take, take, } from 'rxjs'; -import { RemoteData } from '../../core/data/remote-data'; -import { RouteService } from '../../core/services/route.service'; -import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { - ModifyItemOverviewComponent -} from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; + RemoteData, + RemoteData, +} from '../../core/data/remote-data'; +import { + RouteService, + RouteService, +} from '../../core/services/route.service'; +import { DSpaceObject } from '../../core/shared/dspace-object.model'; +import { NoContent } from '../../core/shared/NoContent.model'; +import { + getFirstCompletedRemoteData, + getRemoteDataPayload, +} from '../../core/shared/operators'; +import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model'; +import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; +import { ModifyItemOverviewComponent } from '../../item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; @Component({ selector: 'ds-workspaceitems-delete-page', @@ -33,9 +55,9 @@ import { imports: [ ModifyItemOverviewComponent, TranslateModule, - CommonModule + CommonModule, ], - standalone: true + standalone: true, }) export class WorkspaceItemsDeletePageComponent implements OnInit { diff --git a/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts b/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts index 9664e5c954..e6e4726857 100644 --- a/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts +++ b/src/app/workspaceitems-edit-page/workspaceitems-edit-page-routes.ts @@ -1,16 +1,14 @@ import { Route } from '@angular/router'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; -import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { ThemedFullItemPageComponent } from '../item-page/full/themed-full-item-page.component'; +import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component'; +import { provideSubmission } from '../submission/provide-submission'; import { ItemFromWorkspaceResolver } from './item-from-workspace.resolver'; import { WorkspaceItemPageResolver } from './workspace-item-page.resolver'; +import { ThemedWorkspaceItemsDeletePageComponent } from './workspaceitems-delete-page/themed-workspaceitems-delete-page.component'; import { WorkspaceItemsDeletePageComponent } from './workspaceitems-delete-page/workspaceitems-delete-page.component'; -import { - ThemedWorkspaceItemsDeletePageComponent -} from './workspaceitems-delete-page/themed-workspaceitems-delete-page.component'; -import { provideSubmission } from '../submission/provide-submission'; const providers = [ WorkspaceItemPageResolver, @@ -22,21 +20,21 @@ export const ROUTES: Route[] = [ { path: '', providers, - redirectTo: '/home', pathMatch: 'full' + redirectTo: '/home', pathMatch: 'full', }, { path: ':id', providers, - resolve: {wsi: WorkspaceItemPageResolver}, + resolve: { wsi: WorkspaceItemPageResolver }, children: [ { canActivate: [AuthenticatedGuard], path: 'edit', component: ThemedSubmissionEditComponent, resolve: { - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'submission.edit.title', breadcrumbKey: 'submission.edit'} + data: { title: 'submission.edit.title', breadcrumbKey: 'submission.edit' }, }, { canActivate: [AuthenticatedGuard], @@ -44,9 +42,9 @@ export const ROUTES: Route[] = [ component: ThemedFullItemPageComponent, resolve: { dso: ItemFromWorkspaceResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workspace-item.view.title', breadcrumbKey: 'workspace-item.view'} + data: { title: 'workspace-item.view.title', breadcrumbKey: 'workspace-item.view' }, }, { canActivate: [AuthenticatedGuard], @@ -54,9 +52,9 @@ export const ROUTES: Route[] = [ component: WorkspaceItemsDeletePageComponent, resolve: { dso: ItemFromWorkspaceResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete'} + data: { title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete' }, }, { canActivate: [AuthenticatedGuard], @@ -64,10 +62,10 @@ export const ROUTES: Route[] = [ component: ThemedWorkspaceItemsDeletePageComponent, resolve: { dso: ItemFromWorkspaceResolver, - breadcrumb: I18nBreadcrumbResolver + breadcrumb: I18nBreadcrumbResolver, }, - data: {title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete'} + data: { title: 'workspace-item.delete', breadcrumbKey: 'workspace-item.delete' }, }, - ] - } + ], + }, ]; diff --git a/src/config/app-config.interface.ts b/src/config/app-config.interface.ts index f101e6af22..9c06ca145d 100644 --- a/src/config/app-config.interface.ts +++ b/src/config/app-config.interface.ts @@ -1,7 +1,12 @@ -import { InjectionToken, Type } from '@angular/core'; +import { + InjectionToken, + Type, +} from '@angular/core'; import { makeStateKey } from '@angular/platform-browser'; +import { DynamicFormControl } from '@ng-dynamic-forms/core/lib/component/dynamic-form-control-interface'; import { AdminNotifyMetricsRow } from '../app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.model'; +import { HALDataService } from '../app/core/data/base/hal-data-service.interface'; import { ActuatorsConfig } from './actuators.config'; import { AuthConfig } from './auth-config.interfaces'; import { BrowseByConfig } from './browse-by-config.interface'; @@ -23,9 +28,6 @@ import { MediaViewerConfig } from './media-viewer-config.interface'; import { INotificationBoardOptions } from './notifications-config.interfaces'; import { QualityAssuranceConfig } from './quality-assurance.config'; import { SearchConfig } from './search-page-config.interface'; -import { HALDataService } from '../app/core/data/base/hal-data-service.interface'; -import { DynamicFormControl } from '@ng-dynamic-forms/core/lib/component/dynamic-form-control-interface'; - import { ServerConfig } from './server-config.interface'; import { SubmissionConfig } from './submission-config.interface'; import { SuggestionConfig } from './suggestion-config.interfaces'; diff --git a/src/modules/app/browser-app.module.ts b/src/modules/app/browser-app.module.ts index b4dbcfc71f..24b17d6c1f 100644 --- a/src/modules/app/browser-app.module.ts +++ b/src/modules/app/browser-app.module.ts @@ -10,6 +10,12 @@ import { TransferState, } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { EffectsModule } from '@ngrx/effects'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; import { REQUEST } from '@nguniversal/express-engine/tokens'; import { TranslateLoader, @@ -23,11 +29,18 @@ import { import { AppComponent } from '../../app/app.component'; import { AppModule } from '../../app/app.module'; +import { storeModuleConfig } from '../../app/app.reducer'; import { AuthService } from '../../app/core/auth/auth.service'; import { AuthRequestService } from '../../app/core/auth/auth-request.service'; import { BrowserAuthRequestService } from '../../app/core/auth/browser-auth-request.service'; +import { coreEffects } from '../../app/core/core.effects'; +import { coreReducers } from '../../app/core/core.reducers'; +import { CoreState } from '../../app/core/core-state.model'; import { LocaleService } from '../../app/core/locale/locale.service'; -import { BrowserReferrerService } from '../../app/core/services/browser.referrer.service'; +import { + BrowserReferrerService, + BrowserReferrerService, +} from '../../app/core/services/browser.referrer.service'; import { BrowserHardRedirectService, locationProvider, @@ -36,7 +49,10 @@ import { import { ClientCookieService } from '../../app/core/services/client-cookie.service'; import { CookieService } from '../../app/core/services/cookie.service'; import { HardRedirectService } from '../../app/core/services/hard-redirect.service'; -import { ReferrerService } from '../../app/core/services/referrer.service'; +import { + ReferrerService, + ReferrerService, +} from '../../app/core/services/referrer.service'; import { BrowserKlaroService } from '../../app/shared/cookies/browser-klaro.service'; import { KlaroService } from '../../app/shared/cookies/klaro.service'; import { GoogleAnalyticsService } from '../../app/statistics/google-analytics.service'; @@ -44,14 +60,6 @@ import { StatisticsModule } from '../../app/statistics/statistics.module'; import { SubmissionService } from '../../app/submission/submission.service'; import { TranslateBrowserLoader } from '../../ngx-translate-loaders/translate-browser.loader'; import { BrowserInitService } from './browser-init.service'; -import { ReferrerService } from '../../app/core/services/referrer.service'; -import { BrowserReferrerService } from '../../app/core/services/browser.referrer.service'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; -import { coreReducers } from '../../app/core/core.reducers'; -import { storeModuleConfig } from '../../app/app.reducer'; -import { CoreState } from '../../app/core/core-state.model'; -import { EffectsModule } from '@ngrx/effects'; -import { coreEffects } from '../../app/core/core.effects'; export const REQ_KEY = makeStateKey('req'); diff --git a/src/modules/app/server-app.module.ts b/src/modules/app/server-app.module.ts index 829fedbf2a..8b3577c790 100644 --- a/src/modules/app/server-app.module.ts +++ b/src/modules/app/server-app.module.ts @@ -1,4 +1,7 @@ -import { XhrFactory } from '@angular/common'; +import { + XhrFactory, + XhrFactory, +} from '@angular/common'; import { HTTP_INTERCEPTORS } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { @@ -10,6 +13,12 @@ import { ServerModule, ServerTransferStateModule, } from '@angular/platform-server'; +import { EffectsModule } from '@ngrx/effects'; +import { + Action, + StoreConfig, + StoreModule, +} from '@ngrx/store'; import { TranslateLoader, TranslateModule, @@ -22,20 +31,33 @@ import { import { AppComponent } from '../../app/app.component'; import { AppModule } from '../../app/app.module'; +import { storeModuleConfig } from '../../app/app.reducer'; import { AuthService } from '../../app/core/auth/auth.service'; import { AuthRequestService } from '../../app/core/auth/auth-request.service'; import { ServerAuthService } from '../../app/core/auth/server-auth.service'; import { ServerAuthRequestService } from '../../app/core/auth/server-auth-request.service'; +import { coreEffects } from '../../app/core/core.effects'; +import { coreReducers } from '../../app/core/core.reducers'; +import { CoreState } from '../../app/core/core-state.model'; import { ForwardClientIpInterceptor } from '../../app/core/forward-client-ip/forward-client-ip.interceptor'; import { LocaleService } from '../../app/core/locale/locale.service'; import { ServerLocaleService } from '../../app/core/locale/server-locale.service'; import { CookieService } from '../../app/core/services/cookie.service'; import { HardRedirectService } from '../../app/core/services/hard-redirect.service'; -import { ReferrerService } from '../../app/core/services/referrer.service'; -import { ServerReferrerService } from '../../app/core/services/server.referrer.service'; +import { + ReferrerService, + ReferrerService, +} from '../../app/core/services/referrer.service'; +import { + ServerReferrerService, + ServerReferrerService, +} from '../../app/core/services/server.referrer.service'; import { ServerCookieService } from '../../app/core/services/server-cookie.service'; import { ServerHardRedirectService } from '../../app/core/services/server-hard-redirect.service'; -import { ServerXhrService } from '../../app/core/services/server-xhr.service'; +import { + ServerXhrService, + ServerXhrService, +} from '../../app/core/services/server-xhr.service'; import { AngularticsProviderMock } from '../../app/shared/mocks/angulartics-provider.service.mock'; import { Angulartics2Mock } from '../../app/shared/mocks/angulartics2.service.mock'; import { Angulartics2DSpace } from '../../app/statistics/angulartics/dspace-provider'; @@ -43,16 +65,6 @@ import { ServerSubmissionService } from '../../app/submission/server-submission. import { SubmissionService } from '../../app/submission/submission.service'; import { TranslateServerLoader } from '../../ngx-translate-loaders/translate-server.loader'; import { ServerInitService } from './server-init.service'; -import { XhrFactory } from '@angular/common'; -import { ServerXhrService } from '../../app/core/services/server-xhr.service'; -import { ReferrerService } from '../../app/core/services/referrer.service'; -import { ServerReferrerService } from '../../app/core/services/server.referrer.service'; -import { Action, StoreConfig, StoreModule } from '@ngrx/store'; -import { coreReducers } from '../../app/core/core.reducers'; -import { storeModuleConfig } from '../../app/app.reducer'; -import { CoreState } from '../../app/core/core-state.model'; -import { EffectsModule } from '@ngrx/effects'; -import { coreEffects } from '../../app/core/core.effects'; export function createTranslateLoader(transferState: TransferState) { return new TranslateServerLoader(transferState, 'dist/server/assets/i18n/', '.json'); diff --git a/src/test.ts b/src/test.ts index 901452295c..20edf3b7f7 100644 --- a/src/test.ts +++ b/src/test.ts @@ -3,8 +3,9 @@ import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; - -import { BrowserDynamicTestingModule, platformBrowserDynamicTesting , +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MockStore } from '@ngrx/store/testing'; diff --git a/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts b/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts index bab8efd7d2..dfaf4cad5b 100644 --- a/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -1,10 +1,16 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { AdminSidebarComponent as BaseComponent } from '../../../../../app/admin/admin-sidebar/admin-sidebar.component'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/common'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { AdminSidebarComponent as BaseComponent } from '../../../../../app/admin/admin-sidebar/admin-sidebar.component'; + /** * Component representing the admin sidebar */ @@ -15,7 +21,7 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['./admin-sidebar.component.scss'] styleUrls: ['../../../../../app/admin/admin-sidebar/admin-sidebar.component.scss'], standalone: true, - imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule] + imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule], }) export class AdminSidebarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts index 84e7b9feeb..ada22abcef 100644 --- a/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts +++ b/src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts @@ -1,22 +1,26 @@ import { - EditBitstreamPageComponent as BaseComponent -} from '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { FormComponent } from '../../../../../app/shared/form/form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { ThemedThumbnailComponent } from '../../../../../app/thumbnail/themed-thumbnail.component'; -import { RouterLink } from '@angular/router'; -import { ErrorComponent } from '../../../../../app/shared/error/error.component'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { FileSizePipe } from '../../../../../app/shared/utils/file-size-pipe'; + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, + ChangeDetectionStrategy, + Component, Component, } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; -import { EditBitstreamPageComponent as BaseComponent } from '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; +import { + EditBitstreamPageComponent as BaseComponent, + EditBitstreamPageComponent as BaseComponent, +} from '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; +import { ErrorComponent } from '../../../../../app/shared/error/error.component'; +import { FormComponent } from '../../../../../app/shared/form/form.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { FileSizePipe } from '../../../../../app/shared/utils/file-size-pipe'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { ThemedThumbnailComponent } from '../../../../../app/thumbnail/themed-thumbnail.component'; @Component({ selector: 'ds-edit-bitstream-page', @@ -36,7 +40,7 @@ import { EditBitstreamPageComponent as BaseComponent } from '../../../../../app/ ErrorComponent, ThemedLoadingComponent, TranslateModule, - FileSizePipe + FileSizePipe, ], }) export class EditBitstreamPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts b/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts index 36d1834e28..93fcfa36c8 100644 --- a/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts @@ -1,23 +1,28 @@ +import { + AsyncPipe, + NgFor, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { BreadcrumbsComponent as BaseComponent } from '../../../../app/breadcrumbs/breadcrumbs.component'; -import { VarDirective } from '../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; import { RouterLink } from '@angular/router'; import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { BreadcrumbsComponent as BaseComponent } from '../../../../app/breadcrumbs/breadcrumbs.component'; +import { VarDirective } from '../../../../app/shared/utils/var.directive'; + /** * Component representing the breadcrumbs of a page */ @Component({ - selector: 'ds-breadcrumbs', - // templateUrl: './breadcrumbs.component.html', - templateUrl: '../../../../app/breadcrumbs/breadcrumbs.component.html', - // styleUrls: ['./breadcrumbs.component.scss'] - styleUrls: ['../../../../app/breadcrumbs/breadcrumbs.component.scss'], - standalone: true, - imports: [VarDirective, NgIf, NgTemplateOutlet, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule] + selector: 'ds-breadcrumbs', + // templateUrl: './breadcrumbs.component.html', + templateUrl: '../../../../app/breadcrumbs/breadcrumbs.component.html', + // styleUrls: ['./breadcrumbs.component.scss'] + styleUrls: ['../../../../app/breadcrumbs/breadcrumbs.component.scss'], + standalone: true, + imports: [VarDirective, NgIf, NgTemplateOutlet, NgFor, RouterLink, NgbTooltipModule, AsyncPipe, TranslateModule], }) export class BreadcrumbsComponent extends BaseComponent { } diff --git a/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts index b6fe4f7c9e..d931765689 100644 --- a/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -1,29 +1,24 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BrowseByDateComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-date/browse-by-date.component'; import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type'; import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator'; import { Context } from '../../../../../app/core/shared/context.model'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ComcolPageHeaderComponent -} from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { - ComcolPageContentComponent -} from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { BrowseByComponent } from '../../../../../app/shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-browse-by-date', @@ -45,8 +40,8 @@ import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/the BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) @rendersBrowseBy(BrowseByDataType.Date, Context.Any, 'custom') export class BrowseByDateComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index bda976ac3f..52fe28bef6 100644 --- a/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -1,29 +1,24 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BrowseByMetadataComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-metadata/browse-by-metadata.component'; import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type'; import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator'; import { Context } from '../../../../../app/core/shared/context.model'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ComcolPageHeaderComponent -} from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { - ComcolPageContentComponent -} from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { BrowseByComponent } from '../../../../../app/shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-browse-by-metadata', @@ -45,8 +40,8 @@ import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/the BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) @rendersBrowseBy(BrowseByDataType.Metadata, Context.Any, 'custom') export class BrowseByMetadataComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts b/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts index b316be80bb..51461f1e31 100644 --- a/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts @@ -1,33 +1,26 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type'; import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator'; import { BrowseByTaxonomyComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component'; import { Context } from '../../../../../app/core/shared/context.model'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ComcolPageHeaderComponent -} from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { - ComcolPageContentComponent -} from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { BrowseByComponent } from '../../../../../app/shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/themed-browse-by.component'; -import { RouterModule } from '@angular/router'; -import { - VocabularyTreeviewComponent -} from '../../../../../app/shared/form/vocabulary-treeview/vocabulary-treeview.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { VocabularyTreeviewComponent } from '../../../../../app/shared/form/vocabulary-treeview/vocabulary-treeview.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-browse-by-taxonomy', @@ -51,8 +44,8 @@ import { BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) @rendersBrowseBy(BrowseByDataType.Hierarchy, Context.Any, 'custom') export class BrowseByTaxonomyComponent extends BaseComponent { diff --git a/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts index b135547ab8..4c687547b3 100644 --- a/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -1,28 +1,24 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { BrowseByDataType } from '../../../../../app/browse-by/browse-by-switcher/browse-by-data-type'; import { rendersBrowseBy } from '../../../../../app/browse-by/browse-by-switcher/browse-by-decorator'; import { BrowseByTitleComponent as BaseComponent } from '../../../../../app/browse-by/browse-by-title/browse-by-title.component'; import { Context } from '../../../../../app/core/shared/context.model'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ComcolPageHeaderComponent -} from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { - ComcolPageContentComponent -} from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; import { BrowseByComponent } from '../../../../../app/shared/browse-by/browse-by.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/themed-browse-by.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-browse-by-title', @@ -44,8 +40,8 @@ import { ThemedBrowseByComponent } from '../../../../../app/shared/browse-by/the BrowseByComponent, TranslateModule, ThemedLoadingComponent, - ThemedBrowseByComponent - ] + ThemedBrowseByComponent, + ], }) @rendersBrowseBy(BrowseByDataType.Title, Context.Any, 'custom') export class BrowseByTitleComponent extends BaseComponent { diff --git a/src/themes/custom/app/collection-page/collection-page.component.ts b/src/themes/custom/app/collection-page/collection-page.component.ts index ea2c5675d4..40360833e9 100644 --- a/src/themes/custom/app/collection-page/collection-page.component.ts +++ b/src/themes/custom/app/collection-page/collection-page.component.ts @@ -1,35 +1,30 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { CollectionPageComponent as BaseComponent } from '../../../../app/collection-page/collection-page.component'; import { fadeIn, fadeInOut, } from '../../../../app/shared/animations/fade'; -import { - ComcolPageContentComponent -} from '../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; -import { ErrorComponent } from '../../../../app/shared/error/error.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; -import { VarDirective } from '../../../../app/shared/utils/var.directive'; -import { - ComcolPageHeaderComponent -} from '../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; import { ComcolPageLogoComponent } from '../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; import { DsoEditMenuComponent } from '../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ErrorComponent } from '../../../../app/shared/error/error.component'; +import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; import { ObjectCollectionComponent } from '../../../../app/shared/object-collection/object-collection.component'; -import { RouterOutlet } from '@angular/router'; +import { VarDirective } from '../../../../app/shared/utils/var.directive'; +import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; @Component({ @@ -41,7 +36,7 @@ import { RouterOutlet } from '@angular/router'; changeDetection: ChangeDetectionStrategy.OnPush, animations: [ fadeIn, - fadeInOut + fadeInOut, ], standalone: true, imports: [ @@ -59,7 +54,7 @@ import { RouterOutlet } from '@angular/router'; ThemedComcolPageHandleComponent, DsoEditMenuComponent, ThemedComcolPageBrowseByComponent, - ObjectCollectionComponent + ObjectCollectionComponent, ], }) /** diff --git a/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts b/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts index 34484aeaa7..9ca52219e5 100644 --- a/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts +++ b/src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts @@ -1,15 +1,16 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { EditItemTemplatePageComponent as BaseComponent } from '../../../../../app/collection-page/edit-item-template-page/edit-item-template-page.component'; -import { - ThemedDsoEditMetadataComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { ThemedDsoEditMetadataComponent } from '../../../../../app/dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component'; import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-edit-item-template-page', @@ -25,8 +26,8 @@ import { AlertComponent } from '../../../../../app/shared/alert/alert.component' NgIf, TranslateModule, ThemedLoadingComponent, - AlertComponent - ] + AlertComponent, + ], }) /** * Component for editing the item template of a collection diff --git a/src/themes/custom/app/community-list-page/community-list-page.component.ts b/src/themes/custom/app/community-list-page/community-list-page.component.ts index 9dd0f2d4c0..621a58d698 100644 --- a/src/themes/custom/app/community-list-page/community-list-page.component.ts +++ b/src/themes/custom/app/community-list-page/community-list-page.component.ts @@ -1,20 +1,16 @@ import { Component } from '@angular/core'; - -import { - CommunityListPageComponent as BaseComponent -} from '../../../../app/community-list-page/community-list-page.component'; -import { - ThemedCommunityListComponent -} from '../../../../app/community-list-page/community-list/themed-community-list.component'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedCommunityListComponent } from '../../../../app/community-list-page/community-list/themed-community-list.component'; +import { CommunityListPageComponent as BaseComponent } from '../../../../app/community-list-page/community-list-page.component'; + @Component({ selector: 'ds-community-list-page', // styleUrls: ['./community-list-page.component.scss'], // templateUrl: './community-list-page.component.html' templateUrl: '../../../../app/community-list-page/community-list-page.component.html', standalone: true, - imports: [ThemedCommunityListComponent, TranslateModule] + imports: [ThemedCommunityListComponent, TranslateModule], }) /** diff --git a/src/themes/custom/app/community-list-page/community-list/community-list.component.ts b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts index 9ca81705cc..334c8bc4ed 100644 --- a/src/themes/custom/app/community-list-page/community-list/community-list.component.ts +++ b/src/themes/custom/app/community-list-page/community-list/community-list.component.ts @@ -1,17 +1,17 @@ -import { Component } from '@angular/core'; - -import { - CommunityListComponent as BaseComponent -} from '../../../../../app/community-list-page/community-list/community-list.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; import { CdkTreeModule } from '@angular/cdk/tree'; -import { RouterLink } from '@angular/router'; -import { TruncatableComponent } from '../../../../../app/shared/truncatable/truncatable.component'; import { - TruncatablePartComponent -} from '../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { CommunityListComponent as BaseComponent } from '../../../../../app/community-list-page/community-list/community-list.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { TruncatableComponent } from '../../../../../app/shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; /** * A tree-structured list of nodes representing the communities, their subCommunities and collections. @@ -26,7 +26,7 @@ import { // templateUrl: './community-list.component.html' templateUrl: '../../../../../app/community-list-page/community-list/community-list.component.html', standalone: true, - imports: [NgIf, ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedLoadingComponent, CdkTreeModule, NgClass, RouterLink, TruncatableComponent, TruncatablePartComponent, AsyncPipe, TranslateModule], }) export class CommunityListComponent extends BaseComponent {} diff --git a/src/themes/custom/app/community-page/community-page.component.ts b/src/themes/custom/app/community-page/community-page.component.ts index b454a699cc..fb421c605f 100644 --- a/src/themes/custom/app/community-page/community-page.component.ts +++ b/src/themes/custom/app/community-page/community-page.component.ts @@ -1,37 +1,28 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { CommunityPageComponent as BaseComponent } from '../../../../app/community-page/community-page.component'; +import { ThemedCollectionPageSubCollectionListComponent } from '../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; +import { ThemedCommunityPageSubCommunityListComponent } from '../../../../app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; import { fadeInOut } from '../../../../app/shared/animations/fade'; -import { - ComcolPageContentComponent -} from '../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageBrowseByComponent } from '../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; +import { ComcolPageContentComponent } from '../../../../app/shared/comcol/comcol-page-content/comcol-page-content.component'; +import { ThemedComcolPageHandleComponent } from '../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; +import { ComcolPageHeaderComponent } from '../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; +import { ComcolPageLogoComponent } from '../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; +import { DsoEditMenuComponent } from '../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { ErrorComponent } from '../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ThemedComcolPageBrowseByComponent -} from '../../../../app/shared/comcol/comcol-page-browse-by/themed-comcol-page-browse-by.component'; -import { DsoEditMenuComponent } from '../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ThemedComcolPageHandleComponent -} from '../../../../app/shared/comcol/comcol-page-handle/themed-comcol-page-handle.component'; -import { ComcolPageLogoComponent } from '../../../../app/shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { - ComcolPageHeaderComponent -} from '../../../../app/shared/comcol/comcol-page-header/comcol-page-header.component'; -import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; import { VarDirective } from '../../../../app/shared/utils/var.directive'; -import { - ThemedCommunityPageSubCommunityListComponent -} from '../../../../app/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component'; -import { - ThemedCollectionPageSubCollectionListComponent -} from '../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/themed-community-page-sub-collection-list.component'; -import { RouterModule } from '@angular/router'; +import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; @Component({ @@ -59,7 +50,7 @@ import { RouterModule } from '@angular/router'; AsyncPipe, ViewTrackerComponent, VarDirective, - RouterModule + RouterModule, ], }) /** diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts index 22963120bd..8ebe26fd44 100644 --- a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts @@ -8,7 +8,7 @@ import { CommunityPageSubCollectionListComponent as BaseComponent } from '../../ styleUrls: ['../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.scss'], // templateUrl: './community-page-sub-collection-list.component.html', templateUrl: '../../../../../app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.html', - standalone: true + standalone: true, }) export class CommunityPageSubCollectionListComponent extends BaseComponent { } diff --git a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts index 24a7c53a20..dda061deab 100644 --- a/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/themes/custom/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts @@ -1,14 +1,15 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { CommunityPageSubCommunityListComponent as BaseComponent } from '../../../../../../../app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; import { ErrorComponent } from '../../../../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../../../../app/shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../../../../app/shared/object-collection/object-collection.component'; import { VarDirective } from '../../../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ObjectCollectionComponent -} from '../../../../../../../app/shared/object-collection/object-collection.component'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-community-page-sub-community-list', @@ -28,8 +29,8 @@ import { TranslateModule } from '@ngx-translate/core'; ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, - VarDirective - ] + VarDirective, + ], }) export class CommunityPageSubCommunityListComponent extends BaseComponent { } diff --git a/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts b/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts index cd3f9e3f54..90846daf5f 100644 --- a/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts +++ b/src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts @@ -1,28 +1,22 @@ import { - DsoEditMetadataComponent as BaseComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata.component'; + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; -import { - DsoEditMetadataHeadersComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component'; -import { - MetadataFieldSelectorComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component'; -import { - DsoEditMetadataValueHeadersComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; -import { - DsoEditMetadataValueComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component'; -import { - DsoEditMetadataFieldValuesComponent -} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component'; -import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; -import { LoadingComponent } from '../../../../../app/shared/loading/loading.component'; import { TranslateModule } from '@ngx-translate/core'; -import { DsoEditMetadataComponent as BaseComponent } from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata.component'; +import { + DsoEditMetadataComponent as BaseComponent, + DsoEditMetadataComponent as BaseComponent, +} from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata.component'; +import { DsoEditMetadataFieldValuesComponent } from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component'; +import { DsoEditMetadataHeadersComponent } from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component'; +import { DsoEditMetadataValueComponent } from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component'; +import { DsoEditMetadataValueHeadersComponent } from '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component'; +import { MetadataFieldSelectorComponent } from '../../../../../app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component'; +import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; +import { LoadingComponent } from '../../../../../app/shared/loading/loading.component'; @Component({ selector: 'ds-dso-edit-metadata', @@ -31,7 +25,7 @@ import { DsoEditMetadataComponent as BaseComponent } from '../../../../../app/ds // templateUrl: './dso-edit-metadata.component.html', templateUrl: '../../../../../app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.html', standalone: true, - imports: [NgIf, DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, NgFor, DsoEditMetadataFieldValuesComponent, AlertComponent, LoadingComponent, AsyncPipe, TranslateModule] + imports: [NgIf, DsoEditMetadataHeadersComponent, MetadataFieldSelectorComponent, DsoEditMetadataValueHeadersComponent, DsoEditMetadataValueComponent, NgFor, DsoEditMetadataFieldValuesComponent, AlertComponent, LoadingComponent, AsyncPipe, TranslateModule], }) export class DsoEditMetadataComponent extends BaseComponent { } diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts index cda79ed0a5..66803ffd84 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts @@ -1,31 +1,22 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { Context } from '../../../../../../../app/core/shared/context.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedResultsBackButtonComponent -} from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - GenericItemPageFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - JournalIssueComponent as BaseComponent -} from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { JournalIssueComponent as BaseComponent } from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalIssue', ViewMode.StandalonePage, Context.Any, 'custom') @Component({ @@ -35,7 +26,7 @@ import { // templateUrl: './journal-issue.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.html', standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal Issue diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts index d5c119fd4e..c63f68bd70 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts @@ -1,31 +1,22 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { Context } from '../../../../../../../app/core/shared/context.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedResultsBackButtonComponent -} from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - GenericItemPageFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - JournalVolumeComponent as BaseComponent -} from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { JournalVolumeComponent as BaseComponent } from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; @listableObjectComponent('JournalVolume', ViewMode.StandalonePage, Context.Any, 'custom') @Component({ @@ -35,7 +26,7 @@ import { // templateUrl: './journal-volume.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.html', standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal Volume diff --git a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts index 5aa92e8771..104f1b40b0 100644 --- a/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts +++ b/src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts @@ -1,34 +1,23 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Context } from '../../../../../../../app/core/shared/context.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedResultsBackButtonComponent -} from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - GenericItemPageFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; -import { RouterLink } from '@angular/router'; -import { - TabbedRelatedEntitiesSearchComponent -} from '../../../../../../../app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { TranslateModule } from '@ngx-translate/core'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - JournalComponent as BaseComponent -} from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal/journal.component'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { JournalComponent as BaseComponent } from '../../../../../../../app/entity-groups/journal-entities/item-pages/journal/journal.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { TabbedRelatedEntitiesSearchComponent } from '../../../../../../../app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; @listableObjectComponent('Journal', ViewMode.StandalonePage, Context.Any, 'custom') @Component({ @@ -38,7 +27,7 @@ import { // templateUrl: './journal.component.html', templateUrl: '../../../../../../../app/entity-groups/journal-entities/item-pages/journal/journal.component.html', standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], }) /** * The component for displaying metadata and relations of an item of the type Journal diff --git a/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts b/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts index 778e899bea..f1a60957ed 100644 --- a/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts +++ b/src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts @@ -1,32 +1,23 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { Context } from '../../../../../../../app/core/shared/context.model'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedResultsBackButtonComponent -} from 'src/app/shared/results-back-button/themed-results-back-button.component'; -import { - ThemedItemPageTitleFieldComponent -} from 'src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { GenericItemPageFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from 'src/app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { TabbedRelatedEntitiesSearchComponent } from 'src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; +import { RelatedItemsComponent } from 'src/app/item-page/simple/related-items/related-items-component'; import { DsoEditMenuComponent } from 'src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { MetadataFieldWrapperComponent } from 'src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { ThemedResultsBackButtonComponent } from 'src/app/shared/results-back-button/themed-results-back-button.component'; import { ThemedThumbnailComponent } from 'src/app/thumbnail/themed-thumbnail.component'; -import { - GenericItemPageFieldComponent -} from 'src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from 'src/app/item-page/simple/related-items/related-items-component'; -import { RouterLink } from '@angular/router'; -import { - TabbedRelatedEntitiesSearchComponent -} from 'src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component'; -import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - PersonComponent as BaseComponent -} from '../../../../../../../app/entity-groups/research-entities/item-pages/person/person.component'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { PersonComponent as BaseComponent } from '../../../../../../../app/entity-groups/research-entities/item-pages/person/person.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; @listableObjectComponent('Person', ViewMode.StandalonePage, Context.Any, 'custom') @Component({ @@ -36,7 +27,7 @@ import { // templateUrl: './person.component.html', templateUrl: '../../../../../../../app/entity-groups/research-entities/item-pages/person/person.component.html', standalone: true, - imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedResultsBackButtonComponent, ThemedItemPageTitleFieldComponent, DsoEditMenuComponent, MetadataFieldWrapperComponent, ThemedThumbnailComponent, GenericItemPageFieldComponent, RelatedItemsComponent, RouterLink, TabbedRelatedEntitiesSearchComponent, AsyncPipe, TranslateModule], }) export class PersonComponent extends BaseComponent { } diff --git a/src/themes/custom/app/footer/footer.component.ts b/src/themes/custom/app/footer/footer.component.ts index de2784b594..2378d31016 100644 --- a/src/themes/custom/app/footer/footer.component.ts +++ b/src/themes/custom/app/footer/footer.component.ts @@ -1,10 +1,14 @@ +import { + AsyncPipe, + DatePipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { FooterComponent as BaseComponent } from '../../../../app/footer/footer.component'; -import { AsyncPipe, DatePipe, NgIf } from '@angular/common'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { FooterComponent as BaseComponent } from '../../../../app/footer/footer.component'; + @Component({ selector: 'ds-footer', // styleUrls: ['./footer.component.scss'], @@ -12,7 +16,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './footer.component.html' templateUrl: '../../../../app/footer/footer.component.html', standalone: true, - imports: [NgIf, RouterLink, AsyncPipe, DatePipe, TranslateModule] + imports: [NgIf, RouterLink, AsyncPipe, DatePipe, TranslateModule], }) export class FooterComponent extends BaseComponent { } diff --git a/src/themes/custom/app/forbidden/forbidden.component.ts b/src/themes/custom/app/forbidden/forbidden.component.ts index 2cf9ff7cc1..2377b71249 100644 --- a/src/themes/custom/app/forbidden/forbidden.component.ts +++ b/src/themes/custom/app/forbidden/forbidden.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; - -import { ForbiddenComponent as BaseComponent } from '../../../../app/forbidden/forbidden.component'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ForbiddenComponent as BaseComponent } from '../../../../app/forbidden/forbidden.component'; + @Component({ selector: 'ds-forbidden', @@ -12,7 +12,7 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['./forbidden.component.scss'] styleUrls: ['../../../../app/forbidden/forbidden.component.scss'], standalone: true, - imports: [RouterLink, TranslateModule] + imports: [RouterLink, TranslateModule], }) /** * This component representing the `Forbidden` DSpace page. diff --git a/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts b/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts index 62fbaae4a8..954d3a3419 100644 --- a/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts +++ b/src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts @@ -1,11 +1,9 @@ import { Component } from '@angular/core'; - -import { - ForgotEmailComponent as BaseComponent -} from '../../../../../app/forgot-password/forgot-password-email/forgot-email.component'; -import { RegisterEmailFormComponent } from '../../../../../app/register-email-form/register-email-form.component'; import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; +import { ForgotEmailComponent as BaseComponent } from '../../../../../app/forgot-password/forgot-password-email/forgot-email.component'; +import { RegisterEmailFormComponent } from '../../../../../app/register-email-form/register-email-form.component'; + @Component({ selector: 'ds-forgot-email', // styleUrls: ['./forgot-email.component.scss'], @@ -15,7 +13,7 @@ import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/th standalone: true, imports: [ RegisterEmailFormComponent, - ThemedRegisterEmailFormComponent + ThemedRegisterEmailFormComponent, ], }) /** diff --git a/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts b/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts index 246574813b..52c0cb565d 100644 --- a/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts +++ b/src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts @@ -1,13 +1,12 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { - ForgotPasswordFormComponent as BaseComponent -} from '../../../../../app/forgot-password/forgot-password-form/forgot-password-form.component'; import { TranslateModule } from '@ngx-translate/core'; -import { - ProfilePageSecurityFormComponent -} from '../../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; -import { AsyncPipe, NgIf } from '@angular/common'; + +import { ForgotPasswordFormComponent as BaseComponent } from '../../../../../app/forgot-password/forgot-password-form/forgot-password-form.component'; +import { ProfilePageSecurityFormComponent } from '../../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; @Component({ @@ -22,7 +21,7 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi ProfilePageSecurityFormComponent, BrowserOnlyPipe, AsyncPipe, - NgIf + NgIf, ], }) /** diff --git a/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts index 02cf63f1b8..28b8f54fc4 100644 --- a/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -1,10 +1,11 @@ +import { + AsyncPipe, + NgClass, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - HeaderNavbarWrapperComponent as BaseComponent -} from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; -import { AsyncPipe, NgClass } from '@angular/common'; import { ThemedHeaderComponent } from '../../../../app/header/themed-header.component'; +import { HeaderNavbarWrapperComponent as BaseComponent } from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; /** @@ -17,7 +18,7 @@ import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.comp // templateUrl: './header-navbar-wrapper.component.html', templateUrl: '../../../../app/header-nav-wrapper/header-navbar-wrapper.component.html', standalone: true, - imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe] + imports: [NgClass, ThemedHeaderComponent, ThemedNavbarComponent, AsyncPipe], }) export class HeaderNavbarWrapperComponent extends BaseComponent { } diff --git a/src/themes/custom/app/header/header.component.ts b/src/themes/custom/app/header/header.component.ts index 02f080ee0f..fbfe8d5a84 100644 --- a/src/themes/custom/app/header/header.component.ts +++ b/src/themes/custom/app/header/header.component.ts @@ -1,16 +1,16 @@ import { Component } from '@angular/core'; - -import { HeaderComponent as BaseComponent } from '../../../../app/header/header.component'; import { RouterLink } from '@angular/router'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedSearchNavbarComponent } from '../../../../app/search-navbar/themed-search-navbar.component'; -import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; -import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; -import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; -import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; import { TranslateModule } from '@ngx-translate/core'; import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component'; +import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; +import { HeaderComponent as BaseComponent } from '../../../../app/header/header.component'; +import { ThemedSearchNavbarComponent } from '../../../../app/search-navbar/themed-search-navbar.component'; +import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; +import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; +import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; + /** * Represents the header with the logo and simple navigation */ @@ -21,7 +21,7 @@ import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lan // templateUrl: 'header.component.html', templateUrl: '../../../../app/header/header.component.html', standalone: true, - imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule] + imports: [RouterLink, ThemedLangSwitchComponent, NgbDropdownModule, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule], }) export class HeaderComponent extends BaseComponent { } diff --git a/src/themes/custom/app/home-page/home-news/home-news.component.ts b/src/themes/custom/app/home-page/home-news/home-news.component.ts index c31044e02c..cc2efa0429 100644 --- a/src/themes/custom/app/home-page/home-news/home-news.component.ts +++ b/src/themes/custom/app/home-page/home-news/home-news.component.ts @@ -3,12 +3,12 @@ import { Component } from '@angular/core'; import { HomeNewsComponent as BaseComponent } from '../../../../../app/home-page/home-news/home-news.component'; @Component({ - selector: 'ds-home-news', - // styleUrls: ['./home-news.component.scss'], - styleUrls: ['../../../../../app/home-page/home-news/home-news.component.scss'], - // templateUrl: './home-news.component.html' - templateUrl: '../../../../../app/home-page/home-news/home-news.component.html', - standalone: true + selector: 'ds-home-news', + // styleUrls: ['./home-news.component.scss'], + styleUrls: ['../../../../../app/home-page/home-news/home-news.component.scss'], + // templateUrl: './home-news.component.html' + templateUrl: '../../../../../app/home-page/home-news/home-news.component.html', + standalone: true, }) /** diff --git a/src/themes/custom/app/home-page/home-page.component.ts b/src/themes/custom/app/home-page/home-page.component.ts index 50cffcea81..7c24350acd 100644 --- a/src/themes/custom/app/home-page/home-page.component.ts +++ b/src/themes/custom/app/home-page/home-page.component.ts @@ -1,17 +1,19 @@ -import { Component } from '@angular/core'; - -import { HomePageComponent as BaseComponent } from '../../../../app/home-page/home-page.component'; -import { ThemedHomeNewsComponent } from '../../../../app/home-page/home-news/themed-home-news.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; -import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; import { - ThemedTopLevelCommunityListComponent -} from '../../../../app/home-page/top-level-community-list/themed-top-level-community-list.component'; -import { RecentItemListComponent } from '../../../../app/home-page/recent-item-list/recent-item-list.component'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + +import { ThemedHomeNewsComponent } from '../../../../app/home-page/home-news/themed-home-news.component'; +import { HomePageComponent as BaseComponent } from '../../../../app/home-page/home-page.component'; +import { RecentItemListComponent } from '../../../../app/home-page/recent-item-list/recent-item-list.component'; +import { ThemedTopLevelCommunityListComponent } from '../../../../app/home-page/top-level-community-list/themed-top-level-community-list.component'; import { SuggestionsPopupComponent } from '../../../../app/notifications/suggestions-popup/suggestions-popup.component'; import { ConfigurationSearchPageComponent } from '../../../../app/search-page/configuration-search-page.component'; +import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; +import { ViewTrackerComponent } from '../../../../app/statistics/angulartics/dspace/view-tracker.component'; @Component({ selector: 'ds-home-page', @@ -20,7 +22,7 @@ import { ConfigurationSearchPageComponent } from '../../../../app/search-page/co // templateUrl: './home-page.component.html' templateUrl: '../../../../app/home-page/home-page.component.html', standalone: true, - imports: [ThemedHomeNewsComponent, NgIf, ViewTrackerComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, ConfigurationSearchPageComponent, SuggestionsPopupComponent] + imports: [ThemedHomeNewsComponent, NgIf, ViewTrackerComponent, ThemedSearchFormComponent, ThemedTopLevelCommunityListComponent, RecentItemListComponent, AsyncPipe, TranslateModule, NgClass, ConfigurationSearchPageComponent, SuggestionsPopupComponent], }) export class HomePageComponent extends BaseComponent { diff --git a/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts b/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts index 8a6a579373..532c6f8064 100644 --- a/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts +++ b/src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts @@ -1,14 +1,15 @@ -import { Component } from '@angular/core'; - import { - TopLevelCommunityListComponent as BaseComponent -} from '../../../../../app/home-page/top-level-community-list/top-level-community-list.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ObjectCollectionComponent } from '../../../../../app/shared/object-collection/object-collection.component'; + AsyncPipe, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { TopLevelCommunityListComponent as BaseComponent } from '../../../../../app/home-page/top-level-community-list/top-level-community-list.component'; import { ErrorComponent } from '../../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; +import { ObjectCollectionComponent } from '../../../../../app/shared/object-collection/object-collection.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-top-level-community-list', @@ -17,7 +18,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './top-level-community-list.component.html' templateUrl: '../../../../../app/home-page/top-level-community-list/top-level-community-list.component.html', standalone: true, - imports: [VarDirective, NgIf, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + imports: [VarDirective, NgIf, ObjectCollectionComponent, ErrorComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class TopLevelCommunityListComponent extends BaseComponent {} diff --git a/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts b/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts index 0c5411c858..e884972bbd 100644 --- a/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts +++ b/src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts @@ -1,14 +1,10 @@ import { Component } from '@angular/core'; - -import { - EndUserAgreementComponent as BaseComponent -} from '../../../../../app/info/end-user-agreement/end-user-agreement.component'; -import { - EndUserAgreementContentComponent -} from '../../../../../app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component'; import { FormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { EndUserAgreementComponent as BaseComponent } from '../../../../../app/info/end-user-agreement/end-user-agreement.component'; +import { EndUserAgreementContentComponent } from '../../../../../app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component'; + @Component({ selector: 'ds-end-user-agreement', // styleUrls: ['./end-user-agreement.component.scss'], @@ -16,7 +12,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './end-user-agreement.component.html' templateUrl: '../../../../../app/info/end-user-agreement/end-user-agreement.component.html', standalone: true, - imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule] + imports: [EndUserAgreementContentComponent, FormsModule, TranslateModule], }) /** diff --git a/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts b/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts index 524b69ca21..bd0f55f153 100644 --- a/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts +++ b/src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts @@ -1,10 +1,13 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { FeedbackFormComponent as BaseComponent } from '../../../../../../app/info/feedback/feedback-form/feedback-form.component'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NgIf } from '@angular/common'; import { ErrorComponent } from '../../../../../../app/shared/error/error.component'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-feedback-form', @@ -13,7 +16,7 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['./feedback-form.component.scss'], styleUrls: ['../../../../../../app/info/feedback/feedback-form/feedback-form.component.scss'], standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgIf, ErrorComponent, TranslateModule] + imports: [FormsModule, ReactiveFormsModule, NgIf, ErrorComponent, TranslateModule], }) export class FeedbackFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/info/feedback/feedback.component.ts b/src/themes/custom/app/info/feedback/feedback.component.ts index f2ad749288..01d377e616 100644 --- a/src/themes/custom/app/info/feedback/feedback.component.ts +++ b/src/themes/custom/app/info/feedback/feedback.component.ts @@ -1,9 +1,7 @@ import { Component } from '@angular/core'; import { FeedbackComponent as BaseComponent } from '../../../../../app/info/feedback/feedback.component'; -import { - ThemedFeedbackFormComponent -} from '../../../../../app/info/feedback/feedback-form/themed-feedback-form.component'; +import { ThemedFeedbackFormComponent } from '../../../../../app/info/feedback/feedback-form/themed-feedback-form.component'; @Component({ selector: 'ds-feedback', @@ -12,7 +10,7 @@ import { // templateUrl: './feedback.component.html' templateUrl: '../../../../../app/info/feedback/feedback.component.html', standalone: true, - imports: [ThemedFeedbackFormComponent] + imports: [ThemedFeedbackFormComponent], }) /** diff --git a/src/themes/custom/app/info/privacy/privacy.component.ts b/src/themes/custom/app/info/privacy/privacy.component.ts index 869c899fa5..c9632c1ee8 100644 --- a/src/themes/custom/app/info/privacy/privacy.component.ts +++ b/src/themes/custom/app/info/privacy/privacy.component.ts @@ -10,7 +10,7 @@ import { PrivacyContentComponent } from '../../../../../app/info/privacy/privacy // templateUrl: './privacy.component.html' templateUrl: '../../../../../app/info/privacy/privacy.component.html', standalone: true, - imports: [PrivacyContentComponent] + imports: [PrivacyContentComponent], }) /** diff --git a/src/themes/custom/app/item-page/alerts/item-alerts.component.ts b/src/themes/custom/app/item-page/alerts/item-alerts.component.ts index ed661def46..494013369c 100644 --- a/src/themes/custom/app/item-page/alerts/item-alerts.component.ts +++ b/src/themes/custom/app/item-page/alerts/item-alerts.component.ts @@ -1,10 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { ItemAlertsComponent as BaseComponent } from '../../../../../app/item-page/alerts/item-alerts.component'; import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; -import { RouterLink } from '@angular/router'; @Component({ selector: 'ds-item-alerts', @@ -18,7 +21,7 @@ import { RouterLink } from '@angular/router'; NgIf, TranslateModule, RouterLink, - AsyncPipe + AsyncPipe, ], }) export class ItemAlertsComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts index ace45e5198..0f358fac4b 100644 --- a/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts +++ b/src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts @@ -1,14 +1,22 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { fadeIn, fadeInOut } from '../../../../../../app/shared/animations/fade'; import { - ItemStatusComponent as BaseComponent -} from '../../../../../../app/item-page/edit-item-page/item-status/item-status.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; + AsyncPipe, + NgClass, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ItemOperationComponent } from '../../../../../../app/item-page/edit-item-page/item-operation/item-operation.component'; +import { ItemStatusComponent as BaseComponent } from '../../../../../../app/item-page/edit-item-page/item-status/item-status.component'; import { - ItemOperationComponent -} from '../../../../../../app/item-page/edit-item-page/item-operation/item-operation.component'; + fadeIn, + fadeInOut, +} from '../../../../../../app/shared/animations/fade'; @Component({ selector: 'ds-item-status', @@ -17,7 +25,7 @@ import { changeDetection: ChangeDetectionStrategy.Default, animations: [ fadeIn, - fadeInOut + fadeInOut, ], standalone: true, imports: [ @@ -27,7 +35,7 @@ import { NgIf, RouterLink, ItemOperationComponent, - NgClass + NgClass, ], }) export class ItemStatusComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts b/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts index d65641f002..72aa62c36a 100644 --- a/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts +++ b/src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts @@ -1,18 +1,18 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { FullFileSectionComponent as BaseComponent } from '../../../../../../../app/item-page/full/field-components/file-section/full-file-section.component'; +import { ThemedFileDownloadLinkComponent } from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { PaginationComponent } from '../../../../../../../app/shared/pagination/pagination.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; +import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; import { VarDirective } from '../../../../../../../app/shared/utils/var.directive'; import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; -import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; @Component({ selector: 'ds-item-page-full-file-section', @@ -31,7 +31,7 @@ import { NgForOf, ThemedFileDownloadLinkComponent, FileSizePipe, - MetadataFieldWrapperComponent + MetadataFieldWrapperComponent, ], }) export class FullFileSectionComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/full/full-item-page.component.ts b/src/themes/custom/app/item-page/full/full-item-page.component.ts index 098c150caf..7f9caa1e05 100644 --- a/src/themes/custom/app/item-page/full/full-item-page.component.ts +++ b/src/themes/custom/app/item-page/full/full-item-page.component.ts @@ -1,27 +1,29 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { + AsyncPipe, + KeyValuePipe, + NgForOf, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedItemAlertsComponent } from '../../../../../app/item-page/alerts/themed-item-alerts.component'; +import { CollectionsComponent } from '../../../../../app/item-page/field-components/collections/collections.component'; +import { ThemedFullFileSectionComponent } from '../../../../../app/item-page/full/field-components/file-section/themed-full-file-section.component'; import { FullItemPageComponent as BaseComponent } from '../../../../../app/item-page/full/full-item-page.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemVersionsComponent } from '../../../../../app/item-page/versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../../../../../app/item-page/versions/notice/item-versions-notice.component'; +import { fadeInOut } from '../../../../../app/shared/animations/fade'; +import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; import { ErrorComponent } from '../../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ThemedFullFileSectionComponent -} from '../../../../../app/item-page/full/field-components/file-section/themed-full-file-section.component'; -import { CollectionsComponent } from '../../../../../app/item-page/field-components/collections/collections.component'; -import { ItemVersionsComponent } from '../../../../../app/item-page/versions/item-versions.component'; -import { AsyncPipe, KeyValuePipe, NgForOf, NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - ItemVersionsNoticeComponent -} from '../../../../../app/item-page/versions/notice/item-versions-notice.component'; -import { ViewTrackerComponent } from '../../../../../app/statistics/angulartics/dspace/view-tracker.component'; -import { ThemedItemAlertsComponent } from '../../../../../app/item-page/alerts/themed-item-alerts.component'; import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { fadeInOut } from '../../../../../app/shared/animations/fade'; +import { ViewTrackerComponent } from '../../../../../app/statistics/angulartics/dspace/view-tracker.component'; /** * This component renders a full item page. @@ -54,7 +56,7 @@ import { fadeInOut } from '../../../../../app/shared/animations/fade'; ItemVersionsNoticeComponent, ViewTrackerComponent, ThemedItemAlertsComponent, - VarDirective + VarDirective, ], }) export class FullItemPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts index f181fffae0..fe68a94ea6 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts @@ -1,8 +1,8 @@ +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; +import { NgxGalleryModule } from '@kolkov/ngx-gallery'; import { MediaViewerImageComponent as BaseComponent } from '../../../../../../app/item-page/media-viewer/media-viewer-image/media-viewer-image.component'; -import { NgxGalleryModule } from '@kolkov/ngx-gallery'; -import { AsyncPipe } from '@angular/common'; @Component({ selector: 'ds-media-viewer-image', @@ -13,7 +13,7 @@ import { AsyncPipe } from '@angular/common'; standalone: true, imports: [ NgxGalleryModule, - AsyncPipe + AsyncPipe, ], }) export class MediaViewerImageComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts index c696d0e81c..6a1778b5f5 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts @@ -1,10 +1,13 @@ +import { + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { MediaViewerVideoComponent as BaseComponent } from '../../../../../../app/item-page/media-viewer/media-viewer-video/media-viewer-video.component'; -import { NgForOf, NgIf } from '@angular/common'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; +import { MediaViewerVideoComponent as BaseComponent } from '../../../../../../app/item-page/media-viewer/media-viewer-video/media-viewer-video.component'; + @Component({ selector: 'ds-media-viewer-video', // templateUrl: './media-viewer-video.component.html', @@ -16,7 +19,7 @@ import { TranslateModule } from '@ngx-translate/core'; NgForOf, NgbDropdownModule, TranslateModule, - NgIf + NgIf, ], }) export class MediaViewerVideoComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts b/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts index 4a8b642723..fcceeaf352 100644 --- a/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts +++ b/src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts @@ -1,17 +1,16 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { MediaViewerComponent as BaseComponent } from '../../../../../app/item-page/media-viewer/media-viewer.component'; -import { - ThemedMediaViewerImageComponent -} from '../../../../../app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component'; -import { ThumbnailComponent } from '../../../../../app/thumbnail/thumbnail.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedMediaViewerVideoComponent -} from '../../../../../app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component'; -import { TranslateModule } from '@ngx-translate/core'; +import { ThemedMediaViewerImageComponent } from '../../../../../app/item-page/media-viewer/media-viewer-image/themed-media-viewer-image.component'; +import { ThemedMediaViewerVideoComponent } from '../../../../../app/item-page/media-viewer/media-viewer-video/themed-media-viewer-video.component'; import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { ThumbnailComponent } from '../../../../../app/thumbnail/thumbnail.component'; @Component({ selector: 'ds-media-viewer', @@ -28,7 +27,7 @@ import { VarDirective } from '../../../../../app/shared/utils/var.directive'; ThemedMediaViewerVideoComponent, TranslateModule, ThemedLoadingComponent, - VarDirective + VarDirective, ], }) export class MediaViewerComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts index 3f3ef65fba..10559cfb7f 100644 --- a/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts +++ b/src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts @@ -1,17 +1,12 @@ -import { Component } from '@angular/core'; -import { slideSidebarPadding } from '../../../../../../../app/shared/animations/slide'; -import { - FileSectionComponent as BaseComponent -} from '../../../../../../../app/item-page/simple/field-components/file-section/file-section.component'; import { CommonModule } from '@angular/common'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedLoadingComponent } from '../../../../../../../app/shared/loading/themed-loading.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + +import { FileSectionComponent as BaseComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/file-section.component'; +import { slideSidebarPadding } from '../../../../../../../app/shared/animations/slide'; +import { ThemedFileDownloadLinkComponent } from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; +import { ThemedLoadingComponent } from '../../../../../../../app/shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; import { VarDirective } from '../../../../../../../app/shared/utils/var.directive'; diff --git a/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts b/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts index 842a44bbb4..65d69b4f52 100644 --- a/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts +++ b/src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts @@ -1,15 +1,15 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { ItemPageTitleFieldComponent as BaseComponent } from '../../../../../../../../app/item-page/simple/field-components/specific-field/title/item-page-title-field.component'; -import { NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-item-page-title-field', // templateUrl: './item-page-title-field.component.html', templateUrl: '../../../../../../../../app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.html', standalone: true, - imports: [NgIf, TranslateModule] + imports: [NgIf, TranslateModule], }) export class ItemPageTitleFieldComponent extends BaseComponent { } diff --git a/src/themes/custom/app/item-page/simple/item-page.component.ts b/src/themes/custom/app/item-page/simple/item-page.component.ts index e54ffbff3f..58c8583015 100644 --- a/src/themes/custom/app/item-page/simple/item-page.component.ts +++ b/src/themes/custom/app/item-page/simple/item-page.component.ts @@ -1,27 +1,25 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; -import { ItemPageComponent as BaseComponent } from '../../../../../app/item-page/simple/item-page.component'; -import { fadeInOut } from '../../../../../app/shared/animations/fade'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; import { ThemedItemAlertsComponent } from '../../../../../app/item-page/alerts/themed-item-alerts.component'; -import { - ItemVersionsNoticeComponent -} from '../../../../../app/item-page/versions/notice/item-versions-notice.component'; -import { ViewTrackerComponent } from '../../../../../app/statistics/angulartics/dspace/view-tracker.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../../app/shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { ItemPageComponent as BaseComponent } from '../../../../../app/item-page/simple/item-page.component'; +import { NotifyRequestsStatusComponent } from '../../../../../app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component'; +import { QaEventNotificationComponent } from '../../../../../app/item-page/simple/qa-event-notification/qa-event-notification.component'; import { ItemVersionsComponent } from '../../../../../app/item-page/versions/item-versions.component'; +import { ItemVersionsNoticeComponent } from '../../../../../app/item-page/versions/notice/item-versions-notice.component'; +import { fadeInOut } from '../../../../../app/shared/animations/fade'; import { ErrorComponent } from '../../../../../app/shared/error/error.component'; import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - NotifyRequestsStatusComponent -} from '../../../../../app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component'; -import { - QaEventNotificationComponent -} from '../../../../../app/item-page/simple/qa-event-notification/qa-event-notification.component'; +import { ListableObjectComponentLoaderComponent } from '../../../../../app/shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { ViewTrackerComponent } from '../../../../../app/statistics/angulartics/dspace/view-tracker.component'; /** * This component renders a simple item page. @@ -50,8 +48,8 @@ import { QaEventNotificationComponent, TranslateModule, AsyncPipe, - NgIf - ] + NgIf, + ], }) export class ItemPageComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts index 6967a85b40..e558cc6e42 100644 --- a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts @@ -1,52 +1,30 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; -import { Context } from '../../../../../../../app/core/shared/context.model'; -import { - PublicationComponent as BaseComponent -} from '../../../../../../../app/item-page/simple/item-types/publication/publication.component'; import { CommonModule } from '@angular/common'; import { - ThemedResultsBackButtonComponent -} from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; -import { MiradorViewerComponent } from '../../../../../../../app/item-page/mirador-viewer/mirador-viewer.component'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - ThemedMediaViewerComponent -} from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; -import { - ThemedFileSectionComponent -} from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; -import { - ItemPageDateFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; -import { - ThemedMetadataRepresentationListComponent -} from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; -import { - GenericItemPageFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; -import { - ItemPageAbstractFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { - ItemPageUriFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; -import { - CollectionsComponent -} from '../../../../../../../app/item-page/field-components/collections/collections.component'; + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { Context } from '../../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { CollectionsComponent } from '../../../../../../../app/item-page/field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; +import { MiradorViewerComponent } from '../../../../../../../app/item-page/mirador-viewer/mirador-viewer.component'; +import { ThemedFileSectionComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageDateFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; +import { PublicationComponent as BaseComponent } from '../../../../../../../app/item-page/simple/item-types/publication/publication.component'; +import { ThemedMetadataRepresentationListComponent } from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { RelatedItemsComponent } from '../../../../../../../app/item-page/simple/related-items/related-items-component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; /** * Component that represents a publication Item page @@ -79,8 +57,8 @@ import { TranslateModule, ItemPageUriFieldComponent, CollectionsComponent, - RouterLink - ] + RouterLink, + ], }) export class PublicationComponent extends BaseComponent { diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index 4e5eb03c71..d9b5fabc0f 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -1,53 +1,30 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { Context } from '../../../../../../../app/core/shared/context.model'; import { Item } from '../../../../../../../app/core/shared/item.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - UntypedItemComponent as BaseComponent -} from '../../../../../../../app/item-page/simple/item-types/untyped-item/untyped-item.component'; -import { CommonModule } from '@angular/common'; -import { - ThemedItemPageTitleFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; -import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; -import { - ThemedMediaViewerComponent -} from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; -import { - ThemedFileSectionComponent -} from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; -import { - ItemPageDateFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; -import { - ThemedMetadataRepresentationListComponent -} from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; -import { - GenericItemPageFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; -import { TranslateModule } from '@ngx-translate/core'; +import { CollectionsComponent } from '../../../../../../../app/item-page/field-components/collections/collections.component'; +import { ThemedMediaViewerComponent } from '../../../../../../../app/item-page/media-viewer/themed-media-viewer.component'; import { MiradorViewerComponent } from '../../../../../../../app/item-page/mirador-viewer/mirador-viewer.component'; -import { - ThemedResultsBackButtonComponent -} from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; -import { - CollectionsComponent -} from '../../../../../../../app/item-page/field-components/collections/collections.component'; -import { RouterLink } from '@angular/router'; -import { - ItemPageUriFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; -import { - ItemPageAbstractFieldComponent -} from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ThemedFileSectionComponent } from '../../../../../../../app/item-page/simple/field-components/file-section/themed-file-section.component'; +import { ItemPageAbstractFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageDateFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/date/item-page-date-field.component'; +import { GenericItemPageFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component'; +import { ThemedItemPageTitleFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/title/themed-item-page-field.component'; +import { ItemPageUriFieldComponent } from '../../../../../../../app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component'; +import { UntypedItemComponent as BaseComponent } from '../../../../../../../app/item-page/simple/item-types/untyped-item/untyped-item.component'; +import { ThemedMetadataRepresentationListComponent } from '../../../../../../../app/item-page/simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { DsoEditMenuComponent } from '../../../../../../../app/shared/dso-page/dso-edit-menu/dso-edit-menu.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ThemedResultsBackButtonComponent } from '../../../../../../../app/shared/results-back-button/themed-results-back-button.component'; +import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/themed-thumbnail.component'; /** * Component that represents an untyped Item page @@ -78,8 +55,8 @@ import { CollectionsComponent, RouterLink, ItemPageUriFieldComponent, - ItemPageAbstractFieldComponent - ] + ItemPageAbstractFieldComponent, + ], }) export class UntypedItemComponent extends BaseComponent { } diff --git a/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts b/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts index b489c13984..6f73ecb60c 100644 --- a/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts +++ b/src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts @@ -1,24 +1,23 @@ import { - MetadataRepresentationListComponent as BaseComponent -} from '../../../../../../app/item-page/simple/metadata-representation-list/metadata-representation-list.component'; + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - MetadataFieldWrapperComponent -} from '../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; -import { VarDirective } from '../../../../../../app/shared/utils/var.directive'; -import { - MetadataRepresentationLoaderComponent -} from '../../../../../../app/shared/metadata-representation/metadata-representation-loader.component'; -import { ThemedLoadingComponent } from '../../../../../../app/shared/loading/themed-loading.component'; import { TranslateModule } from '@ngx-translate/core'; +import { MetadataRepresentationListComponent as BaseComponent } from '../../../../../../app/item-page/simple/metadata-representation-list/metadata-representation-list.component'; +import { ThemedLoadingComponent } from '../../../../../../app/shared/loading/themed-loading.component'; +import { MetadataFieldWrapperComponent } from '../../../../../../app/shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { MetadataRepresentationLoaderComponent } from '../../../../../../app/shared/metadata-representation/metadata-representation-loader.component'; +import { VarDirective } from '../../../../../../app/shared/utils/var.directive'; + @Component({ selector: 'ds-metadata-representation-list', // templateUrl: './metadata-representation-list.component.html' templateUrl: '../../../../../../app/item-page/simple/metadata-representation-list/metadata-representation-list.component.html', standalone: true, - imports: [MetadataFieldWrapperComponent, NgFor, VarDirective, MetadataRepresentationLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule] + imports: [MetadataFieldWrapperComponent, NgFor, VarDirective, MetadataRepresentationLoaderComponent, NgIf, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class MetadataRepresentationListComponent extends BaseComponent { diff --git a/src/themes/custom/app/login-page/login-page.component.ts b/src/themes/custom/app/login-page/login-page.component.ts index 3db01dac8d..ae733a495a 100644 --- a/src/themes/custom/app/login-page/login-page.component.ts +++ b/src/themes/custom/app/login-page/login-page.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.component'; import { LoginPageComponent as BaseComponent } from '../../../../app/login-page/login-page.component'; import { LogInComponent } from '../../../../app/shared/log-in/log-in.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.component'; /** * This component represents the login page @@ -15,7 +15,7 @@ import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.compon // templateUrl: './login-page.component.html' templateUrl: '../../../../app/login-page/login-page.component.html', standalone: true, - imports: [LogInComponent, ThemedLogInComponent ,TranslateModule] + imports: [LogInComponent, ThemedLogInComponent ,TranslateModule], }) export class LoginPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/logout-page/logout-page.component.ts b/src/themes/custom/app/logout-page/logout-page.component.ts index d02c7aed0b..04cc80223c 100644 --- a/src/themes/custom/app/logout-page/logout-page.component.ts +++ b/src/themes/custom/app/logout-page/logout-page.component.ts @@ -1,8 +1,8 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { LogoutPageComponent as BaseComponent } from '../../../../app/logout-page/logout-page.component'; import { LogOutComponent } from '../../../../app/shared/log-out/log-out.component'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-logout-page', @@ -11,7 +11,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './logout-page.component.html' templateUrl: '../../../../app/logout-page/logout-page.component.html', standalone: true, - imports: [LogOutComponent, TranslateModule] + imports: [LogOutComponent, TranslateModule], }) export class LogoutPageComponent extends BaseComponent { } diff --git a/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts b/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts index c2c95f7538..3014ab961d 100644 --- a/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts +++ b/src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts @@ -1,11 +1,12 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; - import { - ObjectNotFoundComponent as BaseComponent -} from '../../../../../app/lookup-by-id/objectnotfound/objectnotfound.component'; + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ObjectNotFoundComponent as BaseComponent } from '../../../../../app/lookup-by-id/objectnotfound/objectnotfound.component'; + @Component({ selector: 'ds-objnotfound', // styleUrls: ['./objectnotfound.component.scss'], @@ -14,7 +15,7 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: '../../../../../app/lookup-by-id/objectnotfound/objectnotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule] + imports: [RouterLink, TranslateModule], }) /** diff --git a/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts b/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts index 5cfaf5b2b4..efff96d2aa 100644 --- a/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts +++ b/src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts @@ -1,22 +1,23 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { pushInOut } from '../../../../app/shared/animations/push'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; + +import { MyDSpaceConfigurationService } from '../../../../app/my-dspace-page/my-dspace-configuration.service'; +import { MyDSpaceNewSubmissionComponent } from '../../../../app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component'; import { MyDSpacePageComponent as BaseComponent, - SEARCH_CONFIG_SERVICE + SEARCH_CONFIG_SERVICE, } from '../../../../app/my-dspace-page/my-dspace-page.component'; -import { MyDSpaceConfigurationService } from '../../../../app/my-dspace-page/my-dspace-configuration.service'; -import { ThemedSearchComponent } from '../../../../app/shared/search/themed-search.component'; -import { - MyDSpaceNewSubmissionComponent -} from '../../../../app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { MyDspaceQaEventsNotificationsComponent } from '../../../../app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; +import { SuggestionsNotificationComponent } from '../../../../app/notifications/suggestions-notification/suggestions-notification.component'; +import { pushInOut } from '../../../../app/shared/animations/push'; import { RoleDirective } from '../../../../app/shared/roles/role.directive'; -import { - MyDspaceQaEventsNotificationsComponent -} from '../../../../app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component'; -import { - SuggestionsNotificationComponent -} from '../../../../app/notifications/suggestions-notification/suggestions-notification.component'; +import { ThemedSearchComponent } from '../../../../app/shared/search/themed-search.component'; /** * This component represents the whole mydspace page @@ -32,8 +33,8 @@ import { providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: MyDSpaceConfigurationService - } + useClass: MyDSpaceConfigurationService, + }, ], standalone: true, imports: [ @@ -43,7 +44,7 @@ import { SuggestionsNotificationComponent, AsyncPipe, RoleDirective, - NgIf + NgIf, ], }) export class MyDSpacePageComponent extends BaseComponent { diff --git a/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts index b2a346aa5f..dcadc0d7c8 100644 --- a/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts +++ b/src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts @@ -2,20 +2,18 @@ import { Component } from '@angular/core'; import { ExpandableNavbarSectionComponent as BaseComponent } from '../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component'; import { slide } from '../../../../../app/shared/animations/slide'; -import { MenuID } from '../../../../../app/shared/menu/menu-id.model'; -import { rendersSectionForMenu } from '../../../../../app/shared/menu/menu-section.decorator'; /** * Represents an expandable section in the navbar */ @Component({ - selector: 'ds-expandable-navbar-section', - // templateUrl: './expandable-navbar-section.component.html', - templateUrl: '../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.html', - // styleUrls: ['./expandable-navbar-section.component.scss'], - styleUrls: ['../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss'], - animations: [slide], - standalone: true + selector: 'ds-expandable-navbar-section', + // templateUrl: './expandable-navbar-section.component.html', + templateUrl: '../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.html', + // styleUrls: ['./expandable-navbar-section.component.scss'], + styleUrls: ['../../../../../app/navbar/expandable-navbar-section/expandable-navbar-section.component.scss'], + animations: [slide], + standalone: true, }) export class ExpandableNavbarSectionComponent extends BaseComponent { } diff --git a/src/themes/custom/app/navbar/navbar.component.ts b/src/themes/custom/app/navbar/navbar.component.ts index 07720ab3cf..1eb910347f 100644 --- a/src/themes/custom/app/navbar/navbar.component.ts +++ b/src/themes/custom/app/navbar/navbar.component.ts @@ -1,12 +1,18 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedUserMenuComponent } from 'src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component'; import { NavbarComponent as BaseComponent } from '../../../../app/navbar/navbar.component'; import { slideMobileNav } from '../../../../app/shared/animations/slide'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/common'; import { UserMenuComponent } from '../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedUserMenuComponent } from 'src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component'; /** * Component representing the public navbar @@ -19,7 +25,7 @@ import { ThemedUserMenuComponent } from 'src/app/shared/auth-nav-menu/user-menu/ templateUrl: '../../../../app/navbar/navbar.component.html', animations: [slideMobileNav], standalone: true, - imports: [NgbDropdownModule, NgClass, NgIf, UserMenuComponent, ThemedUserMenuComponent, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule] + imports: [NgbDropdownModule, NgClass, NgIf, UserMenuComponent, ThemedUserMenuComponent, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule], }) export class NavbarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/pagenotfound/pagenotfound.component.ts b/src/themes/custom/app/pagenotfound/pagenotfound.component.ts index c421aa90a7..a8448a6159 100644 --- a/src/themes/custom/app/pagenotfound/pagenotfound.component.ts +++ b/src/themes/custom/app/pagenotfound/pagenotfound.component.ts @@ -1,9 +1,12 @@ -import { ChangeDetectionStrategy, Component, } from '@angular/core'; - -import { PageNotFoundComponent as BaseComponent } from '../../../../app/pagenotfound/pagenotfound.component'; +import { + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { PageNotFoundComponent as BaseComponent } from '../../../../app/pagenotfound/pagenotfound.component'; + @Component({ selector: 'ds-pagenotfound', // styleUrls: ['./pagenotfound.component.scss'], @@ -12,7 +15,7 @@ import { TranslateModule } from '@ngx-translate/core'; templateUrl: '../../../../app/pagenotfound/pagenotfound.component.html', changeDetection: ChangeDetectionStrategy.Default, standalone: true, - imports: [RouterLink, TranslateModule] + imports: [RouterLink, TranslateModule], }) /** diff --git a/src/themes/custom/app/profile-page/profile-page.component.ts b/src/themes/custom/app/profile-page/profile-page.component.ts index 166011a7bd..b13745c0bf 100644 --- a/src/themes/custom/app/profile-page/profile-page.component.ts +++ b/src/themes/custom/app/profile-page/profile-page.component.ts @@ -1,21 +1,17 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { ProfilePageComponent as BaseComponent } from '../../../../app/profile-page/profile-page.component'; -import { - ProfilePageMetadataFormComponent -} from '../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component'; -import { - ProfilePageSecurityFormComponent -} from '../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; -import { - ProfilePageResearcherFormComponent -} from '../../../../app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component'; + +import { SuggestionsNotificationComponent } from '../../../../app/notifications/suggestions-notification/suggestions-notification.component'; +import { ProfilePageComponent as BaseComponent } from '../../../../app/profile-page/profile-page.component'; +import { ProfilePageMetadataFormComponent } from '../../../../app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component'; +import { ProfilePageResearcherFormComponent } from '../../../../app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component'; +import { ProfilePageSecurityFormComponent } from '../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; import { VarDirective } from '../../../../app/shared/utils/var.directive'; -import { - SuggestionsNotificationComponent -} from '../../../../app/notifications/suggestions-notification/suggestions-notification.component'; @Component({ selector: 'ds-profile-page', @@ -33,7 +29,7 @@ import { ProfilePageResearcherFormComponent, VarDirective, NgIf, - NgForOf + NgForOf, ], }) /** diff --git a/src/themes/custom/app/register-email-form/register-email-form.component.ts b/src/themes/custom/app/register-email-form/register-email-form.component.ts index 431c537f90..c27a436e88 100644 --- a/src/themes/custom/app/register-email-form/register-email-form.component.ts +++ b/src/themes/custom/app/register-email-form/register-email-form.component.ts @@ -1,20 +1,24 @@ -import { Component } from '@angular/core'; - import { - RegisterEmailFormComponent as BaseComponent -} from '../../../../app/register-email-form/register-email-form.component'; + AsyncPipe, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { GoogleRecaptchaComponent } from 'src/app/shared/google-recaptcha/google-recaptcha.component'; import { AlertComponent } from 'src/app/shared/alert/alert.component'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { GoogleRecaptchaComponent } from 'src/app/shared/google-recaptcha/google-recaptcha.component'; + +import { RegisterEmailFormComponent as BaseComponent } from '../../../../app/register-email-form/register-email-form.component'; @Component({ selector: 'ds-register-email-form', // templateUrl: './register-email-form.component.html', templateUrl: '../../../../app/register-email-form/register-email-form.component.html', standalone: true, - imports: [NgIf, FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule] + imports: [NgIf, FormsModule, ReactiveFormsModule, AlertComponent, GoogleRecaptchaComponent, AsyncPipe, TranslateModule], }) export class RegisterEmailFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/register-page/create-profile/create-profile.component.ts b/src/themes/custom/app/register-page/create-profile/create-profile.component.ts index a57e5f3b94..04f5942ecd 100644 --- a/src/themes/custom/app/register-page/create-profile/create-profile.component.ts +++ b/src/themes/custom/app/register-page/create-profile/create-profile.component.ts @@ -1,14 +1,14 @@ +import { + AsyncPipe, + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { - CreateProfileComponent as BaseComponent -} from '../../../../../app/register-page/create-profile/create-profile.component'; -import { - ProfilePageSecurityFormComponent -} from '../../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; import { ReactiveFormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ProfilePageSecurityFormComponent } from '../../../../../app/profile-page/profile-page-security-form/profile-page-security-form.component'; +import { CreateProfileComponent as BaseComponent } from '../../../../../app/register-page/create-profile/create-profile.component'; /** * Component that renders the create profile page to be used by a user registering through a token @@ -26,7 +26,7 @@ import { ReactiveFormsModule } from '@angular/forms'; NgIf, AsyncPipe, ReactiveFormsModule, - NgForOf + NgForOf, ], }) export class CreateProfileComponent extends BaseComponent { diff --git a/src/themes/custom/app/register-page/register-email/register-email.component.ts b/src/themes/custom/app/register-page/register-email/register-email.component.ts index 17dc1aa72a..28d22cceec 100644 --- a/src/themes/custom/app/register-page/register-email/register-email.component.ts +++ b/src/themes/custom/app/register-page/register-email/register-email.component.ts @@ -1,11 +1,9 @@ import { Component } from '@angular/core'; - -import { - RegisterEmailComponent as BaseComponent -} from '../../../../../app/register-page/register-email/register-email.component'; -import { RegisterEmailFormComponent } from '../../../../../app/register-email-form/register-email-form.component'; import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/themed-registry-email-form.component'; +import { RegisterEmailFormComponent } from '../../../../../app/register-email-form/register-email-form.component'; +import { RegisterEmailComponent as BaseComponent } from '../../../../../app/register-page/register-email/register-email.component'; + @Component({ selector: 'ds-register-email', // styleUrls: ['./register-email.component.scss'], @@ -15,7 +13,7 @@ import { ThemedRegisterEmailFormComponent } from 'src/app/register-email-form/th standalone: true, imports: [ RegisterEmailFormComponent, - ThemedRegisterEmailFormComponent + ThemedRegisterEmailFormComponent, ], }) /** diff --git a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts index c437eaf0c9..08cab9ad1a 100644 --- a/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts @@ -1,14 +1,14 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - DenyRequestCopyComponent as BaseComponent -} from 'src/app/request-copy/deny-request-copy/deny-request-copy.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedEmailRequestCopyComponent -} from '../../../../../app/request-copy/email-request-copy/themed-email-request-copy.component'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { TranslateModule } from '@ngx-translate/core'; +import { DenyRequestCopyComponent as BaseComponent } from 'src/app/request-copy/deny-request-copy/deny-request-copy.component'; + +import { ThemedEmailRequestCopyComponent } from '../../../../../app/request-copy/email-request-copy/themed-email-request-copy.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-deny-request-copy', @@ -17,7 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './deny-request-copy.component.html', templateUrl: './../../../../../app/request-copy/deny-request-copy/deny-request-copy.component.html', standalone: true, - imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule] + imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class DenyRequestCopyComponent extends BaseComponent { diff --git a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts index c0274a41f5..61475b3072 100644 --- a/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; import { - EmailRequestCopyComponent as BaseComponent -} from 'src/app/request-copy/email-request-copy/email-request-copy.component'; + NgClass, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NgClass, NgIf } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; +import { EmailRequestCopyComponent as BaseComponent } from 'src/app/request-copy/email-request-copy/email-request-copy.component'; @Component({ selector: 'ds-email-request-copy', @@ -13,7 +14,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './email-request-copy.component.html', templateUrl: './../../../../../app/request-copy/email-request-copy/email-request-copy.component.html', standalone: true, - imports: [FormsModule, NgClass, NgIf, TranslateModule] + imports: [FormsModule, NgClass, NgIf, TranslateModule], }) export class EmailRequestCopyComponent extends BaseComponent { diff --git a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts index e6e4c77642..da5c011ee5 100644 --- a/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts +++ b/src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts @@ -1,15 +1,15 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - GrantRequestCopyComponent as BaseComponent -} from 'src/app/request-copy/grant-request-copy/grant-request-copy.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedEmailRequestCopyComponent -} from '../../../../../app/request-copy/email-request-copy/themed-email-request-copy.component'; import { FormsModule } from '@angular/forms'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; import { TranslateModule } from '@ngx-translate/core'; +import { GrantRequestCopyComponent as BaseComponent } from 'src/app/request-copy/grant-request-copy/grant-request-copy.component'; + +import { ThemedEmailRequestCopyComponent } from '../../../../../app/request-copy/email-request-copy/themed-email-request-copy.component'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-grant-request-copy', @@ -18,6 +18,6 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './grant-request-copy.component.html', templateUrl: './../../../../../app/request-copy/grant-request-copy/grant-request-copy.component.html', standalone: true, - imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule] + imports: [VarDirective, NgIf, ThemedEmailRequestCopyComponent, FormsModule, ThemedLoadingComponent, AsyncPipe, TranslateModule], }) export class GrantRequestCopyComponent extends BaseComponent {} diff --git a/src/themes/custom/app/root/root.component.ts b/src/themes/custom/app/root/root.component.ts index 394dc8d626..193595b3ed 100644 --- a/src/themes/custom/app/root/root.component.ts +++ b/src/themes/custom/app/root/root.component.ts @@ -1,23 +1,20 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { RootComponent as BaseComponent } from '../../../../app/root/root.component'; -import { ThemedAdminSidebarComponent } from '../../../../app/admin/admin-sidebar/themed-admin-sidebar.component'; -import { - SystemWideAlertBannerComponent -} from '../../../../app/system-wide-alert/alert-banner/system-wide-alert-banner.component'; -import { - ThemedHeaderNavbarWrapperComponent -} from '../../../../app/header-nav-wrapper/themed-header-navbar-wrapper.component'; -import { ThemedBreadcrumbsComponent } from '../../../../app/breadcrumbs/themed-breadcrumbs.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; import { RouterOutlet } from '@angular/router'; -import { ThemedFooterComponent } from '../../../../app/footer/themed-footer.component'; -import { - NotificationsBoardComponent -} from '../../../../app/shared/notifications/notifications-board/notifications-board.component'; import { TranslateModule } from '@ngx-translate/core'; + +import { ThemedAdminSidebarComponent } from '../../../../app/admin/admin-sidebar/themed-admin-sidebar.component'; +import { ThemedBreadcrumbsComponent } from '../../../../app/breadcrumbs/themed-breadcrumbs.component'; +import { ThemedFooterComponent } from '../../../../app/footer/themed-footer.component'; +import { ThemedHeaderNavbarWrapperComponent } from '../../../../app/header-nav-wrapper/themed-header-navbar-wrapper.component'; +import { RootComponent as BaseComponent } from '../../../../app/root/root.component'; import { slideSidebarPadding } from '../../../../app/shared/animations/slide'; +import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; +import { NotificationsBoardComponent } from '../../../../app/shared/notifications/notifications-board/notifications-board.component'; +import { SystemWideAlertBannerComponent } from '../../../../app/system-wide-alert/alert-banner/system-wide-alert-banner.component'; @Component({ selector: 'ds-root', @@ -27,7 +24,7 @@ import { slideSidebarPadding } from '../../../../app/shared/animations/slide'; templateUrl: '../../../../app/root/root.component.html', animations: [slideSidebarPadding], standalone: true, - imports: [TranslateModule, ThemedAdminSidebarComponent, SystemWideAlertBannerComponent, ThemedHeaderNavbarWrapperComponent, ThemedBreadcrumbsComponent, NgIf, ThemedLoadingComponent, RouterOutlet, ThemedFooterComponent, NotificationsBoardComponent, AsyncPipe] + imports: [TranslateModule, ThemedAdminSidebarComponent, SystemWideAlertBannerComponent, ThemedHeaderNavbarWrapperComponent, ThemedBreadcrumbsComponent, NgIf, ThemedLoadingComponent, RouterOutlet, ThemedFooterComponent, NotificationsBoardComponent, AsyncPipe], }) export class RootComponent extends BaseComponent { diff --git a/src/themes/custom/app/search-navbar/search-navbar.component.ts b/src/themes/custom/app/search-navbar/search-navbar.component.ts index 289143d94e..8242896559 100644 --- a/src/themes/custom/app/search-navbar/search-navbar.component.ts +++ b/src/themes/custom/app/search-navbar/search-navbar.component.ts @@ -1,10 +1,13 @@ import { Component } from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { SearchNavbarComponent as BaseComponent } from '../../../../app/search-navbar/search-navbar.component'; -import { ClickOutsideDirective } from '../../../../app/shared/utils/click-outside.directive'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TranslateModule } from '@ngx-translate/core'; import { BrowserOnlyPipe } from '../../../../app/shared/utils/browser-only.pipe'; +import { ClickOutsideDirective } from '../../../../app/shared/utils/click-outside.directive'; @Component({ selector: 'ds-search-navbar', @@ -13,7 +16,7 @@ import { BrowserOnlyPipe } from '../../../../app/shared/utils/browser-only.pipe' // templateUrl: './search-navbar.component.html' templateUrl: '../../../../app/search-navbar/search-navbar.component.html', standalone: true, - imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe] + imports: [ClickOutsideDirective, FormsModule, ReactiveFormsModule, TranslateModule, BrowserOnlyPipe], }) export class SearchNavbarComponent extends BaseComponent { diff --git a/src/themes/custom/app/search-page/configuration-search-page.component.ts b/src/themes/custom/app/search-page/configuration-search-page.component.ts index c1c2e7639d..a8a005447a 100644 --- a/src/themes/custom/app/search-page/configuration-search-page.component.ts +++ b/src/themes/custom/app/search-page/configuration-search-page.component.ts @@ -1,25 +1,31 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { pushInOut } from '../../../../app/shared/animations/push'; -import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; import { - ConfigurationSearchPageComponent as BaseComponent -} from '../../../../app/search-page/configuration-search-page.component'; -import { AsyncPipe, NgIf, NgTemplateOutlet } from '@angular/common'; -import { PageWithSidebarComponent } from '../../../../app/shared/sidebar/page-with-sidebar.component'; -import { ViewModeSwitchComponent } from '../../../../app/shared/view-mode-switch/view-mode-switch.component'; + AsyncPipe, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { - ThemedSearchResultsComponent -} from '../../../../app/shared/search/search-results/themed-search-results.component'; -import { - ThemedSearchSidebarComponent -} from '../../../../app/shared/search/search-sidebar/themed-search-sidebar.component'; -import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; -import { SearchLabelsComponent } from '../../../../app/shared/search/search-labels/search-labels.component'; + ChangeDetectionStrategy, + Component, +} from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + +import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../app/my-dspace-page/my-dspace-page.component'; -import { ConfigurationSearchPageComponent as BaseComponent } from '../../../../app/search-page/configuration-search-page.component'; -import { pushInOut } from '../../../../app/shared/animations/push'; +import { + ConfigurationSearchPageComponent as BaseComponent, + ConfigurationSearchPageComponent as BaseComponent, +} from '../../../../app/search-page/configuration-search-page.component'; +import { + pushInOut, + pushInOut, +} from '../../../../app/shared/animations/push'; +import { SearchLabelsComponent } from '../../../../app/shared/search/search-labels/search-labels.component'; +import { ThemedSearchResultsComponent } from '../../../../app/shared/search/search-results/themed-search-results.component'; +import { ThemedSearchSidebarComponent } from '../../../../app/shared/search/search-sidebar/themed-search-sidebar.component'; +import { ThemedSearchFormComponent } from '../../../../app/shared/search-form/themed-search-form.component'; +import { PageWithSidebarComponent } from '../../../../app/shared/sidebar/page-with-sidebar.component'; +import { ViewModeSwitchComponent } from '../../../../app/shared/view-mode-switch/view-mode-switch.component'; @Component({ selector: 'ds-configuration-search-page', @@ -32,11 +38,11 @@ import { pushInOut } from '../../../../app/shared/animations/push'; providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], standalone: true, - imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule] + imports: [NgIf, NgTemplateOutlet, PageWithSidebarComponent, ViewModeSwitchComponent, ThemedSearchResultsComponent, ThemedSearchSidebarComponent, ThemedSearchFormComponent, SearchLabelsComponent, AsyncPipe, TranslateModule], }) /** diff --git a/src/themes/custom/app/search-page/search-page.component.ts b/src/themes/custom/app/search-page/search-page.component.ts index 73837cb518..c4b22850e7 100644 --- a/src/themes/custom/app/search-page/search-page.component.ts +++ b/src/themes/custom/app/search-page/search-page.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; -import { SearchPageComponent as BaseComponent } from '../../../../app/search-page/search-page.component'; +import { SEARCH_CONFIG_SERVICE } from 'src/app/my-dspace-page/my-dspace-configuration.service'; import { SearchConfigurationService } from '../../../../app/core/shared/search/search-configuration.service'; +import { SearchPageComponent as BaseComponent } from '../../../../app/search-page/search-page.component'; import { ThemedSearchComponent } from '../../../../app/shared/search/themed-search.component'; -import { SEARCH_CONFIG_SERVICE } from 'src/app/my-dspace-page/my-dspace-configuration.service'; @Component({ selector: 'ds-search-page', @@ -13,11 +13,11 @@ import { SEARCH_CONFIG_SERVICE } from 'src/app/my-dspace-page/my-dspace-configur providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], standalone: true, - imports: [ThemedSearchComponent] + imports: [ThemedSearchComponent], }) /** * This component represents the whole search page diff --git a/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts b/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts index efdf44392c..6fc7c9b9d2 100644 --- a/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts +++ b/src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts @@ -1,19 +1,27 @@ -import { Component } from '@angular/core'; - import { - AuthNavMenuComponent as BaseComponent, -} from '../../../../../app/shared/auth-nav-menu/auth-nav-menu.component'; -import { fadeInOut, fadeOut } from '../../../../../app/shared/animations/fade'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; +import { + RouterLink, + RouterLinkActive, +} from '@angular/router'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { LogInComponent } from '../../../../../app/shared/log-in/log-in.component'; -import { RouterLink, RouterLinkActive } from '@angular/router'; -import { UserMenuComponent } from '../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; import { TranslateModule } from '@ngx-translate/core'; -import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; import { ThemedUserMenuComponent } from 'src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component'; import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.component'; +import { + fadeInOut, + fadeOut, +} from '../../../../../app/shared/animations/fade'; +import { AuthNavMenuComponent as BaseComponent } from '../../../../../app/shared/auth-nav-menu/auth-nav-menu.component'; +import { UserMenuComponent } from '../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; +import { LogInComponent } from '../../../../../app/shared/log-in/log-in.component'; +import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; + /** * Component representing the {@link AuthNavMenuComponent} of a page */ @@ -25,7 +33,7 @@ import { ThemedLogInComponent } from 'src/app/shared/log-in/themed-log-in.compon styleUrls: ['../../../../../app/shared/auth-nav-menu/auth-nav-menu.component.scss'], animations: [fadeInOut, fadeOut], standalone: true, - imports: [NgClass, NgIf, NgbDropdownModule, LogInComponent, ThemedLogInComponent, RouterLink, RouterLinkActive, UserMenuComponent, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe] + imports: [NgClass, NgIf, NgbDropdownModule, LogInComponent, ThemedLogInComponent, RouterLink, RouterLinkActive, UserMenuComponent, ThemedUserMenuComponent, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class AuthNavMenuComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts b/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts index d0cac9c643..cd0bbeb5da 100644 --- a/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts +++ b/src/themes/custom/app/shared/auth-nav-menu/user-menu/user-menu.component.ts @@ -1,11 +1,18 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { + RouterLink, + RouterLinkActive, +} from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; +import { LogOutComponent } from 'src/app/shared/log-out/log-out.component'; import { UserMenuComponent as BaseComponent } from '../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; -import { RouterLink, RouterLinkActive } from '@angular/router'; -import { LogOutComponent } from 'src/app/shared/log-out/log-out.component'; -import { TranslateModule } from '@ngx-translate/core'; /** * Component representing the {@link UserMenuComponent} of a page @@ -17,7 +24,7 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['user-menu.component.scss'], styleUrls: ['../../../../../../app/shared/auth-nav-menu/user-menu/user-menu.component.scss'], standalone: true, - imports: [NgIf, ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule] + imports: [NgIf, ThemedLoadingComponent, RouterLinkActive, NgClass, RouterLink, LogOutComponent, AsyncPipe, TranslateModule], }) export class UserMenuComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/browse-by/browse-by.component.ts b/src/themes/custom/app/shared/browse-by/browse-by.component.ts index bdfd1ede49..579875e547 100644 --- a/src/themes/custom/app/shared/browse-by/browse-by.component.ts +++ b/src/themes/custom/app/shared/browse-by/browse-by.component.ts @@ -1,19 +1,22 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { ErrorComponent } from 'src/app/shared/error/error.component'; +import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from 'src/app/shared/object-collection/object-collection.component'; +import { ThemedResultsBackButtonComponent } from 'src/app/shared/results-back-button/themed-results-back-button.component'; +import { VarDirective } from 'src/app/shared/utils/var.directive'; import { fadeIn, fadeInOut, } from '../../../../../app/shared/animations/fade'; import { BrowseByComponent as BaseComponent } from '../../../../../app/shared/browse-by/browse-by.component'; -import { VarDirective } from 'src/app/shared/utils/var.directive'; -import { AsyncPipe, NgClass, NgComponentOutlet, NgIf } from '@angular/common'; -import { - ThemedResultsBackButtonComponent -} from 'src/app/shared/results-back-button/themed-results-back-button.component'; -import { ObjectCollectionComponent } from 'src/app/shared/object-collection/object-collection.component'; -import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; -import { ErrorComponent } from 'src/app/shared/error/error.component'; -import { TranslateModule } from '@ngx-translate/core'; import { StartsWithLoaderComponent } from '../../../../../app/shared/starts-with/starts-with-loader.component'; @Component({ @@ -28,7 +31,7 @@ import { StartsWithLoaderComponent } from '../../../../../app/shared/starts-with ], standalone: true, imports: [VarDirective, NgClass, NgComponentOutlet, NgIf, ThemedResultsBackButtonComponent, ObjectCollectionComponent, - ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent] + ThemedLoadingComponent, ErrorComponent, AsyncPipe, TranslateModule, StartsWithLoaderComponent], }) export class BrowseByComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/themes/custom/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts index daeb57760e..957b79491b 100644 --- a/src/themes/custom/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/themes/custom/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -1,12 +1,17 @@ -import { Component } from '@angular/core'; import { - ComcolPageBrowseByComponent as BaseComponent -} from '../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component'; + AsyncPipe, + NgForOf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgForOf } from '@angular/common'; -import { RouterLink, RouterLinkActive } from '@angular/router'; +import { + RouterLink, + RouterLinkActive, +} from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ComcolPageBrowseByComponent as BaseComponent } from '../../../../../app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component'; + /** * A component to display the "Browse By" section of a Community or Collection page * It expects the ID of the Community or Collection as input to be passed on as a scope @@ -24,7 +29,7 @@ import { TranslateModule } from '@ngx-translate/core'; RouterLink, RouterLinkActive, TranslateModule, - AsyncPipe + AsyncPipe, ], }) export class ComcolPageBrowseByComponent extends BaseComponent {} diff --git a/src/themes/custom/app/shared/comcol-page-handle/comcol-page-handle.component.ts b/src/themes/custom/app/shared/comcol-page-handle/comcol-page-handle.component.ts index 6290fbeb29..3db41cfc29 100644 --- a/src/themes/custom/app/shared/comcol-page-handle/comcol-page-handle.component.ts +++ b/src/themes/custom/app/shared/comcol-page-handle/comcol-page-handle.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; -import { - ComcolPageHandleComponent as BaseComponent -} from '../../../../../app/shared/comcol/comcol-page-handle/comcol-page-handle.component'; import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { ComcolPageHandleComponent as BaseComponent } from '../../../../../app/shared/comcol/comcol-page-handle/comcol-page-handle.component'; + /** * This component builds a URL from the value of "handle" diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts index 170b07de8c..20be3969fb 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts @@ -1,18 +1,17 @@ -import { Component } from '@angular/core'; - - import { CreateCollectionParentSelectorComponent as BaseComponent -} from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component'; import { NgIf } from '@angular/common'; -import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { CreateCollectionParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component'; + @Component({ selector: 'ds-create-collection-parent-selector', // styleUrls: ['./create-collection-parent-selector.component.scss'], // templateUrl: './create-collection-parent-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class CreateCollectionParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts index 612ad1602e..d32fc2b870 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts @@ -1,10 +1,9 @@ import { Component } from '@angular/core'; - - import { CreateCommunityParentSelectorComponent as BaseComponent -} from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component'; -import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; import { TranslateModule } from '@ngx-translate/core'; +import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { CreateCommunityParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component'; + @Component({ selector: 'ds-create-community-parent-selector', // styleUrls: ['./create-community-parent-selector.component.scss'], @@ -12,7 +11,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './create-community-parent-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.html', standalone: true, - imports: [DSOSelectorComponent, TranslateModule] + imports: [DSOSelectorComponent, TranslateModule], }) export class CreateCommunityParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts index ac7befbb99..8f89bab746 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts @@ -1,20 +1,17 @@ -import { Component } from '@angular/core'; - - import { CreateItemParentSelectorComponent as BaseComponent -} from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; import { NgIf } from '@angular/common'; -import { - AuthorizedCollectionSelectorComponent -} from '../../../../../../../app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { AuthorizedCollectionSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component'; +import { CreateItemParentSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component'; + @Component({ selector: 'ds-create-item-parent-selector', // styleUrls: ['./create-item-parent-selector.component.scss'], // templateUrl: './create-item-parent-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.html', standalone: true, - imports: [NgIf, AuthorizedCollectionSelectorComponent, TranslateModule] + imports: [NgIf, AuthorizedCollectionSelectorComponent, TranslateModule], }) export class CreateItemParentSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts index d0d0d575d4..4aa9033fc1 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts @@ -1,18 +1,17 @@ -import { Component } from '@angular/core'; - - import { EditCollectionSelectorComponent as BaseComponent -} from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component'; import { NgIf } from '@angular/common'; -import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { EditCollectionSelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component'; + @Component({ selector: 'ds-edit-collection-selector', // styleUrls: ['./edit-collection-selector.component.scss'], // templateUrl: './edit-collection-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditCollectionSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts index 72e63c3c8f..02533a7bcd 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts @@ -1,18 +1,17 @@ -import { Component } from '@angular/core'; - - import { EditCommunitySelectorComponent as BaseComponent -} from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component'; import { NgIf } from '@angular/common'; -import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { EditCommunitySelectorComponent as BaseComponent } from '../../../../../../../app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component'; + @Component({ selector: 'ds-edit-item-selector', // styleUrls: ['./edit-community-selector.component.scss'], // templateUrl: './edit-community-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditCommunitySelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts index f043a3f55d..ba1ec9a74b 100644 --- a/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts +++ b/src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts @@ -1,10 +1,9 @@ -import { Component } from '@angular/core'; -import { - EditItemSelectorComponent as BaseComponent -} from 'src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component'; import { NgIf } from '@angular/common'; -import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { EditItemSelectorComponent as BaseComponent } from 'src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component'; + +import { DSOSelectorComponent } from '../../../../../../../app/shared/dso-selector/dso-selector/dso-selector.component'; @Component({ selector: 'ds-edit-item-selector', @@ -12,7 +11,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './edit-item-selector.component.html', templateUrl: '../../../../../../../app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.html', standalone: true, - imports: [NgIf, DSOSelectorComponent, TranslateModule] + imports: [NgIf, DSOSelectorComponent, TranslateModule], }) export class EditItemSelectorComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts index 9f6ad4b5d9..df52bf5804 100644 --- a/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts +++ b/src/themes/custom/app/shared/file-download-link/file-download-link.component.ts @@ -1,9 +1,14 @@ +import { + AsyncPipe, + NgClass, + NgIf, + NgTemplateOutlet, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; import { FileDownloadLinkComponent as BaseComponent } from '../../../../../app/shared/file-download-link/file-download-link.component'; -import { RouterLink } from '@angular/router'; -import { AsyncPipe, NgClass, NgIf, NgTemplateOutlet } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-file-download-link', @@ -12,7 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['./file-download-link.component.scss'], styleUrls: ['../../../../../app/shared/file-download-link/file-download-link.component.scss'], standalone: true, - imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule] + imports: [RouterLink, NgClass, NgIf, NgTemplateOutlet, AsyncPipe, TranslateModule], }) export class FileDownloadLinkComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts index 1e48911ab8..454de8a4f4 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts @@ -1,34 +1,32 @@ import { - DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent -} from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - SearchConfigurationService -} from '../../../../../../../../../app/core/shared/search/search-configuration.service'; -import { fadeIn, fadeInOut } from '../../../../../../../../../app/shared/animations/fade'; -import { - ThemedSearchFormComponent -} from '../../../../../../../../../app/shared/search-form/themed-search-form.component'; -import { - PageSizeSelectorComponent -} from '../../../../../../../../../app/shared/page-size-selector/page-size-selector.component'; -import { - ObjectCollectionComponent -} from '../../../../../../../../../app/shared/object-collection/object-collection.component'; -import { VarDirective } from '../../../../../../../../../app/shared/utils/var.directive'; -import { AsyncPipe, NgIf } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; -import { ErrorComponent } from '../../../../../../../../../app/shared/error/error.component'; -import { ThemedLoadingComponent } from '../../../../../../../../../app/shared/loading/themed-loading.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-configuration.service'; -import { SearchConfigurationService } from '../../../../../../../../../app/core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../../../../../app/core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-page.component'; import { fadeIn, + fadeIn, + fadeInOut, fadeInOut, } from '../../../../../../../../../app/shared/animations/fade'; -import { DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent } from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; +import { ErrorComponent } from '../../../../../../../../../app/shared/error/error.component'; +import { + DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent, + DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent, +} from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; +import { ThemedLoadingComponent } from '../../../../../../../../../app/shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../../../../../../app/shared/object-collection/object-collection.component'; +import { PageSizeSelectorComponent } from '../../../../../../../../../app/shared/page-size-selector/page-size-selector.component'; +import { ThemedSearchFormComponent } from '../../../../../../../../../app/shared/search-form/themed-search-form.component'; +import { VarDirective } from '../../../../../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-dynamic-lookup-relation-external-source-tab', @@ -44,7 +42,7 @@ import { DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent } fr ], animations: [ fadeIn, - fadeInOut + fadeInOut, ], standalone: true, imports: [ @@ -56,7 +54,7 @@ import { DsDynamicLookupRelationExternalSourceTabComponent as BaseComponent } fr TranslateModule, ErrorComponent, NgIf, - ThemedLoadingComponent + ThemedLoadingComponent, ], }) export class DsDynamicLookupRelationExternalSourceTabComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts index de246ebec9..c622263a28 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.ts @@ -1,24 +1,25 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; -import { - SearchResultsComponent -} from '../../../../../../../../../../app/shared/search/search-results/search-results.component'; -import { AsyncPipe, NgIf } from '@angular/common'; import { ExternalSourceEntryImportModalComponent as BaseComponent } from '../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component'; +import { SearchResultsComponent } from '../../../../../../../../../../app/shared/search/search-results/search-results.component'; @Component({ - selector: 'ds-external-source-entry-import-modal', - styleUrls: ['../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.scss'], - // styleUrls: ['./external-source-entry-import-modal.component.scss'], - templateUrl: '../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.html', - standalone: true, + selector: 'ds-external-source-entry-import-modal', + styleUrls: ['../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.scss'], + // styleUrls: ['./external-source-entry-import-modal.component.scss'], + templateUrl: '../../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component.html', + standalone: true, imports: [ TranslateModule, SearchResultsComponent, NgIf, - AsyncPipe - ] + AsyncPipe, + ], }) export class ExternalSourceEntryImportModalComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts index 9400b788aa..4bda10d1c7 100644 --- a/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts +++ b/src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts @@ -1,20 +1,23 @@ import { - DsDynamicLookupRelationSearchTabComponent as BaseComponent -} from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - SearchConfigurationService -} from '../../../../../../../../../app/core/shared/search/search-configuration.service'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { VarDirective } from '../../../../../../../../../app/shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedSearchComponent } from '../../../../../../../../../app/shared/search/themed-search.component'; -import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-configuration.service'; +import { TranslateModule } from '@ngx-translate/core'; -import { SearchConfigurationService } from '../../../../../../../../../app/core/shared/search/search-configuration.service'; +import { + SearchConfigurationService, + SearchConfigurationService, +} from '../../../../../../../../../app/core/shared/search/search-configuration.service'; +import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../../../../app/my-dspace-page/my-dspace-page.component'; -import { DsDynamicLookupRelationSearchTabComponent as BaseComponent } from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; +import { + DsDynamicLookupRelationSearchTabComponent as BaseComponent, + DsDynamicLookupRelationSearchTabComponent as BaseComponent, +} from '../../../../../../../../../app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; +import { ThemedSearchComponent } from '../../../../../../../../../app/shared/search/themed-search.component'; +import { VarDirective } from '../../../../../../../../../app/shared/utils/var.directive'; @Component({ selector: 'ds-dynamic-lookup-relation-search-tab', @@ -25,8 +28,8 @@ import { DsDynamicLookupRelationSearchTabComponent as BaseComponent } from '../. providers: [ { provide: SEARCH_CONFIG_SERVICE, - useClass: SearchConfigurationService - } + useClass: SearchConfigurationService, + }, ], standalone: true, imports: [ @@ -35,7 +38,7 @@ import { DsDynamicLookupRelationSearchTabComponent as BaseComponent } from '../. TranslateModule, NgbDropdownModule, NgIf, - ThemedSearchComponent + ThemedSearchComponent, ], }) export class DsDynamicLookupRelationSearchTabComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts b/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts index 37a93648a8..32a9a00616 100644 --- a/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts +++ b/src/themes/custom/app/shared/lang-switch/lang-switch.component.ts @@ -1,9 +1,12 @@ +import { + NgForOf, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { LangSwitchComponent as BaseComponent } from '../../../../../app/shared/lang-switch/lang-switch.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgForOf, NgIf } from '@angular/common'; -import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'ds-lang-switch', @@ -12,7 +15,7 @@ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; // templateUrl: './lang-switch.component.html', templateUrl: '../../../../../app/shared/lang-switch/lang-switch.component.html', standalone: true, - imports: [NgIf, NgbDropdownModule, NgForOf, TranslateModule] + imports: [NgIf, NgbDropdownModule, NgForOf, TranslateModule], }) export class LangSwitchComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/log-in/log-in.component.ts b/src/themes/custom/app/shared/log-in/log-in.component.ts index a115b7771a..7acd36d667 100644 --- a/src/themes/custom/app/shared/log-in/log-in.component.ts +++ b/src/themes/custom/app/shared/log-in/log-in.component.ts @@ -1,10 +1,14 @@ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { LogInComponent as BaseComponent } from '../../../../../app/shared/log-in/log-in.component'; -import { NgIf, NgFor, AsyncPipe } from '@angular/common'; import { ThemedLoadingComponent } from 'src/app/shared/loading/themed-loading.component'; import { LogInContainerComponent } from 'src/app/shared/log-in/container/log-in-container.component'; +import { LogInComponent as BaseComponent } from '../../../../../app/shared/log-in/log-in.component'; + @Component({ selector: 'ds-log-in', // templateUrl: './log-in.component.html', @@ -12,7 +16,7 @@ import { LogInContainerComponent } from 'src/app/shared/log-in/container/log-in- // styleUrls: ['./log-in.component.scss'], styleUrls: ['../../../../../app/shared/log-in/log-in.component.scss'], standalone: true, - imports: [NgIf, ThemedLoadingComponent, NgFor, LogInContainerComponent, AsyncPipe] + imports: [NgIf, ThemedLoadingComponent, NgFor, LogInContainerComponent, AsyncPipe], }) export class LogInComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts index 24b75229fe..19f10b9ceb 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; import { - AccessStatusBadgeComponent as BaseComponent -} from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component'; -import { AsyncPipe, NgIf } from '@angular/common'; + AsyncPipe, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { AccessStatusBadgeComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component'; @Component({ selector: 'ds-access-status-badge', @@ -11,7 +12,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './access-status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.html', standalone: true, - imports: [NgIf, AsyncPipe, TranslateModule] + imports: [NgIf, AsyncPipe, TranslateModule], }) export class AccessStatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts index bed851e2b3..9a9d0dec51 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/badges.component.ts @@ -1,27 +1,20 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; import { BadgesComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/badges.component'; -import { - ThemedStatusBadgeComponent -} from '../../../../../../../app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component'; -import { NgIf } from '@angular/common'; -import { - ThemedMyDSpaceStatusBadgeComponent -} from '../../../../../../../app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component'; -import { - ThemedTypeBadgeComponent -} from '../../../../../../../app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; -import { - ThemedAccessStatusBadgeComponent -} from '../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; + +import { ThemedAccessStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/access-status-badge/themed-access-status-badge.component'; +import { ThemedMyDSpaceStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/my-dspace-status-badge/themed-my-dspace-status-badge.component'; +import { ThemedStatusBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/status-badge/themed-status-badge.component'; +import { ThemedTypeBadgeComponent } from '../../../../../../../app/shared/object-collection/shared/badges/type-badge/themed-type-badge.component'; @Component({ - selector: 'ds-badges', - // styleUrls: ['./badges.component.scss'], - styleUrls: ['../../../../../../../app/shared/object-collection/shared/badges/badges.component.scss'], - // templateUrl: './badges.component.html', - templateUrl: '../../../../../../../app/shared/object-collection/shared/badges/badges.component.html', - standalone: true, - imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent] + selector: 'ds-badges', + // styleUrls: ['./badges.component.scss'], + styleUrls: ['../../../../../../../app/shared/object-collection/shared/badges/badges.component.scss'], + // templateUrl: './badges.component.html', + templateUrl: '../../../../../../../app/shared/object-collection/shared/badges/badges.component.html', + standalone: true, + imports: [ThemedStatusBadgeComponent, NgIf, ThemedMyDSpaceStatusBadgeComponent, ThemedTypeBadgeComponent, ThemedAccessStatusBadgeComponent], }) export class BadgesComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts index c6e6041a04..ead269067b 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts @@ -1,8 +1,6 @@ import { Component } from '@angular/core'; -import { - MyDSpaceStatusBadgeComponent as BaseComponent -} from 'src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component'; import { TranslateModule } from '@ngx-translate/core'; +import { MyDSpaceStatusBadgeComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component'; @Component({ selector: 'ds-my-dspace-status-badge', @@ -11,7 +9,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './my-dspace-status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.html', standalone: true, - imports: [TranslateModule] + imports: [TranslateModule], }) export class MyDSpaceStatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts index 2f05c5be04..91c9aafca9 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts @@ -1,9 +1,7 @@ -import { Component } from '@angular/core'; -import { - StatusBadgeComponent as BaseComponent -} from 'src/app/shared/object-collection/shared/badges/status-badge/status-badge.component'; import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { StatusBadgeComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/status-badge/status-badge.component'; @Component({ selector: 'ds-status-badge', @@ -11,7 +9,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './status-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/status-badge/status-badge.component.html', standalone: true, - imports: [NgIf, TranslateModule] + imports: [NgIf, TranslateModule], }) export class StatusBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts b/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts index 018832f9b6..52be83adf0 100644 --- a/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts +++ b/src/themes/custom/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts @@ -1,9 +1,7 @@ -import { Component } from '@angular/core'; -import { - TypeBadgeComponent as BaseComponent -} from 'src/app/shared/object-collection/shared/badges/type-badge/type-badge.component'; import { NgIf } from '@angular/common'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { TypeBadgeComponent as BaseComponent } from 'src/app/shared/object-collection/shared/badges/type-badge/type-badge.component'; @Component({ selector: 'ds-type-badge', @@ -11,7 +9,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './type-badge.component.html', templateUrl: '../../../../../../../../app/shared/object-collection/shared/badges/type-badge/type-badge.component.html', standalone: true, - imports: [NgIf, TranslateModule] + imports: [NgIf, TranslateModule], }) export class TypeBadgeComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts b/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts index 5ab26cbc1e..5391c51624 100644 --- a/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts @@ -1,12 +1,15 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { BrowseEntry } from '../../../../../../app/core/shared/browse-entry.model'; import { Context } from '../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../app/core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; import { BrowseEntryListElementComponent as BaseComponent } from '../../../../../../app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; @Component({ selector: 'ds-browse-entry-list-element', @@ -15,7 +18,7 @@ import { RouterLink } from '@angular/router'; // templateUrl: './browse-entry-list-element.component.html', templateUrl: '../../../../../../app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.html', standalone: true, - imports: [NgIf, RouterLink, AsyncPipe] + imports: [NgIf, RouterLink, AsyncPipe], }) @listableObjectComponent(BrowseEntry, ViewMode.ListElement, Context.Any, 'custom') export class BrowseEntryListElementComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts b/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts index 30decb5e42..d7db69198b 100644 --- a/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts @@ -1,9 +1,9 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Collection } from '../../../../../../app/core/shared/collection.model'; import { Context } from '../../../../../../app/core/shared/context.model'; -import { NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; import { ViewMode } from '../../../../../../app/core/shared/view-mode.model'; import { listableObjectComponent } from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; import { CollectionListElementComponent as BaseComponent } from '../../../../../../app/shared/object-list/collection-list-element/collection-list-element.component'; @@ -17,7 +17,7 @@ import { CollectionListElementComponent as BaseComponent } from '../../../../../ // templateUrl: './collection-list-element.component.html' templateUrl: '../../../../../../app/shared/object-list/collection-list-element/collection-list-element.component.html', standalone: true, - imports: [NgIf, RouterLink] + imports: [NgIf, RouterLink], }) /** * Component representing list element for a collection diff --git a/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts b/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts index f227ca8b53..50f24ae91a 100644 --- a/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts @@ -1,14 +1,12 @@ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Community } from '../../../../../../app/core/shared/community.model'; import { Context } from '../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../app/core/shared/view-mode.model'; -import { - listableObjectComponent -} from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { listableObjectComponent } from '../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; import { CommunityListElementComponent as BaseComponent } from '../../../../../../app/shared/object-list/community-list-element/community-list-element.component'; -import { NgIf } from '@angular/common'; -import { RouterLink } from '@angular/router'; @listableObjectComponent(Community, ViewMode.ListElement, Context.Any, 'custom') @@ -19,7 +17,7 @@ import { RouterLink } from '@angular/router'; // templateUrl: './community-list-element.component.html' templateUrl: '../../../../../../app/shared/object-list/community-list-element/community-list-element.component.html', standalone: true, - imports: [NgIf, RouterLink] + imports: [NgIf, RouterLink], }) /** * Component representing a list element for a community diff --git a/src/themes/custom/app/shared/object-list/object-list.component.ts b/src/themes/custom/app/shared/object-list/object-list.component.ts index 4d7c2e9e3e..e64b36aef5 100644 --- a/src/themes/custom/app/shared/object-list/object-list.component.ts +++ b/src/themes/custom/app/shared/object-list/object-list.component.ts @@ -1,17 +1,15 @@ +import { + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { ImportableListItemControlComponent } from '../../../../../app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component'; +import { ListableObjectComponentLoaderComponent } from '../../../../../app/shared/object-collection/shared/listable-object/listable-object-component-loader.component'; +import { SelectableListItemControlComponent } from '../../../../../app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; import { ObjectListComponent as BaseComponent } from '../../../../../app/shared/object-list/object-list.component'; import { PaginationComponent } from '../../../../../app/shared/pagination/pagination.component'; -import { NgClass, NgFor, NgIf } from '@angular/common'; -import { - SelectableListItemControlComponent -} from '../../../../../app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component'; -import { - ImportableListItemControlComponent -} from '../../../../../app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component'; -import { - ListableObjectComponentLoaderComponent -} from '../../../../../app/shared/object-collection/shared/listable-object/listable-object-component-loader.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; /** @@ -26,9 +24,9 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi templateUrl: '../../../../../app/shared/object-list/object-list.component.html', imports: [ PaginationComponent, NgIf, NgClass, NgFor, SelectableListItemControlComponent, - ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe + ImportableListItemControlComponent, ListableObjectComponentLoaderComponent, BrowserOnlyPipe, ], - standalone: true + standalone: true, }) export class ObjectListComponent extends BaseComponent {} diff --git a/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts b/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts index 003e3f7ec8..eb639e5163 100644 --- a/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts @@ -1,26 +1,21 @@ +import { + AsyncPipe, + NgClass, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; import { Context } from '../../../../../../../../../app/core/shared/context.model'; -import { RouterLink } from '@angular/router'; -import { ThumbnailComponent } from '../../../../../../thumbnail/thumbnail.component'; -import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; -import { - ThemedBadgesComponent -} from '../../../../../../../../../app/shared/object-collection/shared/badges/themed-badges.component'; -import { TruncatableComponent } from '../../../../../../../../../app/shared/truncatable/truncatable.component'; -import { - TruncatablePartComponent -} from '../../../../../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; import { ViewMode } from '../../../../../../../../../app/core/shared/view-mode.model'; -import { - ItemSearchResult -} from '../../../../../../../../../app/shared/object-collection/shared/item-search-result.model'; -import { - listableObjectComponent -} from '../../../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; -import { - ItemSearchResultListElementComponent as BaseComponent -} from '../../../../../../../../../app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { ThemedBadgesComponent } from '../../../../../../../../../app/shared/object-collection/shared/badges/themed-badges.component'; +import { ItemSearchResult } from '../../../../../../../../../app/shared/object-collection/shared/item-search-result.model'; +import { listableObjectComponent } from '../../../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { ItemSearchResultListElementComponent as BaseComponent } from '../../../../../../../../../app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; +import { TruncatableComponent } from '../../../../../../../../../app/shared/truncatable/truncatable.component'; +import { TruncatablePartComponent } from '../../../../../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; +import { ThumbnailComponent } from '../../../../../../thumbnail/thumbnail.component'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.Any, 'custom') @listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.Any, 'custom') @@ -31,7 +26,7 @@ import { // templateUrl: './item-search-result-list-element.component.html', templateUrl: '../../../../../../../../../app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html', standalone: true, - imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe] + imports: [NgIf, RouterLink, ThumbnailComponent, NgClass, ThemedBadgesComponent, TruncatableComponent, TruncatablePartComponent, NgFor, AsyncPipe], }) export class ItemSearchResultListElementComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication-sidebar-search-list-element.component.ts b/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication-sidebar-search-list-element.component.ts index e91cffaa6c..7d2f03d26d 100644 --- a/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication-sidebar-search-list-element.component.ts +++ b/src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication-sidebar-search-list-element.component.ts @@ -1,19 +1,17 @@ import { - listableObjectComponent -} from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; -import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Context } from '../../../../../../../app/core/shared/context.model'; +import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; import { ItemSearchResult } from '../../../../../../../app/shared/object-collection/shared/item-search-result.model'; -import { - PublicationSidebarSearchListElementComponent as BaseComponent -} from '../../../../../../../app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component'; -import { - TruncatablePartComponent -} from '../../../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { TranslateModule } from '@ngx-translate/core'; +import { listableObjectComponent } from '../../../../../../../app/shared/object-collection/shared/listable-object/listable-object.decorator'; +import { PublicationSidebarSearchListElementComponent as BaseComponent } from '../../../../../../../app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component'; +import { TruncatablePartComponent } from '../../../../../../../app/shared/truncatable/truncatable-part/truncatable-part.component'; @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.SideBarSearchModal, 'custom') @listableObjectComponent('PublicationSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent, 'custom') @@ -24,7 +22,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './publication-sidebar-search-list-element.component.html', templateUrl: '../../../../../../../app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.html', standalone: true, - imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule] + imports: [TruncatablePartComponent, NgClass, NgIf, AsyncPipe, TranslateModule], }) export class PublicationSidebarSearchListElementComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts b/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts index 394ca2698c..3e1b62a23e 100644 --- a/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts +++ b/src/themes/custom/app/shared/results-back-button/results-back-button.component.ts @@ -1,9 +1,7 @@ -import { Component } from '@angular/core'; import { AsyncPipe } from '@angular/common'; +import { Component } from '@angular/core'; -import { - ResultsBackButtonComponent as BaseComponent -} from '../../../../../app/shared/results-back-button/results-back-button.component'; +import { ResultsBackButtonComponent as BaseComponent } from '../../../../../app/shared/results-back-button/results-back-button.component'; @Component({ selector: 'ds-results-back-button', @@ -12,6 +10,6 @@ import { //templateUrl: './results-back-button.component.html', templateUrl: '../../../../../app/shared/results-back-button/results-back-button.component.html', standalone: true, - imports: [AsyncPipe] + imports: [AsyncPipe], }) export class ResultsBackButtonComponent extends BaseComponent {} diff --git a/src/themes/custom/app/shared/search-form/search-form.component.ts b/src/themes/custom/app/shared/search-form/search-form.component.ts index 0109d67985..07e6016eda 100644 --- a/src/themes/custom/app/shared/search-form/search-form.component.ts +++ b/src/themes/custom/app/shared/search-form/search-form.component.ts @@ -1,9 +1,13 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { SearchFormComponent as BaseComponent } from '../../../../../app/shared/search-form/search-form.component'; import { FormsModule } from '@angular/forms'; -import { AsyncPipe, NgIf } from '@angular/common'; import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; + +import { SearchFormComponent as BaseComponent } from '../../../../../app/shared/search-form/search-form.component'; import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pipe'; @Component({ @@ -13,7 +17,7 @@ import { BrowserOnlyPipe } from '../../../../../app/shared/utils/browser-only.pi // templateUrl: './search-form.component.html', templateUrl: '../../../../../app/shared/search-form/search-form.component.html', standalone: true, - imports: [FormsModule, NgIf, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe] + imports: [FormsModule, NgIf, NgbTooltipModule, AsyncPipe, TranslateModule, BrowserOnlyPipe], }) export class SearchFormComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts b/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts index d034f10909..ce5c5fe6d3 100644 --- a/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts +++ b/src/themes/custom/app/shared/search/search-filters/search-filters.component.ts @@ -5,20 +5,20 @@ * * https://www.atmire.com/software-license/ */ +import { + AsyncPipe, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - SearchFiltersComponent as BaseComponent, -} from '../../../../../../app/shared/search/search-filters/search-filters.component'; - -import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service'; -import { AsyncPipe, NgFor, NgIf } from '@angular/common'; -import { - SearchFilterComponent -} from '../../../../../../app/shared/search/search-filters/search-filter/search-filter.component'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; -import { AdvancedSearchComponent } from '../../../../../../app/shared/search/advanced-search/advanced-search.component'; + +import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-page.component'; +import { AdvancedSearchComponent } from '../../../../../../app/shared/search/advanced-search/advanced-search.component'; +import { SearchFilterComponent } from '../../../../../../app/shared/search/search-filters/search-filter/search-filter.component'; +import { SearchFiltersComponent as BaseComponent } from '../../../../../../app/shared/search/search-filters/search-filters.component'; @Component({ @@ -34,7 +34,7 @@ import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-d }, ], standalone: true, - imports: [NgIf, NgFor, SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, AdvancedSearchComponent] + imports: [NgIf, NgFor, SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule, AdvancedSearchComponent], }) export class SearchFiltersComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/search/search-results/search-results.component.ts b/src/themes/custom/app/shared/search/search-results/search-results.component.ts index 860ac2dca5..b2b864240f 100644 --- a/src/themes/custom/app/shared/search/search-results/search-results.component.ts +++ b/src/themes/custom/app/shared/search/search-results/search-results.component.ts @@ -1,18 +1,18 @@ -import { - SearchResultsComponent as BaseComponent -} from '../../../../../../app/shared/search/search-results/search-results.component'; -import { Component } from '@angular/core'; -import { fadeIn, fadeInOut } from '../../../../../../app/shared/animations/fade'; import { NgIf } from '@angular/common'; -import { - SearchExportCsvComponent -} from '../../../../../../app/shared/search/search-export-csv/search-export-csv.component'; -import { ObjectCollectionComponent } from '../../../../../../app/shared/object-collection/object-collection.component'; -import { ThemedLoadingComponent } from '../../../../../../app/shared/loading/themed-loading.component'; -import { ErrorComponent } from '../../../../../../app/shared/error/error.component'; +import { Component } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { + fadeIn, + fadeInOut, +} from '../../../../../../app/shared/animations/fade'; +import { ErrorComponent } from '../../../../../../app/shared/error/error.component'; +import { ThemedLoadingComponent } from '../../../../../../app/shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../../../app/shared/object-collection/object-collection.component'; +import { SearchExportCsvComponent } from '../../../../../../app/shared/search/search-export-csv/search-export-csv.component'; +import { SearchResultsComponent as BaseComponent } from '../../../../../../app/shared/search/search-results/search-results.component'; + @Component({ selector: 'ds-search-results', // templateUrl: './search-results.component.html', @@ -20,10 +20,10 @@ import { TranslateModule } from '@ngx-translate/core'; // styleUrls: ['./search-results.component.scss'], animations: [ fadeIn, - fadeInOut + fadeInOut, ], standalone: true, - imports: [NgIf, SearchExportCsvComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, RouterLink, TranslateModule] + imports: [NgIf, SearchExportCsvComponent, ObjectCollectionComponent, ThemedLoadingComponent, ErrorComponent, RouterLink, TranslateModule], }) export class SearchResultsComponent extends BaseComponent { diff --git a/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts b/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts index 4b1f972e7f..094766db06 100644 --- a/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts +++ b/src/themes/custom/app/shared/search/search-settings/search-settings.component.ts @@ -5,20 +5,19 @@ * * https://www.atmire.com/software-license/ */ -import { Component } from '@angular/core'; import { - SearchSettingsComponent as BaseComponent, -} from '../../../../../../app/shared/search/search-settings/search-settings.component'; + NgFor, + NgIf, +} from '@angular/common'; +import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service'; -import { NgFor, NgIf } from '@angular/common'; -import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/sidebar-dropdown.component'; -import { FormsModule } from '@angular/forms'; -import { - PageSizeSelectorComponent -} from '../../../../../../app/shared/page-size-selector/page-size-selector.component'; -import { TranslateModule } from '@ngx-translate/core'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-page.component'; +import { PageSizeSelectorComponent } from '../../../../../../app/shared/page-size-selector/page-size-selector.component'; +import { SearchSettingsComponent as BaseComponent } from '../../../../../../app/shared/search/search-settings/search-settings.component'; +import { SidebarDropdownComponent } from '../../../../../../app/shared/sidebar/sidebar-dropdown.component'; @Component({ @@ -34,7 +33,7 @@ import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-d }, ], standalone: true, - imports: [NgIf, SidebarDropdownComponent, NgFor, FormsModule, PageSizeSelectorComponent, TranslateModule] + imports: [NgIf, SidebarDropdownComponent, NgFor, FormsModule, PageSizeSelectorComponent, TranslateModule], }) export class SearchSettingsComponent extends BaseComponent {} diff --git a/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts b/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts index d2179a364c..3171488b62 100644 --- a/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -5,25 +5,17 @@ * * https://www.atmire.com/software-license/ */ +import { NgIf } from '@angular/common'; import { Component } from '@angular/core'; -import { - SearchSidebarComponent as BaseComponent, -} from '../../../../../../app/shared/search/search-sidebar/search-sidebar.component'; +import { TranslateModule } from '@ngx-translate/core'; import { SearchConfigurationService } from '../../../../../../app/core/shared/search/search-configuration.service'; -import { NgIf } from '@angular/common'; -import { ViewModeSwitchComponent } from '../../../../../../app/shared/view-mode-switch/view-mode-switch.component'; -import { - SearchSwitchConfigurationComponent -} from '../../../../../../app/shared/search/search-switch-configuration/search-switch-configuration.component'; -import { - ThemedSearchFiltersComponent -} from '../../../../../../app/shared/search/search-filters/themed-search-filters.component'; -import { - ThemedSearchSettingsComponent -} from '../../../../../../app/shared/search/search-settings/themed-search-settings.component'; -import { TranslateModule } from '@ngx-translate/core'; import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-dspace-configuration.service'; +import { ThemedSearchFiltersComponent } from '../../../../../../app/shared/search/search-filters/themed-search-filters.component'; +import { ThemedSearchSettingsComponent } from '../../../../../../app/shared/search/search-settings/themed-search-settings.component'; +import { SearchSidebarComponent as BaseComponent } from '../../../../../../app/shared/search/search-sidebar/search-sidebar.component'; +import { SearchSwitchConfigurationComponent } from '../../../../../../app/shared/search/search-switch-configuration/search-switch-configuration.component'; +import { ViewModeSwitchComponent } from '../../../../../../app/shared/view-mode-switch/view-mode-switch.component'; @Component({ @@ -39,7 +31,7 @@ import { SEARCH_CONFIG_SERVICE } from '../../../../../../app/my-dspace-page/my-d }, ], standalone: true, - imports: [NgIf, ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule] + imports: [NgIf, ViewModeSwitchComponent, SearchSwitchConfigurationComponent, ThemedSearchFiltersComponent, ThemedSearchSettingsComponent, TranslateModule], }) export class SearchSidebarComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts b/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts index 0b319235d2..3f57274d36 100644 --- a/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts +++ b/src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts @@ -1,13 +1,13 @@ -import { Component } from '@angular/core'; - -import { - StartsWithDateComponent as BaseComponent -} from '../../../../../../app/shared/starts-with/date/starts-with-date.component'; -import { StartsWithType, } from '../../../../../../app/shared/starts-with/starts-with-decorator'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgFor } from '@angular/common'; +import { Component } from '@angular/core'; +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { StartsWithDateComponent as BaseComponent } from '../../../../../../app/shared/starts-with/date/starts-with-date.component'; + @Component({ selector: 'ds-starts-with-date', // styleUrls: ['./starts-with-date.component.scss'], @@ -15,7 +15,7 @@ import { TranslateModule } from '@ngx-translate/core'; // templateUrl: './starts-with-date.component.html', templateUrl: '../../../../../../app/shared/starts-with/date/starts-with-date.component.html', standalone: true, - imports: [FormsModule, ReactiveFormsModule, NgFor, TranslateModule] + imports: [FormsModule, ReactiveFormsModule, NgFor, TranslateModule], }) export class StartsWithDateComponent extends BaseComponent { } diff --git a/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts b/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts index b6102ff54a..d893b3f4d2 100644 --- a/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts +++ b/src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts @@ -1,18 +1,20 @@ import { Component } from '@angular/core'; import { - StartsWithTextComponent as BaseComponent -} from '../../../../../../app/shared/starts-with/text/starts-with-text.component'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; +import { StartsWithTextComponent as BaseComponent } from '../../../../../../app/shared/starts-with/text/starts-with-text.component'; + @Component({ - selector: 'ds-starts-with-text', - // styleUrls: ['./starts-with-text.component.scss'], - styleUrls: ['../../../../../../app/shared/starts-with/text/starts-with-text.component.scss'], - // templateUrl: './starts-with-text.component.html', - templateUrl: '../../../../../../app/shared/starts-with/text/starts-with-text.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, TranslateModule] + selector: 'ds-starts-with-text', + // styleUrls: ['./starts-with-text.component.scss'], + styleUrls: ['../../../../../../app/shared/starts-with/text/starts-with-text.component.scss'], + // templateUrl: './starts-with-text.component.html', + templateUrl: '../../../../../../app/shared/starts-with/text/starts-with-text.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, TranslateModule], }) export class StartsWithTextComponent extends BaseComponent { } diff --git a/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts b/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts index 454497a14e..76d815bafd 100644 --- a/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts @@ -1,16 +1,12 @@ -import { Component } from '@angular/core'; - -import { - CollectionStatisticsPageComponent as BaseComponent -} from '../../../../../app/statistics-page/collection-statistics-page/collection-statistics-page.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { - StatisticsTableComponent -} from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { CollectionStatisticsPageComponent as BaseComponent } from '../../../../../app/statistics-page/collection-statistics-page/collection-statistics-page.component'; +import { StatisticsTableComponent } from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; + @Component({ selector: 'ds-collection-statistics-page', // styleUrls: ['./collection-statistics-page.component.scss'], diff --git a/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts b/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts index 326b974b42..019447903b 100644 --- a/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts @@ -1,16 +1,12 @@ -import { Component } from '@angular/core'; - -import { - CommunityStatisticsPageComponent as BaseComponent -} from '../../../../../app/statistics-page/community-statistics-page/community-statistics-page.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { - StatisticsTableComponent -} from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { CommunityStatisticsPageComponent as BaseComponent } from '../../../../../app/statistics-page/community-statistics-page/community-statistics-page.component'; +import { StatisticsTableComponent } from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; + @Component({ selector: 'ds-collection-statistics-page', // styleUrls: ['./community-statistics-page.component.scss'], diff --git a/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts b/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts index 735789ea58..66b50d4ae7 100644 --- a/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts @@ -1,16 +1,12 @@ -import { Component } from '@angular/core'; - -import { - ItemStatisticsPageComponent as BaseComponent -} from '../../../../../app/statistics-page/item-statistics-page/item-statistics-page.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { - StatisticsTableComponent -} from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { ItemStatisticsPageComponent as BaseComponent } from '../../../../../app/statistics-page/item-statistics-page/item-statistics-page.component'; +import { StatisticsTableComponent } from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; + @Component({ selector: 'ds-item-statistics-page', // styleUrls: ['./item-statistics-page.component.scss'], diff --git a/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts b/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts index 17eddc49cb..de5c8afd77 100644 --- a/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts +++ b/src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts @@ -1,16 +1,12 @@ -import { Component } from '@angular/core'; - -import { - SiteStatisticsPageComponent as BaseComponent -} from '../../../../../app/statistics-page/site-statistics-page/site-statistics-page.component'; import { CommonModule } from '@angular/common'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { - StatisticsTableComponent -} from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { SiteStatisticsPageComponent as BaseComponent } from '../../../../../app/statistics-page/site-statistics-page/site-statistics-page.component'; +import { StatisticsTableComponent } from '../../../../../app/statistics-page/statistics-table/statistics-table.component'; + @Component({ selector: 'ds-site-statistics-page', // styleUrls: ['./site-statistics-page.component.scss'], diff --git a/src/themes/custom/app/submission/edit/submission-edit.component.ts b/src/themes/custom/app/submission/edit/submission-edit.component.ts index a094fd5d72..31eb84ffbc 100644 --- a/src/themes/custom/app/submission/edit/submission-edit.component.ts +++ b/src/themes/custom/app/submission/edit/submission-edit.component.ts @@ -14,8 +14,8 @@ import { SubmissionFormComponent } from '../../../../../app/submission/form/subm templateUrl: '../../../../../app/submission/edit/submission-edit.component.html', standalone: true, imports: [ - SubmissionFormComponent - ] + SubmissionFormComponent, + ], }) export class SubmissionEditComponent extends BaseComponent { } diff --git a/src/themes/custom/app/submission/import-external/submission-import-external.component.ts b/src/themes/custom/app/submission/import-external/submission-import-external.component.ts index 2f3b73780b..6a5632b8b6 100644 --- a/src/themes/custom/app/submission/import-external/submission-import-external.component.ts +++ b/src/themes/custom/app/submission/import-external/submission-import-external.component.ts @@ -1,19 +1,18 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { fadeIn } from '../../../../../app/shared/animations/fade'; -import { - SubmissionImportExternalComponent as BaseComponent -} from '../../../../../app/submission/import-external/submission-import-external.component'; -import { ObjectCollectionComponent } from '../../../../../app/shared/object-collection/object-collection.component'; -import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; -import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - SubmissionImportExternalSearchbarComponent -} from '../../../../../app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; import { RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; + +import { AlertComponent } from '../../../../../app/shared/alert/alert.component'; +import { fadeIn } from '../../../../../app/shared/animations/fade'; +import { ThemedLoadingComponent } from '../../../../../app/shared/loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../../../../app/shared/object-collection/object-collection.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { SubmissionImportExternalSearchbarComponent } from '../../../../../app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component'; +import { SubmissionImportExternalComponent as BaseComponent } from '../../../../../app/submission/import-external/submission-import-external.component'; /** * This component allows to submit a new workspaceitem importing the data from an external source. @@ -35,7 +34,7 @@ import { RouterLink } from '@angular/router'; SubmissionImportExternalSearchbarComponent, TranslateModule, VarDirective, - RouterLink + RouterLink, ], }) export class SubmissionImportExternalComponent extends BaseComponent { diff --git a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts index 9e9c2cc396..e6ed853f6d 100644 --- a/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts +++ b/src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts @@ -1,16 +1,14 @@ +import { + AsyncPipe, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { - SubmissionSectionUploadFileComponent as BaseComponent -} from 'src/app/submission/sections/upload/file/section-upload-file.component'; import { TranslateModule } from '@ngx-translate/core'; -import { - SubmissionSectionUploadFileViewComponent -} from '../../../../../../../app/submission/sections/upload/file/view/section-upload-file-view.component'; -import { AsyncPipe, NgIf } from '@angular/common'; -import { - ThemedFileDownloadLinkComponent -} from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; +import { SubmissionSectionUploadFileComponent as BaseComponent } from 'src/app/submission/sections/upload/file/section-upload-file.component'; + +import { ThemedFileDownloadLinkComponent } from '../../../../../../../app/shared/file-download-link/themed-file-download-link.component'; import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pipe'; +import { SubmissionSectionUploadFileViewComponent } from '../../../../../../../app/submission/sections/upload/file/view/section-upload-file-view.component'; /** * This component represents a single bitstream contained in the submission @@ -28,7 +26,7 @@ import { FileSizePipe } from '../../../../../../../app/shared/utils/file-size-pi NgIf, AsyncPipe, ThemedFileDownloadLinkComponent, - FileSizePipe + FileSizePipe, ], }) export class SubmissionSectionUploadFileComponent diff --git a/src/themes/custom/app/submission/submit/submission-submit.component.ts b/src/themes/custom/app/submission/submit/submission-submit.component.ts index c4d1d67777..9a2a5c51ff 100644 --- a/src/themes/custom/app/submission/submit/submission-submit.component.ts +++ b/src/themes/custom/app/submission/submit/submission-submit.component.ts @@ -6,12 +6,12 @@ import { SubmissionSubmitComponent as BaseComponent } from '../../../../../app/s * This component allows to submit a new workspaceitem. */ @Component({ - selector: 'ds-submission-submit', - // styleUrls: ['./submission-submit.component.scss'], - styleUrls: ['../../../../../app/submission/submit/submission-submit.component.scss'], - // templateUrl: './submission-submit.component.html' - templateUrl: '../../../../../app/submission/submit/submission-submit.component.html', - standalone: true + selector: 'ds-submission-submit', + // styleUrls: ['./submission-submit.component.scss'], + styleUrls: ['../../../../../app/submission/submit/submission-submit.component.scss'], + // templateUrl: './submission-submit.component.html' + templateUrl: '../../../../../app/submission/submit/submission-submit.component.html', + standalone: true, }) export class SubmissionSubmitComponent extends BaseComponent { } diff --git a/src/themes/custom/app/thumbnail/thumbnail.component.ts b/src/themes/custom/app/thumbnail/thumbnail.component.ts index 73cb6e034f..4247e8df84 100644 --- a/src/themes/custom/app/thumbnail/thumbnail.component.ts +++ b/src/themes/custom/app/thumbnail/thumbnail.component.ts @@ -1,11 +1,11 @@ -import { Component } from '@angular/core'; - -import { ThumbnailComponent as BaseComponent } from '../../../../app/thumbnail/thumbnail.component'; -import { VarDirective } from '../../../../app/shared/utils/var.directive'; import { CommonModule } from '@angular/common'; -import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; +import { Component } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; + +import { ThemedLoadingComponent } from '../../../../app/shared/loading/themed-loading.component'; import { SafeUrlPipe } from '../../../../app/shared/utils/safe-url-pipe'; +import { VarDirective } from '../../../../app/shared/utils/var.directive'; +import { ThumbnailComponent as BaseComponent } from '../../../../app/thumbnail/thumbnail.component'; @Component({ selector: 'ds-thumbnail', @@ -14,7 +14,7 @@ import { SafeUrlPipe } from '../../../../app/shared/utils/safe-url-pipe'; // templateUrl: './thumbnail.component.html', templateUrl: '../../../../app/thumbnail/thumbnail.component.html', standalone: true, - imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe] + imports: [VarDirective, CommonModule, ThemedLoadingComponent, TranslateModule, SafeUrlPipe], }) export class ThumbnailComponent extends BaseComponent { } diff --git a/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts b/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts index 772122fd11..d852d3ac3e 100644 --- a/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts +++ b/src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts @@ -1,14 +1,10 @@ -import { Component } from '@angular/core'; - -import { - WorkflowItemDeleteComponent as BaseComponent -} from '../../../../../app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; -import { - ModifyItemOverviewComponent -} from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ModifyItemOverviewComponent } from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { WorkflowItemDeleteComponent as BaseComponent } from '../../../../../app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component'; @Component({ selector: 'ds-workflow-item-delete', @@ -16,7 +12,7 @@ import { // templateUrl: './workflow-item-delete.component.html' templateUrl: '../../../../../app/workflowitems-edit-page/workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent] + imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], }) /** * Component representing a page to delete a workflow item diff --git a/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts b/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts index d8ae187df3..450cb88837 100644 --- a/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts +++ b/src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts @@ -1,14 +1,10 @@ -import { Component } from '@angular/core'; - -import { - WorkflowItemSendBackComponent as BaseComponent -} from '../../../../../app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component'; -import { VarDirective } from '../../../../../app/shared/utils/var.directive'; -import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; -import { - ModifyItemOverviewComponent -} from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ModifyItemOverviewComponent } from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { VarDirective } from '../../../../../app/shared/utils/var.directive'; +import { WorkflowItemSendBackComponent as BaseComponent } from '../../../../../app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component'; @Component({ selector: 'ds-workflow-item-send-back', @@ -19,7 +15,7 @@ import { // templateUrl: './workflow-item-send-back.component.html' templateUrl: '../../../../../app/workflowitems-edit-page/workflow-item-action-page.component.html', standalone: true, - imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent] + imports: [VarDirective, TranslateModule, CommonModule, ModifyItemOverviewComponent], }) /** * Component representing a page to send back a workflow item to the submitter diff --git a/src/themes/custom/app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component.ts b/src/themes/custom/app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component.ts index 71535ff995..94b89f4c24 100644 --- a/src/themes/custom/app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component.ts +++ b/src/themes/custom/app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component.ts @@ -1,13 +1,9 @@ -import { Component } from '@angular/core'; - -import { - WorkspaceItemsDeletePageComponent as BaseComponent -} from '../../../../../app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component'; -import { - ModifyItemOverviewComponent -} from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; -import { TranslateModule } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; +import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ModifyItemOverviewComponent } from '../../../../../app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component'; +import { WorkspaceItemsDeletePageComponent as BaseComponent } from '../../../../../app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component'; @Component({ @@ -17,7 +13,7 @@ import { CommonModule } from '@angular/common'; imports: [ ModifyItemOverviewComponent, TranslateModule, - CommonModule + CommonModule, ], }) export class WorkspaceItemsDeletePageComponent extends BaseComponent { diff --git a/src/themes/custom/eager-theme.module.ts b/src/themes/custom/eager-theme.module.ts index 7f4005e1a5..4ca6776ab4 100644 --- a/src/themes/custom/eager-theme.module.ts +++ b/src/themes/custom/eager-theme.module.ts @@ -1,18 +1,21 @@ -import { CommonModule } from '@angular/common'; +import { + CommonModule, + CommonModule, +} from '@angular/common'; import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { HomeNewsComponent } from './app/home-page/home-news/home-news.component'; -import { NavbarComponent } from './app/navbar/navbar.component'; -import { SearchNavbarComponent } from './app/search-navbar/search-navbar.component'; import { ItemPageModule } from '../../app/item-page/item-page.module'; import { ItemSharedModule } from '../../app/item-page/item-shared.module'; import { NavbarModule } from '../../app/navbar/navbar.module'; import { RootModule } from '../../app/root.module'; -import { SharedBrowseByModule } from '../../app/shared/browse-by/shared-browse-by.module'; -import { DsoPageModule } from '../../app/shared/dso-page/dso-page.module'; -import { ResultsBackButtonModule } from '../../app/shared/results-back-button/results-back-button.module'; -import { SharedModule } from '../../app/shared/shared.module'; +import { + SharedBrowseByModule, + SharedBrowseByModule, +} from '../../app/shared/browse-by/shared-browse-by.module'; +import { + DsoPageModule, + DsoPageModule, +} from '../../app/shared/dso-page/dso-page.module'; import { JournalComponent } from './app/entity-groups/journal-entities/item-pages/journal/journal.component'; import { JournalIssueComponent } from './app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component'; import { JournalVolumeComponent } from './app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component'; @@ -20,13 +23,21 @@ import { PersonComponent } from './app/entity-groups/research-entities/item-page import { FooterComponent } from './app/footer/footer.component'; import { HeaderComponent } from './app/header/header.component'; import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; -import { HomeNewsComponent } from './app/home-page/home-news/home-news.component'; +import { + HomeNewsComponent, + HomeNewsComponent, +} from './app/home-page/home-news/home-news.component'; import { TopLevelCommunityListComponent } from './app/home-page/top-level-community-list/top-level-community-list.component'; import { PublicationComponent } from './app/item-page/simple/item-types/publication/publication.component'; import { UntypedItemComponent } from './app/item-page/simple/item-types/untyped-item/untyped-item.component'; -import { NavbarComponent } from './app/navbar/navbar.component'; import { - SearchNavbarComponent } from './app/search-navbar/search-navbar.component'; + NavbarComponent, + NavbarComponent, +} from './app/navbar/navbar.component'; +import { + SearchNavbarComponent, + SearchNavbarComponent, +} from './app/search-navbar/search-navbar.component'; import { CollectionDropdownComponent } from './app/shared/collection-dropdown/collection-dropdown.component'; import { CreateCollectionParentSelectorComponent } from './app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component'; import { CreateCommunityParentSelectorComponent } from './app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component'; @@ -34,15 +45,10 @@ import { CreateItemParentSelectorComponent } from './app/shared/dso-selector/mod import { EditCollectionSelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component'; import { EditCommunitySelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component'; import { EditItemSelectorComponent } from './app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component'; -import { SharedBrowseByModule } from '../../app/shared/browse-by/shared-browse-by.module'; - -import { DsoPageModule } from '../../app/shared/dso-page/dso-page.module'; import { FileDownloadLinkComponent } from './app/shared/file-download-link/file-download-link.component'; import { LangSwitchComponent } from './app/shared/lang-switch/lang-switch.component'; import { LogInComponent } from './app/shared/log-in/log-in.component'; -import { - BrowseEntryListElementComponent -} from './app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component'; +import { BrowseEntryListElementComponent } from './app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component'; import { CollectionListElementComponent } from './app/shared/object-list/collection-list-element/collection-list-element.component'; import { CommunityListElementComponent } from './app/shared/object-list/community-list-element/community-list-element.component'; import { ItemSearchResultListElementComponent } from './app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component'; @@ -92,7 +98,7 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ + imports: [ CommonModule, RootModule, NavbarModule, @@ -100,8 +106,8 @@ const DECLARATIONS = [ ItemPageModule, ItemSharedModule, DsoPageModule, - ...DECLARATIONS -], + ...DECLARATIONS, + ], providers: [ ...ENTRY_COMPONENTS.map((component) => ({ provide: component })), ], diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index 2a1fb4c343..6d07cc5f88 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -11,9 +11,9 @@ import { StoreModule } from '@ngrx/store'; import { TranslateModule } from '@ngx-translate/core'; import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'; import { IdlePreloadModule } from 'angular-idle-preload'; + import { AppModule } from '../../app/app.module'; import { EditItemPageModule } from '../../app/item-page/edit-item-page/edit-item-page.module'; -import { MenuModule } from '../../app/shared/menu/menu.module'; import { ItemPageModule } from '../../app/item-page/item-page.module'; import { ItemSharedModule } from '../../app/item-page/item-shared.module'; import { ItemVersionsModule } from '../../app/item-page/versions/item-versions.module'; @@ -25,14 +25,12 @@ import { SearchPageModule } from '../../app/search-page/search-page.module'; import { SharedBrowseByModule } from '../../app/shared/browse-by/shared-browse-by.module'; import { DsoPageModule } from '../../app/shared/dso-page/dso-page.module'; import { FormModule } from '../../app/shared/form/form.module'; +import { MenuModule } from '../../app/shared/menu/menu.module'; import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resource-policies.module'; import { SearchModule } from '../../app/shared/search/search.module'; import { StatisticsModule } from '../../app/statistics/statistics.module'; import { StatisticsPageModule } from '../../app/statistics-page/statistics-page.module'; import { SubmissionModule } from '../../app/submission/submission.module'; -import { FileSectionComponent } from './app/item-page/simple/field-components/file-section/file-section.component'; -import { HomePageComponent } from './app/home-page/home-page.component'; -import { RootComponent } from './app/root/root.component'; import { SystemWideAlertModule } from '../../app/system-wide-alert/system-wide-alert.module'; import { AdminSidebarComponent } from './app/admin/admin-sidebar/admin-sidebar.component'; import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component'; @@ -42,53 +40,37 @@ import { BrowseByMetadataComponent } from './app/browse-by/browse-by-metadata/br import { BrowseByTaxonomyComponent } from './app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component'; import { BrowseByTitleComponent } from './app/browse-by/browse-by-title/browse-by-title.component'; import { CollectionPageComponent } from './app/collection-page/collection-page.component'; -import { - EditItemTemplatePageComponent -} from './app/collection-page/edit-item-template-page/edit-item-template-page.component'; +import { EditItemTemplatePageComponent } from './app/collection-page/edit-item-template-page/edit-item-template-page.component'; import { CommunityListComponent } from './app/community-list-page/community-list/community-list.component'; import { CommunityListPageComponent } from './app/community-list-page/community-list-page.component'; import { CommunityPageComponent } from './app/community-page/community-page.component'; -import { - CommunityPageSubCollectionListComponent -} from './app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component'; -import { - CommunityPageSubCommunityListComponent -} from './app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; +import { CommunityPageSubCollectionListComponent } from './app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component'; +import { CommunityPageSubCommunityListComponent } from './app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component'; import { DsoEditMetadataComponent } from './app/dso-shared/dso-edit-metadata/dso-edit-metadata.component'; import { ForbiddenComponent } from './app/forbidden/forbidden.component'; import { ForgotEmailComponent } from './app/forgot-password/forgot-password-email/forgot-email.component'; import { ForgotPasswordFormComponent } from './app/forgot-password/forgot-password-form/forgot-password-form.component'; +import { HomePageComponent } from './app/home-page/home-page.component'; import { EndUserAgreementComponent } from './app/info/end-user-agreement/end-user-agreement.component'; import { FeedbackComponent } from './app/info/feedback/feedback.component'; import { FeedbackFormComponent } from './app/info/feedback/feedback-form/feedback-form.component'; import { PrivacyComponent } from './app/info/privacy/privacy.component'; import { ItemAlertsComponent } from './app/item-page/alerts/item-alerts.component'; import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/item-status.component'; -import { - FullFileSectionComponent -} from './app/item-page/full/field-components/file-section/full-file-section.component'; +import { FullFileSectionComponent } from './app/item-page/full/field-components/file-section/full-file-section.component'; import { FullItemPageComponent } from './app/item-page/full/full-item-page.component'; import { MediaViewerComponent } from './app/item-page/media-viewer/media-viewer.component'; -import { - MediaViewerImageComponent -} from './app/item-page/media-viewer/media-viewer-image/media-viewer-image.component'; -import { - MediaViewerVideoComponent -} from './app/item-page/media-viewer/media-viewer-video/media-viewer-video.component'; -import { - ItemPageTitleFieldComponent -} from './app/item-page/simple/field-components/specific-field/title/item-page-title-field.component'; +import { MediaViewerImageComponent } from './app/item-page/media-viewer/media-viewer-image/media-viewer-image.component'; +import { MediaViewerVideoComponent } from './app/item-page/media-viewer/media-viewer-video/media-viewer-video.component'; +import { FileSectionComponent } from './app/item-page/simple/field-components/file-section/file-section.component'; +import { ItemPageTitleFieldComponent } from './app/item-page/simple/field-components/specific-field/title/item-page-title-field.component'; import { ItemPageComponent } from './app/item-page/simple/item-page.component'; -import { - MetadataRepresentationListComponent -} from './app/item-page/simple/metadata-representation-list/metadata-representation-list.component'; +import { MetadataRepresentationListComponent } from './app/item-page/simple/metadata-representation-list/metadata-representation-list.component'; import { LoginPageComponent } from './app/login-page/login-page.component'; import { LogoutPageComponent } from './app/logout-page/logout-page.component'; import { ObjectNotFoundComponent } from './app/lookup-by-id/objectnotfound/objectnotfound.component'; import { MyDSpacePageComponent } from './app/my-dspace-page/my-dspace-page.component'; -import { - ExpandableNavbarSectionComponent -} from './app/navbar/expandable-navbar-section/expandable-navbar-section.component'; +import { ExpandableNavbarSectionComponent } from './app/navbar/expandable-navbar-section/expandable-navbar-section.component'; import { PageNotFoundComponent } from './app/pagenotfound/pagenotfound.component'; import { ProfilePageComponent } from './app/profile-page/profile-page.component'; import { RegisterEmailFormComponent } from './app/register-email-form/register-email-form.component'; @@ -97,6 +79,7 @@ import { RegisterEmailComponent } from './app/register-page/register-email/regis import { DenyRequestCopyComponent } from './app/request-copy/deny-request-copy/deny-request-copy.component'; import { EmailRequestCopyComponent } from './app/request-copy/email-request-copy/email-request-copy.component'; import { GrantRequestCopyComponent } from './app/request-copy/grant-request-copy/grant-request-copy.component'; +import { RootComponent } from './app/root/root.component'; import { ConfigurationSearchPageComponent } from './app/search-page/configuration-search-page.component'; import { SearchPageComponent } from './app/search-page/search-page.component'; import { AuthNavMenuComponent } from './app/shared/auth-nav-menu/auth-nav-menu.component'; @@ -104,23 +87,13 @@ import { UserMenuComponent } from './app/shared/auth-nav-menu/user-menu/user-men import { BrowseByComponent } from './app/shared/browse-by/browse-by.component'; import { ComcolPageBrowseByComponent } from './app/shared/comcol-page-browse-by/comcol-page-browse-by.component'; import { ComcolPageHandleComponent } from './app/shared/comcol-page-handle/comcol-page-handle.component'; -import { - DsDynamicLookupRelationExternalSourceTabComponent -} from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; -import { - ExternalSourceEntryImportModalComponent -} from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component'; -import { - DsDynamicLookupRelationSearchTabComponent -} from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; +import { DsDynamicLookupRelationExternalSourceTabComponent } from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component'; +import { ExternalSourceEntryImportModalComponent } from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/external-source-entry-import-modal/external-source-entry-import-modal.component'; +import { DsDynamicLookupRelationSearchTabComponent } from './app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component'; import { LoadingComponent } from './app/shared/loading/loading.component'; -import { - AccessStatusBadgeComponent -} from './app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component'; +import { AccessStatusBadgeComponent } from './app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component'; import { BadgesComponent } from './app/shared/object-collection/shared/badges/badges.component'; -import { - MyDSpaceStatusBadgeComponent -} from './app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component'; +import { MyDSpaceStatusBadgeComponent } from './app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component'; import { StatusBadgeComponent } from './app/shared/object-collection/shared/badges/status-badge/status-badge.component'; import { TypeBadgeComponent } from './app/shared/object-collection/shared/badges/type-badge/type-badge.component'; import { ObjectListComponent } from './app/shared/object-list/object-list.component'; @@ -130,32 +103,18 @@ import { SearchResultsComponent } from './app/shared/search/search-results/searc import { SearchSettingsComponent } from './app/shared/search/search-settings/search-settings.component'; import { SearchSidebarComponent } from './app/shared/search/search-sidebar/search-sidebar.component'; import { SearchFormComponent } from './app/shared/search-form/search-form.component'; -import { - CollectionStatisticsPageComponent -} from './app/statistics-page/collection-statistics-page/collection-statistics-page.component'; -import { - CommunityStatisticsPageComponent -} from './app/statistics-page/community-statistics-page/community-statistics-page.component'; +import { CollectionStatisticsPageComponent } from './app/statistics-page/collection-statistics-page/collection-statistics-page.component'; +import { CommunityStatisticsPageComponent } from './app/statistics-page/community-statistics-page/community-statistics-page.component'; import { ItemStatisticsPageComponent } from './app/statistics-page/item-statistics-page/item-statistics-page.component'; import { SiteStatisticsPageComponent } from './app/statistics-page/site-statistics-page/site-statistics-page.component'; import { SubmissionEditComponent } from './app/submission/edit/submission-edit.component'; -import { - SubmissionImportExternalComponent -} from './app/submission/import-external/submission-import-external.component'; -import { - SubmissionSectionUploadFileComponent -} from './app/submission/sections/upload/file/section-upload-file.component'; +import { SubmissionImportExternalComponent } from './app/submission/import-external/submission-import-external.component'; +import { SubmissionSectionUploadFileComponent } from './app/submission/sections/upload/file/section-upload-file.component'; import { SubmissionSubmitComponent } from './app/submission/submit/submission-submit.component'; -import { - WorkflowItemDeleteComponent -} from './app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component'; -import { - WorkflowItemSendBackComponent -} from './app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component'; -import { - WorkspaceItemsDeletePageComponent -} from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component'; import { ThumbnailComponent } from './app/thumbnail/thumbnail.component'; +import { WorkflowItemDeleteComponent } from './app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component'; +import { WorkflowItemSendBackComponent } from './app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component'; +import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component'; const DECLARATIONS = [ FileSectionComponent, @@ -244,7 +203,7 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ + imports: [ AppModule, RootModule, CommonModule, @@ -278,8 +237,8 @@ const DECLARATIONS = [ SystemWideAlertModule, NgxGalleryModule, FormModule, - ...DECLARATIONS -], + ...DECLARATIONS, + ], }) /** diff --git a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts index f658dc05c2..c474142233 100644 --- a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -1,11 +1,16 @@ +import { + AsyncPipe, + NgClass, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; -import { ThemedHeaderComponent } from '../../../../app/header/themed-header.component'; -import { AsyncPipe, NgClass, NgIf } from '@angular/common'; -import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; -import { HeaderNavbarWrapperComponent as BaseComponent } from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; -import { slideMobileNav } from '../../../../app/shared/animations/slide'; import { TranslateModule } from '@ngx-translate/core'; +import { ThemedHeaderComponent } from '../../../../app/header/themed-header.component'; +import { HeaderNavbarWrapperComponent as BaseComponent } from '../../../../app/header-nav-wrapper/header-navbar-wrapper.component'; +import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; +import { slideMobileNav } from '../../../../app/shared/animations/slide'; + /** * This component represents a wrapper for the horizontal navbar and the header */ diff --git a/src/themes/dspace/app/header/header.component.ts b/src/themes/dspace/app/header/header.component.ts index 2b0f636efc..1a8144ed96 100644 --- a/src/themes/dspace/app/header/header.component.ts +++ b/src/themes/dspace/app/header/header.component.ts @@ -1,27 +1,34 @@ -import { Component, OnInit } from '@angular/core'; -import { HeaderComponent as BaseComponent } from '../../../../app/header/header.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; -import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; -import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; -import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; -import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; -import { ThemedSearchNavbarComponent } from '../../../../app/search-navbar/themed-search-navbar.component'; +import { + AsyncPipe, + NgIf, +} from '@angular/common'; +import { + Component, + OnInit, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { AsyncPipe, NgIf } from '@angular/common'; +import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component'; + +import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; +import { HeaderComponent as BaseComponent } from '../../../../app/header/header.component'; +import { ThemedNavbarComponent } from '../../../../app/navbar/themed-navbar.component'; +import { ThemedSearchNavbarComponent } from '../../../../app/search-navbar/themed-search-navbar.component'; +import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; +import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; +import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; /** * Represents the header with the logo and simple navigation */ @Component({ - selector: 'ds-header', - styleUrls: ['header.component.scss'], - templateUrl: 'header.component.html', - standalone: true, - imports: [NgbDropdownModule, ThemedLangSwitchComponent, RouterLink, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, ThemedNavbarComponent, TranslateModule, AsyncPipe, NgIf] + selector: 'ds-header', + styleUrls: ['header.component.scss'], + templateUrl: 'header.component.html', + standalone: true, + imports: [NgbDropdownModule, ThemedLangSwitchComponent, RouterLink, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, ThemedNavbarComponent, TranslateModule, AsyncPipe, NgIf], }) export class HeaderComponent extends BaseComponent implements OnInit { public isNavBarCollapsed$: Observable; diff --git a/src/themes/dspace/app/home-page/home-news/home-news.component.ts b/src/themes/dspace/app/home-page/home-news/home-news.component.ts index 50a61fece4..820d6ceaf6 100644 --- a/src/themes/dspace/app/home-page/home-news/home-news.component.ts +++ b/src/themes/dspace/app/home-page/home-news/home-news.component.ts @@ -3,10 +3,10 @@ import { Component } from '@angular/core'; import { HomeNewsComponent as BaseComponent } from '../../../../../app/home-page/home-news/home-news.component'; @Component({ - selector: 'ds-home-news', - styleUrls: ['./home-news.component.scss'], - templateUrl: './home-news.component.html', - standalone: true + selector: 'ds-home-news', + styleUrls: ['./home-news.component.scss'], + templateUrl: './home-news.component.html', + standalone: true, }) /** diff --git a/src/themes/dspace/app/navbar/navbar.component.ts b/src/themes/dspace/app/navbar/navbar.component.ts index ca6aee9e84..45d44a2bb0 100644 --- a/src/themes/dspace/app/navbar/navbar.component.ts +++ b/src/themes/dspace/app/navbar/navbar.component.ts @@ -1,31 +1,37 @@ +import { + AsyncPipe, + NgClass, + NgComponentOutlet, + NgFor, + NgIf, +} from '@angular/common'; import { Component } from '@angular/core'; - -import { NavbarComponent as BaseComponent } from '../../../../app/navbar/navbar.component'; -import { slideMobileNav } from '../../../../app/shared/animations/slide'; -import { TranslateModule } from '@ngx-translate/core'; -import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; -import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; -import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; -import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; -import { SearchNavbarComponent } from '../../../../app/search-navbar/search-navbar.component'; -import { UserMenuComponent } from '../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; import { RouterLink } from '@angular/router'; -import { NgClass, NgIf, NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component'; +import { TranslateModule } from '@ngx-translate/core'; import { ThemedSearchNavbarComponent } from 'src/app/search-navbar/themed-search-navbar.component'; +import { ThemedLangSwitchComponent } from 'src/app/shared/lang-switch/themed-lang-switch.component'; + +import { ContextHelpToggleComponent } from '../../../../app/header/context-help-toggle/context-help-toggle.component'; +import { NavbarComponent as BaseComponent } from '../../../../app/navbar/navbar.component'; +import { SearchNavbarComponent } from '../../../../app/search-navbar/search-navbar.component'; +import { slideMobileNav } from '../../../../app/shared/animations/slide'; +import { ThemedAuthNavMenuComponent } from '../../../../app/shared/auth-nav-menu/themed-auth-nav-menu.component'; import { ThemedUserMenuComponent } from '../../../../app/shared/auth-nav-menu/user-menu/themed-user-menu.component'; +import { UserMenuComponent } from '../../../../app/shared/auth-nav-menu/user-menu/user-menu.component'; +import { ImpersonateNavbarComponent } from '../../../../app/shared/impersonate-navbar/impersonate-navbar.component'; +import { LangSwitchComponent } from '../../../../app/shared/lang-switch/lang-switch.component'; /** * Component representing the public navbar */ @Component({ - selector: 'ds-navbar', - styleUrls: ['./navbar.component.scss'], - templateUrl: './navbar.component.html', - animations: [slideMobileNav], - standalone: true, - imports: [NgbDropdownModule, ThemedLangSwitchComponent, ThemedSearchNavbarComponent, NgClass, RouterLink, NgIf, UserMenuComponent, NgFor, NgComponentOutlet, SearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, AsyncPipe, TranslateModule, ThemedUserMenuComponent] + selector: 'ds-navbar', + styleUrls: ['./navbar.component.scss'], + templateUrl: './navbar.component.html', + animations: [slideMobileNav], + standalone: true, + imports: [NgbDropdownModule, ThemedLangSwitchComponent, ThemedSearchNavbarComponent, NgClass, RouterLink, NgIf, UserMenuComponent, NgFor, NgComponentOutlet, SearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, AsyncPipe, TranslateModule, ThemedUserMenuComponent], }) export class NavbarComponent extends BaseComponent { } diff --git a/src/themes/dspace/eager-theme.module.ts b/src/themes/dspace/eager-theme.module.ts index b01121b36e..6dfcb64719 100644 --- a/src/themes/dspace/eager-theme.module.ts +++ b/src/themes/dspace/eager-theme.module.ts @@ -1,20 +1,28 @@ import { CommonModule } from '@angular/common'; -import { HomeNewsComponent } from './app/home-page/home-news/home-news.component'; -import { NavbarComponent } from './app/navbar/navbar.component'; -import { HeaderComponent } from './app/header/header.component'; -import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; -import { RootModule } from '../../app/root.module'; import { NgModule } from '@angular/core'; import { NavbarModule } from '../../app/navbar/navbar.module'; -import { RootModule } from '../../app/root.module'; +import { + RootModule, + RootModule, +} from '../../app/root.module'; import { SharedBrowseByModule } from '../../app/shared/browse-by/shared-browse-by.module'; -import { ResultsBackButtonModule } from '../../app/shared/results-back-button/results-back-button.module'; -import { SharedModule } from '../../app/shared/shared.module'; -import { HeaderComponent } from './app/header/header.component'; -import { HeaderNavbarWrapperComponent } from './app/header-nav-wrapper/header-navbar-wrapper.component'; -import { HomeNewsComponent } from './app/home-page/home-news/home-news.component'; -import { NavbarComponent } from './app/navbar/navbar.component'; +import { + HeaderComponent, + HeaderComponent, +} from './app/header/header.component'; +import { + HeaderNavbarWrapperComponent, + HeaderNavbarWrapperComponent, +} from './app/header-nav-wrapper/header-navbar-wrapper.component'; +import { + HomeNewsComponent, + HomeNewsComponent, +} from './app/home-page/home-news/home-news.component'; +import { + NavbarComponent, + NavbarComponent, +} from './app/navbar/navbar.component'; /** * Add components that use a custom decorator to ENTRY_COMPONENTS as well as DECLARATIONS. @@ -31,16 +39,16 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ + imports: [ CommonModule, SharedBrowseByModule, RootModule, NavbarModule, - ...DECLARATIONS -], - providers: [ - ...ENTRY_COMPONENTS.map((component) => ({ provide: component })), - ] + ...DECLARATIONS, + ], + providers: [ + ...ENTRY_COMPONENTS.map((component) => ({ provide: component })), + ], }) /** * This module is included in the main bundle that gets downloaded at first page load. So it should diff --git a/src/themes/dspace/lazy-theme.module.ts b/src/themes/dspace/lazy-theme.module.ts index 792aa48cc9..c3dbfe7133 100644 --- a/src/themes/dspace/lazy-theme.module.ts +++ b/src/themes/dspace/lazy-theme.module.ts @@ -11,10 +11,10 @@ import { TranslateModule } from '@ngx-translate/core'; import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'; import { IdlePreloadModule } from 'angular-idle-preload'; import { ItemSharedModule } from 'src/app/item-page/item-shared.module'; + import { AppModule } from '../../app/app.module'; import { BrowseByPageModule } from '../../app/browse-by/browse-by-page.module'; import { EditItemPageModule } from '../../app/item-page/edit-item-page/edit-item-page.module'; -import { MenuModule } from '../../app/shared/menu/menu.module'; import { ItemPageModule } from '../../app/item-page/item-page.module'; import { ItemVersionsModule } from '../../app/item-page/versions/item-versions.module'; import { MyDSpacePageModule } from '../../app/my-dspace-page/my-dspace-page.module'; @@ -23,6 +23,7 @@ import { RegisterEmailFormModule } from '../../app/register-email-form/register- import { RootModule } from '../../app/root.module'; import { SearchPageModule } from '../../app/search-page/search-page.module'; import { SharedBrowseByModule } from '../../app/shared/browse-by/shared-browse-by.module'; +import { MenuModule } from '../../app/shared/menu/menu.module'; import { ResourcePoliciesModule } from '../../app/shared/resource-policies/resource-policies.module'; import { SearchModule } from '../../app/shared/search/search.module'; import { StatisticsModule } from '../../app/statistics/statistics.module'; @@ -64,7 +65,7 @@ const DECLARATIONS = [ SearchModule, FormsModule, ResourcePoliciesModule, -], + ], declarations: DECLARATIONS, })