From 54614c21f0793befb96498af043f5437bb2b6b10 Mon Sep 17 00:00:00 2001 From: Enea Jahollari Date: Mon, 25 Sep 2023 12:43:29 +0200 Subject: [PATCH 001/317] feat: migrate everything to standalone and fix build errors --- .eslintrc.json | 1 - .../access-control/access-control.module.ts | 58 ++++---- .../bulk-access-browse.component.spec.ts | 16 +-- .../browse/bulk-access-browse.component.ts | 30 +++- .../bulk-access/bulk-access.component.spec.ts | 16 +-- .../bulk-access/bulk-access.component.ts | 10 +- .../bulk-access-settings.component.spec.ts | 7 +- .../bulk-access-settings.component.ts | 12 +- .../epeople-registry.component.spec.ts | 22 ++- .../epeople-registry.component.ts | 20 ++- .../eperson-form.component.spec.ts | 24 ++-- .../eperson-form/eperson-form.component.ts | 18 ++- .../group-form/group-form.component.spec.ts | 26 ++-- .../group-form/group-form.component.ts | 21 ++- .../members-list.component.spec.ts | 22 ++- .../members-list/members-list.component.ts | 23 ++- .../subgroups-list.component.spec.ts | 22 ++- .../subgroup-list/subgroups-list.component.ts | 22 ++- .../groups-registry.component.spec.ts | 22 ++- .../groups-registry.component.ts | 23 ++- .../admin-curation-tasks.component.spec.ts | 7 +- .../admin-curation-tasks.component.ts | 7 + .../batch-import-page.component.spec.ts | 16 +-- .../batch-import-page.component.ts | 19 ++- .../metadata-import-page.component.spec.ts | 16 +-- .../metadata-import-page.component.ts | 14 +- .../admin-registries.module.ts | 26 ++-- .../add-bitstream-format.component.spec.ts | 28 ++-- .../add-bitstream-format.component.ts | 8 +- .../bitstream-formats.component.spec.ts | 43 +++--- .../bitstream-formats.component.ts | 17 ++- .../bitstream-formats.module.ts | 24 ++-- .../edit-bitstream-format.component.spec.ts | 30 ++-- .../edit-bitstream-format.component.ts | 10 +- .../format-form/format-form.component.spec.ts | 11 +- .../format-form/format-form.component.ts | 9 +- .../metadata-registry.component.spec.ts | 11 +- .../metadata-registry.component.ts | 20 ++- .../metadata-schema-form.component.spec.ts | 11 +- .../metadata-schema-form.component.ts | 13 +- .../metadata-field-form.component.spec.ts | 11 +- .../metadata-field-form.component.ts | 13 +- .../metadata-schema.component.spec.ts | 11 +- .../metadata-schema.component.ts | 22 ++- .../admin-search-page.component.spec.ts | 6 +- .../admin-search-page.component.ts | 9 +- ...arch-result-grid-element.component.spec.ts | 14 +- ...in-search-result-grid-element.component.ts | 10 +- ...arch-result-grid-element.component.spec.ts | 16 +-- ...in-search-result-grid-element.component.ts | 10 +- ...arch-result-grid-element.component.spec.ts | 36 ++--- ...in-search-result-grid-element.component.ts | 9 +- ...arch-result-list-element.component.spec.ts | 14 +- ...in-search-result-list-element.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 14 +- ...in-search-result-list-element.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 14 +- ...in-search-result-list-element.component.ts | 10 +- ...in-search-result-actions.component.spec.ts | 12 +- ...m-admin-search-result-actions.component.ts | 11 +- .../admin-search-page/admin-search.module.ts | 18 ++- .../admin-sidebar-section.component.spec.ts | 36 ++--- .../admin-sidebar-section.component.ts | 15 +- .../admin-sidebar.component.spec.ts | 17 ++- .../admin-sidebar/admin-sidebar.component.ts | 13 +- ...le-admin-sidebar-section.component.spec.ts | 14 +- ...andable-admin-sidebar-section.component.ts | 14 +- .../themed-admin-sidebar.component.ts | 7 +- .../admin-workflow-page.component.spec.ts | 6 +- .../admin-workflow-page.component.ts | 9 +- ...m-admin-workflow-actions.component.spec.ts | 12 +- ...w-item-admin-workflow-actions.component.ts | 11 +- ...ion-order-group-selector.component.spec.ts | 11 +- ...ervision-order-group-selector.component.ts | 14 +- ...supervision-order-status.component.spec.ts | 22 +-- .../supervision-order-status.component.ts | 12 +- ...m-admin-workflow-actions.component.spec.ts | 16 +-- ...e-item-admin-workflow-actions.component.ts | 14 +- ...in-workflow-grid-element.component.spec.ts | 32 ++--- ...t-admin-workflow-grid-element.component.ts | 11 +- ...in-workflow-grid-element.component.spec.ts | 34 ++--- ...t-admin-workflow-grid-element.component.ts | 11 +- ...in-workflow-list-element.component.spec.ts | 28 ++-- ...t-admin-workflow-list-element.component.ts | 12 +- ...in-workflow-list-element.component.spec.ts | 30 ++-- ...t-admin-workflow-list-element.component.ts | 12 +- .../admin-workflow.module.ts | 28 ++-- src/app/admin/admin.module.ts | 28 ++-- src/app/app-routing.module.ts | 4 +- src/app/app.component.ts | 13 +- src/app/app.module.ts | 26 ++-- ...bitstream-authorizations.component.spec.ts | 24 ++-- .../bitstream-authorizations.component.ts | 12 +- .../bitstream-download-page.component.spec.ts | 9 +- .../bitstream-download-page.component.ts | 10 +- .../bitstream-page/bitstream-page.module.ts | 24 ++-- .../edit-bitstream-page.component.spec.ts | 103 +++++++------ .../edit-bitstream-page.component.ts | 27 +++- .../themed-edit-bitstream-page.component.ts | 7 +- .../breadcrumbs/breadcrumbs.component.spec.ts | 24 ++-- src/app/breadcrumbs/breadcrumbs.component.ts | 9 +- .../themed-breadcrumbs.component.ts | 7 +- .../browse-by-date-page.component.spec.ts | 11 +- .../browse-by-date-page.component.ts | 32 ++++- .../themed-browse-by-date-page.component.ts | 7 +- .../browse-by-metadata-page.component.spec.ts | 11 +- .../browse-by-metadata-page.component.ts | 32 ++++- ...hemed-browse-by-metadata-page.component.ts | 7 +- .../browse-by-switcher.component.spec.ts | 10 +- .../browse-by-switcher.component.ts | 5 +- .../themed-browse-by-switcher.component.ts | 7 +- .../browse-by-taxonomy-page.component.spec.ts | 11 +- .../browse-by-taxonomy-page.component.ts | 12 +- ...hemed-browse-by-taxonomy-page.component.ts | 7 +- .../browse-by-title-page.component.spec.ts | 11 +- .../browse-by-title-page.component.ts | 36 ++++- .../themed-browse-by-title-page.component.ts | 7 +- src/app/browse-by/browse-by.module.ts | 28 ++-- .../collection-form.component.ts | 20 ++- .../collection-form/collection-form.module.ts | 20 ++- .../collection-item-mapper.component.spec.ts | 9 +- .../collection-item-mapper.component.ts | 17 ++- .../collection-page.component.ts | 40 +++++- .../collection-page/collection-page.module.ts | 44 +++--- .../create-collection-page.component.spec.ts | 17 ++- .../create-collection-page.component.ts | 12 +- .../delete-collection-page.component.spec.ts | 11 +- .../delete-collection-page.component.ts | 13 +- ...ollection-access-control.component.spec.ts | 4 +- .../collection-access-control.component.ts | 10 ++ ...ollection-authorizations.component.spec.ts | 16 +-- .../collection-authorizations.component.ts | 7 + .../collection-curate.component.spec.ts | 15 +- .../collection-curate.component.ts | 9 ++ .../collection-metadata.component.spec.ts | 13 +- .../collection-metadata.component.ts | 16 ++- .../collection-roles.component.spec.ts | 18 ++- .../collection-roles.component.ts | 10 ++ ...llection-source-controls.component.spec.ts | 25 ++-- .../collection-source-controls.component.ts | 11 +- .../collection-source.component.spec.ts | 11 +- .../collection-source.component.ts | 16 ++- .../edit-collection-page.component.spec.ts | 11 +- .../edit-collection-page.component.ts | 16 ++- .../edit-collection-page.module.ts | 38 +++-- .../edit-item-template-page.component.spec.ts | 11 +- .../edit-item-template-page.component.ts | 19 ++- ...hemed-edit-item-template-page.component.ts | 7 +- .../themed-collection-page.component.ts | 7 +- .../community-list-page.component.spec.ts | 22 +-- .../community-list-page.component.ts | 8 +- .../community-list-page.module.ts | 24 ++-- .../community-list.component.spec.ts | 21 +-- .../community-list.component.ts | 12 +- .../themed-community-list.component.ts | 7 +- .../themed-community-list-page.component.ts | 7 +- .../community-form.component.ts | 20 ++- .../community-form/community-form.module.ts | 20 ++- .../community-page.component.ts | 46 +++++- .../community-page/community-page.module.ts | 28 ++-- .../create-community-page.component.spec.ts | 11 +- .../create-community-page.component.ts | 15 +- .../delete-community-page.component.spec.ts | 13 +- .../delete-community-page.component.ts | 13 +- ...community-access-control.component.spec.ts | 4 +- .../community-access-control.component.ts | 10 ++ ...community-authorizations.component.spec.ts | 16 +-- .../community-authorizations.component.ts | 7 + .../community-curate.component.spec.ts | 15 +- .../community-curate.component.ts | 9 ++ .../community-metadata.component.spec.ts | 11 +- .../community-metadata.component.ts | 7 + .../community-roles.component.spec.ts | 18 ++- .../community-roles.component.ts | 10 ++ .../edit-community-page.component.spec.ts | 11 +- .../edit-community-page.component.ts | 16 ++- .../edit-community-page.module.ts | 32 ++--- ...page-sub-collection-list.component.spec.ts | 16 +-- ...nity-page-sub-collection-list.component.ts | 18 ++- ...nity-page-sub-collection-list.component.ts | 7 +- ...-page-sub-community-list.component.spec.ts | 16 +-- ...unity-page-sub-community-list.component.ts | 18 ++- ...unity-page-sub-community-list.component.ts | 7 +- .../themed-community-page.component.ts | 7 +- src/app/core/auth/auth.service.spec.ts | 47 +++--- .../core/eperson/eperson-data.service.spec.ts | 19 ++- .../core/eperson/group-data.service.spec.ts | 19 ++- .../google-recaptcha.module.ts | 7 +- .../core/registry/registry.service.spec.ts | 17 +-- .../core/shared/search/search.service.spec.ts | 90 ++++++------ .../curation-form.component.spec.ts | 13 +- .../curation-form/curation-form.component.ts | 11 +- ...it-metadata-field-values.component.spec.ts | 10 +- ...so-edit-metadata-field-values.component.ts | 13 +- ...so-edit-metadata-headers.component.spec.ts | 10 +- .../dso-edit-metadata-headers.component.ts | 9 +- ...o-edit-metadata-value-headers.component.ts | 9 +- .../dso-edit-metadata-value.component.spec.ts | 11 +- .../dso-edit-metadata-value.component.ts | 17 ++- .../dso-edit-metadata.component.spec.ts | 11 +- .../dso-edit-metadata.component.ts | 17 ++- .../metadata-field-selector.component.spec.ts | 11 +- .../metadata-field-selector.component.ts | 14 +- .../themed-dso-edit-metadata.component.ts | 7 +- src/app/dso-shared/dso-shared.module.ts | 40 +++--- ...urnal-issue-grid-element.component.spec.ts | 11 +- .../journal-issue-grid-element.component.ts | 9 +- ...rnal-volume-grid-element.component.spec.ts | 11 +- .../journal-volume-grid-element.component.ts | 9 +- .../journal-grid-element.component.spec.ts | 11 +- .../journal/journal-grid-element.component.ts | 9 +- ...ue-search-result-grid-element.component.ts | 17 ++- ...me-search-result-grid-element.component.ts | 17 ++- ...al-search-result-grid-element.component.ts | 17 ++- ...urnal-issue-list-element.component.spec.ts | 10 +- .../journal-issue-list-element.component.ts | 9 +- ...rnal-volume-list-element.component.spec.ts | 10 +- .../journal-volume-list-element.component.ts | 9 +- .../journal-list-element.component.spec.ts | 10 +- .../journal/journal-list-element.component.ts | 9 +- ...arch-result-list-element.component.spec.ts | 26 ++-- ...ue-search-result-list-element.component.ts | 14 +- ...arch-result-list-element.component.spec.ts | 26 ++-- ...me-search-result-list-element.component.ts | 14 +- ...arch-result-list-element.component.spec.ts | 26 ++-- ...al-search-result-list-element.component.ts | 14 +- ...e-sidebar-search-list-element.component.ts | 9 +- ...e-sidebar-search-list-element.component.ts | 9 +- ...l-sidebar-search-list-element.component.ts | 9 +- .../journal-issue/journal-issue.component.ts | 18 ++- .../journal-volume.component.ts | 18 ++- .../journal/journal.component.spec.ts | 23 ++- .../item-pages/journal/journal.component.ts | 19 ++- .../journal-entities.module.ts | 18 ++- .../org-unit-grid-element.component.spec.ts | 11 +- .../org-unit-grid-element.component.ts | 9 +- .../person-grid-element.component.spec.ts | 11 +- .../person/person-grid-element.component.ts | 9 +- .../project-grid-element.component.spec.ts | 11 +- .../project/project-grid-element.component.ts | 9 +- ...it-search-result-grid-element.component.ts | 17 ++- ...on-search-result-grid-element.component.ts | 17 ++- ...ct-search-result-grid-element.component.ts | 17 ++- .../org-unit-list-element.component.spec.ts | 10 +- .../org-unit-list-element.component.ts | 9 +- .../person-list-element.component.spec.ts | 10 +- .../person/person-list-element.component.ts | 9 +- .../project-list-element.component.spec.ts | 10 +- .../project/project-list-element.component.ts | 9 +- ...arch-result-list-element.component.spec.ts | 50 +++---- ...it-search-result-list-element.component.ts | 15 +- ...arch-result-list-element.component.spec.ts | 50 +++---- ...on-search-result-list-element.component.ts | 15 +- ...arch-result-list-element.component.spec.ts | 27 ++-- ...ct-search-result-list-element.component.ts | 13 +- ...t-sidebar-search-list-element.component.ts | 9 +- ...n-sidebar-search-list-element.component.ts | 10 +- ...t-sidebar-search-list-element.component.ts | 9 +- .../item-pages/org-unit/org-unit.component.ts | 19 ++- .../item-pages/person/person.component.ts | 19 ++- .../item-pages/project/project.component.ts | 19 ++- ...em-metadata-list-element.component.spec.ts | 12 +- ...it-item-metadata-list-element.component.ts | 9 +- ...em-metadata-list-element.component.spec.ts | 12 +- ...on-item-metadata-list-element.component.ts | 10 +- ...em-metadata-list-element.component.spec.ts | 16 +-- ...ct-item-metadata-list-element.component.ts | 9 +- .../research-entities.module.ts | 20 ++- ...-list-submission-element.component.spec.ts | 7 +- ...entry-list-submission-element.component.ts | 9 +- ...-list-submission-element.component.spec.ts | 11 +- ...esult-list-submission-element.component.ts | 11 +- ...g-unit-input-suggestions.component.spec.ts | 13 +- .../org-unit-input-suggestions.component.ts | 31 ++-- ...-list-submission-element.component.spec.ts | 26 ++-- ...esult-list-submission-element.component.ts | 12 +- .../person-input-suggestions.component.ts | 31 ++-- .../name-variant-modal.component.spec.ts | 7 +- .../name-variant-modal.component.ts | 9 +- src/app/footer/footer.component.spec.ts | 21 ++- src/app/footer/footer.component.ts | 11 +- src/app/footer/themed-footer.component.ts | 7 +- src/app/forbidden/forbidden.component.ts | 10 +- .../forbidden/themed-forbidden.component.ts | 7 +- .../forgot-email.component.spec.ts | 7 +- .../forgot-email.component.ts | 11 +- .../themed-forgot-email.component.ts | 7 +- .../forgot-password-form.component.spec.ts | 23 ++- .../forgot-password-form.component.ts | 15 +- .../themed-forgot-password-form.component.ts | 7 +- .../forgot-password/forgot-password.module.ts | 26 ++-- .../header-navbar-wrapper.component.ts | 11 +- .../themed-header-navbar-wrapper.component.ts | 7 +- .../context-help-toggle.component.spec.ts | 9 +- .../context-help-toggle.component.ts | 10 +- src/app/header/header.component.spec.ts | 15 +- src/app/header/header.component.ts | 16 ++- src/app/header/themed-header.component.ts | 7 +- .../health-info-component.component.spec.ts | 18 ++- .../health-info-component.component.ts | 13 +- .../health-info/health-info.component.spec.ts | 20 ++- .../health-info/health-info.component.ts | 13 +- .../health-page/health-page.component.spec.ts | 22 +-- src/app/health-page/health-page.component.ts | 14 +- src/app/health-page/health-page.module.ts | 28 ++-- .../health-component.component.spec.ts | 20 ++- .../health-component.component.ts | 14 +- .../health-panel.component.spec.ts | 18 ++- .../health-panel/health-panel.component.ts | 15 +- .../health-status.component.spec.ts | 18 +-- .../health-status/health-status.component.ts | 11 +- .../home-news/home-news.component.ts | 7 +- .../home-news/themed-home-news.component.ts | 7 +- src/app/home-page/home-page.component.ts | 15 +- src/app/home-page/home-page.module.ts | 26 ++-- .../recent-item-list.component.spec.ts | 8 +- .../recent-item-list.component.ts | 25 ++-- .../home-page/themed-home-page.component.ts | 7 +- ...emed-top-level-community-list.component.ts | 7 +- ...top-level-community-list.component.spec.ts | 16 +-- .../top-level-community-list.component.ts | 18 ++- .../import-external-page.component.spec.ts | 10 +- .../import-external-page.component.ts | 9 +- .../import-external-page.module.ts | 22 ++- ...d-user-agreement-content.component.spec.ts | 7 +- .../end-user-agreement-content.component.ts | 10 +- .../end-user-agreement.component.spec.ts | 11 +- .../end-user-agreement.component.ts | 12 +- .../themed-end-user-agreement.component.ts | 7 +- .../feedback-form.component.spec.ts | 11 +- .../feedback-form/feedback-form.component.ts | 14 +- .../themed-feedback-form.component.ts | 7 +- .../info/feedback/feedback.component.spec.ts | 7 +- src/app/info/feedback/feedback.component.ts | 9 +- .../feedback/themed-feedback.component.ts | 7 +- src/app/info/info.module.ts | 22 ++- .../privacy-content.component.spec.ts | 7 +- .../privacy-content.component.ts | 10 +- .../info/privacy/privacy.component.spec.ts | 7 +- src/app/info/privacy/privacy.component.ts | 9 +- .../info/privacy/themed-privacy.component.ts | 7 +- .../alerts/item-alerts.component.spec.ts | 7 +- .../item-page/alerts/item-alerts.component.ts | 13 +- .../alerts/themed-item-alerts.component.ts | 7 +- ...ream-request-a-copy-page.component.spec.ts | 27 ++-- ...bitstream-request-a-copy-page.component.ts | 24 +++- .../upload/upload-bitstream.component.spec.ts | 11 +- .../upload/upload-bitstream.component.ts | 20 ++- .../abstract-item-update.component.ts | 5 +- .../edit-item-page.component.spec.ts | 22 ++- .../edit-item-page.component.ts | 18 ++- .../edit-item-page/edit-item-page.module.ts | 102 +++++++------ .../item-access-control.component.spec.ts | 4 +- .../item-access-control.component.ts | 12 +- .../item-authorizations.component.spec.ts | 23 ++- .../item-authorizations.component.ts | 19 ++- .../item-bitstreams.component.spec.ts | 11 +- .../item-bitstreams.component.ts | 21 ++- ...em-edit-bitstream-bundle.component.spec.ts | 9 +- .../item-edit-bitstream-bundle.component.ts | 15 ++ ...-and-drop-bitstream-list.component.spec.ts | 11 +- ...-drag-and-drop-bitstream-list.component.ts | 26 ++++ ...em-edit-bitstream-drag-handle.component.ts | 5 + .../item-edit-bitstream.component.spec.ts | 17 +-- .../item-edit-bitstream.component.ts | 13 ++ .../item-collection-mapper.component.spec.ts | 9 +- .../item-collection-mapper.component.ts | 17 ++- .../item-curate/item-curate.component.spec.ts | 15 +- .../item-curate/item-curate.component.ts | 10 ++ .../item-delete/item-delete.component.spec.ts | 11 +- .../item-delete/item-delete.component.ts | 23 ++- .../item-move/item-move.component.spec.ts | 11 +- .../item-move/item-move.component.ts | 20 ++- .../item-operation.component.spec.ts | 5 +- .../item-operation.component.ts | 13 +- .../item-private.component.spec.ts | 11 +- .../item-private/item-private.component.ts | 13 +- .../item-public/item-public.component.spec.ts | 11 +- .../item-public/item-public.component.ts | 13 +- .../item-register-doi.component.spec.ts | 13 +- .../item-register-doi.component.ts | 17 ++- .../item-reinstate.component.spec.ts | 11 +- .../item-reinstate.component.ts | 13 +- .../edit-relationship-list.component.spec.ts | 11 +- .../edit-relationship-list.component.ts | 19 +++ .../edit-relationship.component.spec.ts | 19 ++- .../edit-relationship.component.ts | 14 ++ .../item-relationships.component.spec.ts | 11 +- .../item-relationships.component.ts | 16 ++- .../item-status/item-status.component.spec.ts | 9 +- .../item-status/item-status.component.ts | 17 ++- .../themed-item-status.component.ts | 7 +- .../item-version-history.component.spec.ts | 11 +- .../item-version-history.component.ts | 12 +- .../item-withdraw.component.spec.ts | 11 +- .../item-withdraw/item-withdraw.component.ts | 13 +- .../modify-item-overview.component.spec.ts | 5 +- .../modify-item-overview.component.ts | 8 +- ...tract-simple-item-action.component.spec.ts | 17 +-- .../abstract-simple-item-action.component.ts | 13 +- .../virtual-metadata.component.spec.ts | 11 +- .../virtual-metadata.component.ts | 17 ++- .../collections/collections.component.spec.ts | 14 +- .../collections/collections.component.ts | 15 +- .../metadata-uri-values.component.spec.ts | 21 ++- .../metadata-uri-values.component.ts | 12 +- .../metadata-values.component.spec.ts | 21 ++- .../metadata-values.component.ts | 13 +- .../full-file-section.component.spec.ts | 22 ++- .../full-file-section.component.ts | 28 +++- .../themed-full-file-section.component.ts | 7 +- .../full/full-item-page.component.spec.ts | 21 ++- .../full/full-item-page.component.ts | 40 +++++- .../full/themed-full-item-page.component.ts | 7 +- src/app/item-page/item-page.module.ts | 43 +++--- src/app/item-page/item-shared.module.ts | 36 +++-- .../media-viewer-image.component.spec.ts | 11 +- .../media-viewer-image.component.ts | 9 +- .../themed-media-viewer-image.component.ts | 7 +- .../media-viewer-video.component.spec.ts | 20 ++- .../media-viewer-video.component.ts | 10 ++ .../themed-media-viewer-video.component.ts | 7 +- .../media-viewer.component.spec.ts | 25 ++-- .../media-viewer/media-viewer.component.ts | 18 +++ .../themed-media-viewer.component.ts | 7 +- .../mirador-viewer.component.spec.ts | 86 ++++++----- .../mirador-viewer.component.ts | 11 +- .../orcid-auth/orcid-auth.component.spec.ts | 24 ++-- .../orcid-auth/orcid-auth.component.ts | 14 +- .../orcid-page/orcid-page.component.html | 2 +- .../orcid-page/orcid-page.component.spec.ts | 25 ++-- .../orcid-page/orcid-page.component.ts | 26 +++- .../orcid-queue/orcid-queue.component.spec.ts | 24 ++-- .../orcid-queue/orcid-queue.component.ts | 18 ++- .../orcid-sync-settings.component.html | 8 +- .../orcid-sync-settings.component.spec.ts | 24 ++-- .../orcid-sync-settings.component.ts | 17 ++- .../abstract-incremental-list.component.ts | 5 +- .../file-section.component.spec.ts | 22 ++- .../file-section/file-section.component.ts | 26 +++- .../themed-file-section.component.ts | 1 + ...item-page-abstract-field.component.spec.ts | 22 +-- .../item-page-abstract-field.component.ts | 11 +- .../item-page-author-field.component.spec.ts | 21 ++- .../item-page-author-field.component.ts | 9 +- .../item-page-date-field.component.spec.ts | 21 ++- .../date/item-page-date-field.component.ts | 11 +- .../generic-item-page-field.component.spec.ts | 21 ++- .../generic-item-page-field.component.ts | 8 +- .../item-page-field.component.spec.ts | 22 +-- .../item-page-field.component.ts | 9 +- .../item-page-title-field.component.spec.ts | 17 ++- .../title/item-page-title-field.component.ts | 8 +- .../title/themed-item-page-field.component.ts | 7 +- .../uri/item-page-uri-field.component.spec.ts | 21 ++- .../uri/item-page-uri-field.component.ts | 9 +- .../simple/item-page.component.spec.ts | 22 ++- .../item-page/simple/item-page.component.ts | 29 +++- .../publication/publication.component.spec.ts | 23 ++- .../publication/publication.component.ts | 55 ++++++- .../item-types/shared/item.component.spec.ts | 135 +++++++++--------- .../item-types/shared/item.component.ts | 5 +- .../untyped-item.component.spec.ts | 22 +-- .../untyped-item/untyped-item.component.ts | 53 ++++++- ...data-representation-list.component.spec.ts | 11 +- .../metadata-representation-list.component.ts | 12 +- ...-metadata-representation-list.component.ts | 7 +- .../related-entities-search.component.spec.ts | 7 +- .../related-entities-search.component.ts | 7 +- ...-related-entities-search.component.spec.ts | 19 ++- ...abbed-related-entities-search.component.ts | 11 +- .../related-items/related-items-component.ts | 15 +- .../related-items.component.spec.ts | 26 ++-- .../simple/themed-item-page.component.ts | 7 +- .../version-page.component.spec.ts | 14 +- .../version-page/version-page.component.ts | 7 +- ...em-versions-delete-modal.component.spec.ts | 9 +- .../item-versions-delete-modal.component.ts | 9 +- ...m-versions-summary-modal.component.spec.ts | 9 +- .../item-versions-summary-modal.component.ts | 12 +- .../versions/item-versions.component.spec.ts | 33 +++-- .../versions/item-versions.component.ts | 18 ++- .../versions/item-versions.module.ts | 16 +-- .../item-versions-notice.component.spec.ts | 11 +- .../notice/item-versions-notice.component.ts | 9 +- .../login-page/login-page.component.spec.ts | 16 +-- src/app/login-page/login-page.component.ts | 10 +- src/app/login-page/login-page.module.ts | 16 +-- .../login-page/themed-login-page.component.ts | 7 +- .../logout-page/logout-page.component.spec.ts | 12 +- src/app/logout-page/logout-page.component.ts | 10 +- src/app/logout-page/logout-page.module.ts | 16 +-- .../themed-logout-page.component.ts | 7 +- src/app/lookup-by-id/lookup-by-id.module.ts | 22 ++- .../objectnotfound.component.spec.ts | 32 ++--- .../objectnotfound.component.ts | 13 +- .../themed-objectnotfound.component.ts | 7 +- src/app/menu.resolver.spec.ts | 17 ++- .../collection-selector.component.spec.ts | 32 ++--- .../collection-selector.component.ts | 11 +- ...ce-new-external-dropdown.component.spec.ts | 66 +++++---- ...-dspace-new-external-dropdown.component.ts | 16 ++- ...-new-submission-dropdown.component.spec.ts | 66 +++++---- ...space-new-submission-dropdown.component.ts | 17 ++- ...my-dspace-new-submission.component.spec.ts | 31 ++-- .../my-dspace-new-submission.component.ts | 16 ++- .../my-dspace-page.component.spec.ts | 11 +- .../my-dspace-page.component.ts | 14 +- .../my-dspace-page/my-dspace-page.module.ts | 28 ++-- .../my-dspace-page/my-dspace-search.module.ts | 20 ++- .../themed-my-dspace-page.component.ts | 7 +- ...xpandable-navbar-section.component.spec.ts | 35 +++-- .../expandable-navbar-section.component.ts | 13 +- ...med-expandable-navbar-section.component.ts | 9 +- .../navbar-section.component.spec.ts | 14 +- .../navbar-section.component.ts | 11 +- src/app/navbar/navbar.component.spec.ts | 15 +- src/app/navbar/navbar.component.ts | 14 +- src/app/navbar/navbar.module.ts | 36 +++-- src/app/navbar/themed-navbar.component.ts | 7 +- .../page-error/page-error.component.spec.ts | 22 +-- src/app/page-error/page-error.component.ts | 11 +- .../page-error/themed-page-error.component.ts | 7 +- .../page-internal-server-error.component.ts | 11 +- ...ed-page-internal-server-error.component.ts | 7 +- .../pagenotfound/pagenotfound.component.ts | 12 +- .../themed-pagenotfound.component.ts | 7 +- .../process-detail-field.component.spec.ts | 10 +- .../process-detail-field.component.ts | 7 +- .../detail/process-detail.component.spec.ts | 15 +- .../detail/process-detail.component.ts | 17 ++- .../form/process-form.component.spec.ts | 23 +-- .../form/process-form.component.ts | 18 ++- .../parameter-select.component.spec.ts | 7 +- .../parameter-select.component.ts | 22 +-- .../boolean-value-input.component.spec.ts | 4 +- .../boolean-value-input.component.ts | 13 +- .../date-value-input.component.spec.ts | 17 +-- .../date-value-input.component.ts | 18 ++- .../file-value-input.component.spec.ts | 20 +-- .../file-value-input.component.ts | 20 ++- .../parameter-value-input.component.spec.ts | 19 ++- .../parameter-value-input.component.ts | 19 ++- .../string-value-input.component.spec.ts | 20 +-- .../string-value-input.component.ts | 18 ++- .../process-parameters.component.spec.ts | 19 +-- .../process-parameters.component.ts | 21 +-- .../script-help/script-help.component.spec.ts | 19 +-- .../form/script-help/script-help.component.ts | 10 +- .../scripts-select.component.spec.ts | 23 +-- .../scripts-select.component.ts | 18 ++- .../new/new-process.component.spec.ts | 23 +-- .../process-page/new/new-process.component.ts | 11 +- .../process-overview.component.spec.ts | 11 +- .../overview/process-overview.component.ts | 11 +- .../process-page-shared.module.ts | 44 +++--- ...profile-claim-item-modal.component.spec.ts | 11 +- .../profile-claim-item-modal.component.ts | 14 +- ...ofile-page-metadata-form.component.spec.ts | 11 +- .../profile-page-metadata-form.component.ts | 9 +- ...ile-page-researcher-form.component.spec.ts | 11 +- .../profile-page-researcher-form.component.ts | 13 +- ...ofile-page-security-form.component.spec.ts | 15 +- .../profile-page-security-form.component.ts | 12 +- .../profile-page.component.spec.ts | 16 +-- .../profile-page/profile-page.component.ts | 21 ++- src/app/profile-page/profile-page.module.ts | 42 +++--- .../themed-profile-page.component.ts | 7 +- .../register-email-form.component.spec.ts | 25 ++-- .../register-email-form.component.ts | 13 +- .../register-email-form.module.ts | 20 ++- .../create-profile.component.spec.ts | 25 ++-- .../create-profile.component.ts | 25 +++- .../themed-create-profile.component.ts | 7 +- .../register-email.component.spec.ts | 7 +- .../register-email.component.ts | 11 +- .../themed-register-email.component.ts | 7 +- src/app/register-page/register-page.module.ts | 26 ++-- .../deny-request-copy.component.spec.ts | 11 +- .../deny-request-copy.component.ts | 14 +- .../themed-deny-request-copy.component.ts | 7 +- .../email-request-copy.component.spec.ts | 11 +- .../email-request-copy.component.ts | 12 +- .../themed-email-request-copy.component.ts | 7 +- .../grant-deny-request-copy.component.spec.ts | 11 +- .../grant-deny-request-copy.component.ts | 14 +- .../grant-request-copy.component.spec.ts | 11 +- .../grant-request-copy.component.ts | 15 +- .../themed-grant-request-copy.component.ts | 7 +- src/app/request-copy/request-copy.module.ts | 34 +++-- src/app/root.module.ts | 24 ++-- src/app/root/root.component.spec.ts | 22 +-- src/app/root/root.component.ts | 20 ++- src/app/root/themed-root.component.ts | 7 +- .../search-navbar.component.spec.ts | 25 ++-- .../search-navbar/search-navbar.component.ts | 15 +- .../themed-search-navbar.component.ts | 7 +- .../configuration-search-page.component.ts | 32 +++-- src/app/search-page/search-page.component.ts | 19 +-- src/app/search-page/search-page.module.ts | 34 ++--- ...med-configuration-search-page.component.ts | 7 +- .../themed-search-page.component.ts | 7 +- ...ccess-control-array-form.component.spec.ts | 5 +- .../access-control-array-form.component.ts | 16 ++- .../access-control-array-form/to-date.pipe.ts | 7 +- ...s-control-form-container.component.spec.ts | 33 +++-- ...access-control-form-container.component.ts | 15 +- .../access-control-form.module.ts | 26 ++-- ...-select-bitstreams-modal.component.spec.ts | 4 +- ...ntrol-select-bitstreams-modal.component.ts | 12 +- src/app/shared/alert/alert.component.spec.ts | 23 +-- src/app/shared/alert/alert.component.ts | 24 ++-- .../auth-nav-menu.component.spec.ts | 74 +++++----- .../auth-nav-menu/auth-nav-menu.component.ts | 17 ++- .../themed-auth-nav-menu.component.ts | 7 +- .../user-menu/user-menu.component.spec.ts | 36 +++-- .../user-menu/user-menu.component.ts | 13 +- .../browse-by/browse-by.component.spec.ts | 26 ++-- .../shared/browse-by/browse-by.component.ts | 24 ++-- .../browse-by/shared-browse-by.module.ts | 26 ++-- .../collection-dropdown.component.spec.ts | 24 ++-- .../collection-dropdown.component.ts | 14 +- .../themed-collection-dropdown.component.ts | 7 +- .../comcol-form/comcol-form.component.spec.ts | 11 +- .../comcol-form/comcol-form.component.ts | 19 ++- .../create-comcol-page.component.ts | 5 +- .../delete-comcol-page.component.ts | 5 +- .../comcol-metadata.component.ts | 5 +- .../comcol-role/comcol-role.component.html | 3 +- .../comcol-role/comcol-role.component.ts | 19 ++- .../edit-comcol-page.component.ts | 5 +- .../comcol-page-browse-by.component.ts | 16 ++- .../themed-comcol-page-browse-by.component.ts | 7 +- .../comcol-page-content.component.ts | 7 +- .../comcol-page-handle.component.spec.ts | 5 +- .../comcol-page-handle.component.ts | 6 +- .../themed-comcol-page-handle.component.ts | 7 +- .../comcol-page-header.component.ts | 7 +- .../comcol-page-logo.component.ts | 7 +- src/app/shared/comcol/comcol.module.ts | 24 ++-- .../confirmation-modal.component.spec.ts | 11 +- .../confirmation-modal.component.ts | 8 +- .../context-help-wrapper.component.spec.ts | 15 +- .../context-help-wrapper.component.ts | 11 +- src/app/shared/context-help.directive.spec.ts | 13 +- src/app/shared/context-help.directive.ts | 3 +- .../ds-select/ds-select.component.spec.ts | 10 +- .../shared/ds-select/ds-select.component.ts | 11 +- .../dso-page/dso-edit-menu.resolver.spec.ts | 31 ++-- ...-menu-expandable-section.component.spec.ts | 22 +-- ...-edit-menu-expandable-section.component.ts | 13 +- .../dso-edit-menu-section.component.spec.ts | 22 +-- .../dso-edit-menu-section.component.ts | 14 +- .../dso-edit-menu.component.spec.ts | 21 ++- .../dso-edit-menu/dso-edit-menu.component.ts | 9 +- ...page-subscription-button.component.spec.ts | 22 +-- .../dso-page-subscription-button.component.ts | 12 +- src/app/shared/dso-page/dso-page.module.ts | 26 ++-- ...ized-collection-selector.component.spec.ts | 11 +- ...uthorized-collection-selector.component.ts | 16 ++- .../dso-selector.component.spec.ts | 11 +- .../dso-selector/dso-selector.component.ts | 17 ++- ...llection-parent-selector.component.spec.ts | 33 +++-- ...te-collection-parent-selector.component.ts | 9 +- ...te-collection-parent-selector.component.ts | 3 +- ...ommunity-parent-selector.component.spec.ts | 33 +++-- ...ate-community-parent-selector.component.ts | 10 +- ...ate-community-parent-selector.component.ts | 3 +- ...ate-item-parent-selector.component.spec.ts | 33 +++-- .../create-item-parent-selector.component.ts | 13 +- ...d-create-item-parent-selector.component.ts | 3 +- ...o-selector-modal-wrapper.component.spec.ts | 38 ++--- ...edit-collection-selector.component.spec.ts | 33 +++-- .../edit-collection-selector.component.ts | 9 +- ...emed-edit-collection-selector.component.ts | 3 +- .../edit-community-selector.component.spec.ts | 33 +++-- .../edit-community-selector.component.ts | 9 +- ...hemed-edit-community-selector.component.ts | 3 +- .../edit-item-selector.component.spec.ts | 33 +++-- .../edit-item-selector.component.ts | 9 +- .../themed-edit-item-selector.component.ts | 3 +- .../export-batch-selector.component.spec.ts | 37 +++-- .../export-batch-selector.component.ts | 10 +- ...export-metadata-selector.component.spec.ts | 37 +++-- .../export-metadata-selector.component.ts | 10 +- .../import-batch-selector.component.spec.ts | 11 +- .../import-batch-selector.component.ts | 9 +- .../entity-dropdown.component.spec.ts | 16 ++- .../entity-dropdown.component.ts | 12 +- .../eperson-group-list.component.spec.ts | 23 ++- .../eperson-group-list.component.ts | 19 ++- .../eperson-search-box.component.spec.ts | 25 ++-- .../eperson-search-box.component.ts | 9 +- .../group-search-box.component.spec.ts | 25 ++-- .../group-search-box.component.ts | 9 +- src/app/shared/error/error.component.spec.ts | 18 +-- src/app/shared/error/error.component.ts | 9 +- .../file-download-link.component.spec.ts | 11 +- .../file-download-link.component.ts | 10 +- .../themed-file-download-link.component.ts | 7 +- ...ynamic-form-control-container.component.ts | 31 +++- .../ds-dynamic-form.component.ts | 10 +- ...ng-metadata-list-element.component.spec.ts | 24 ++-- ...xisting-metadata-list-element.component.ts | 16 ++- ...ng-relation-list-element.component.spec.ts | 10 +- ...xisting-relation-list-element.component.ts | 14 +- .../dynamic-form-array.component.ts | 21 ++- .../custom-switch.component.spec.ts | 11 +- .../custom-switch/custom-switch.component.ts | 8 +- ...namic-date-picker-inline.component.spec.ts | 12 +- .../dynamic-date-picker-inline.component.ts | 14 +- .../date-picker/date-picker.component.spec.ts | 24 ++-- .../date-picker/date-picker.component.ts | 11 +- .../dynamic-disabled.component.spec.ts | 11 +- .../disabled/dynamic-disabled.component.ts | 7 +- .../dynamic-form-group.component.ts | 15 +- .../list/dynamic-list.component.spec.ts | 28 ++-- .../models/list/dynamic-list.component.ts | 14 +- .../lookup/dynamic-lookup.component.spec.ts | 27 ++-- .../models/lookup/dynamic-lookup.component.ts | 25 +++- .../onebox/dynamic-onebox.component.spec.ts | 27 ++-- .../models/onebox/dynamic-onebox.component.ts | 28 +++- .../dynamic-relation-group.component.spec.ts | 26 ++-- .../dynamic-relation-group.components.ts | 30 +++- ...amic-scrollable-dropdown.component.spec.ts | 29 ++-- .../dynamic-scrollable-dropdown.component.ts | 16 ++- .../models/tag/dynamic-tag.component.spec.ts | 26 ++-- .../models/tag/dynamic-tag.component.ts | 15 +- ...ic-lookup-relation-modal.component.spec.ts | 29 ++-- ...dynamic-lookup-relation-modal.component.ts | 28 +++- ...tion-external-source-tab.component.spec.ts | 17 ++- ...-relation-external-source-tab.component.ts | 22 ++- ...ource-entry-import-modal.component.spec.ts | 11 +- ...nal-source-entry-import-modal.component.ts | 13 +- ...nal-source-entry-import-modal.component.ts | 7 +- ...-relation-external-source-tab.component.ts | 7 +- ...okup-relation-search-tab.component.spec.ts | 20 ++- ...ic-lookup-relation-search-tab.component.ts | 16 ++- ...ic-lookup-relation-search-tab.component.ts | 7 +- ...p-relation-selection-tab.component.spec.ts | 21 ++- ...lookup-relation-selection-tab.component.ts | 14 +- .../shared/form/chips/chips.component.spec.ts | 22 +-- src/app/shared/form/chips/chips.component.ts | 18 ++- .../authority-confidence-state.directive.ts | 3 +- src/app/shared/form/form.component.html | 2 +- src/app/shared/form/form.component.spec.ts | 28 ++-- src/app/shared/form/form.component.ts | 24 +++- src/app/shared/form/form.module.ts | 64 ++++----- .../number-picker.component.spec.ts | 26 ++-- .../number-picker/number-picker.component.ts | 8 +- ...ocabulary-treeview-modal.component.spec.ts | 9 +- .../vocabulary-treeview-modal.component.ts | 9 +- .../vocabulary-treeview.component.spec.ts | 22 +-- .../vocabulary-treeview.component.ts | 22 ++- .../google-recaptcha.component.spec.ts | 10 +- .../google-recaptcha.component.ts | 9 +- src/app/shared/hover-class.directive.spec.ts | 7 +- src/app/shared/hover-class.directive.ts | 3 +- .../idle-modal/idle-modal.component.spec.ts | 11 +- .../shared/idle-modal/idle-modal.component.ts | 7 +- .../impersonate-navbar.component.spec.ts | 14 +- .../impersonate-navbar.component.ts | 9 +- .../dso-input-suggestions.component.spec.ts | 9 +- .../dso-input-suggestions.component.ts | 32 +++-- ...filter-input-suggestions.component.spec.ts | 9 +- .../filter-input-suggestions.component.ts | 32 +++-- .../input-suggestions.component.spec.ts | 9 +- .../input-suggestions.component.ts | 11 +- .../validation-suggestions.component.spec.ts | 11 +- .../validation-suggestions.component.ts | 31 ++-- .../lang-switch/lang-switch.component.spec.ts | 38 +++-- .../lang-switch/lang-switch.component.ts | 12 +- .../shared/loading/loading.component.spec.ts | 18 +-- src/app/shared/loading/loading.component.ts | 9 +- .../loading/themed-loading.component.ts | 7 +- .../log-in-container.component.spec.ts | 25 ++-- .../container/log-in-container.component.ts | 9 +- .../shared/log-in/log-in.component.spec.ts | 35 ++--- src/app/shared/log-in/log-in.component.ts | 13 +- ...log-in-external-provider.component.spec.ts | 18 ++- .../log-in-external-provider.component.ts | 9 +- .../log-in-password.component.spec.ts | 22 ++- .../password/log-in-password.component.ts | 16 ++- .../shared/log-out/log-out.component.spec.ts | 30 ++-- src/app/shared/log-out/log-out.component.ts | 13 +- .../external-link-menu-item.component.spec.ts | 11 +- .../external-link-menu-item.component.ts | 8 +- .../link-menu-item.component.spec.ts | 12 +- .../menu-item/link-menu-item.component.ts | 10 +- .../onclick-menu-item.component.spec.ts | 11 +- .../menu-item/onclick-menu-item.component.ts | 10 +- .../text-menu-item.component.spec.ts | 11 +- .../menu-item/text-menu-item.component.ts | 7 +- .../menu-section.component.spec.ts | 11 +- .../menu-section/menu-section.component.ts | 5 +- src/app/shared/menu/menu.component.spec.ts | 11 +- src/app/shared/menu/menu.component.ts | 5 +- src/app/shared/menu/menu.module.ts | 26 ++-- .../metadata-field-wrapper.component.spec.ts | 19 +-- .../metadata-field-wrapper.component.ts | 9 +- ...ta-representation-loader.component.spec.ts | 19 ++- ...etadata-representation-loader.component.ts | 6 +- .../metadata-representation.directive.ts | 3 +- ...med-task-actions-approve.component.spec.ts | 22 +-- .../claimed-task-actions-approve.component.ts | 12 +- .../claimed-task-actions.component.spec.ts | 24 ++-- .../claimed-task-actions.component.ts | 16 ++- ...ask-actions-decline-task.component.spec.ts | 24 ++-- ...med-task-actions-decline-task.component.ts | 12 +- ...sk-actions-edit-metadata.component.spec.ts | 22 +-- ...ed-task-actions-edit-metadata.component.ts | 14 +- ...aimed-task-action-rating.component.spec.ts | 16 +-- ...ed-claimed-task-action-rating.component.ts | 11 +- ...imed-task-actions-reject.component.spec.ts | 22 +-- .../claimed-task-actions-reject.component.ts | 15 +- ...k-actions-return-to-pool.component.spec.ts | 22 +-- ...d-task-actions-return-to-pool.component.ts | 12 +- ...k-action-select-reviewer.component.spec.ts | 18 ++- ...d-task-action-select-reviewer.component.ts | 11 +- ...imed-task-actions-loader.component.spec.ts | 11 +- .../claimed-task-actions-loader.component.ts | 6 +- .../claimed-task-actions.directive.ts | 3 +- .../item/item-actions.component.spec.ts | 24 ++-- .../item/item-actions.component.ts | 13 +- .../mydspace-actions.module.ts | 24 ++-- .../mydspace-reloadable-actions.spec.ts | 22 +-- .../pool-task-actions.component.spec.ts | 22 +-- .../pool-task/pool-task-actions.component.ts | 14 +- .../workflowitem-actions.component.spec.ts | 24 ++-- .../workflowitem-actions.component.ts | 13 +- .../workspaceitem-actions.component.spec.ts | 28 ++-- .../workspaceitem-actions.component.ts | 15 +- .../shared/ng-for-track-by-id.directive.ts | 5 +- .../notification.component.spec.ts | 21 +-- .../notification/notification.component.ts | 35 ++--- .../notifications-board.component.spec.ts | 22 +-- .../notifications-board.component.ts | 14 +- .../notifications.reducers.spec.ts | 12 +- .../notifications.service.spec.ts | 22 +-- .../object-collection.component.spec.ts | 10 +- .../object-collection.component.ts | 13 +- .../access-status-badge.component.spec.ts | 13 +- .../access-status-badge.component.ts | 8 +- .../themed-access-status-badge.component.ts | 7 +- .../shared/badges/badges.component.spec.ts | 8 +- .../shared/badges/badges.component.ts | 13 +- .../my-dspace-status-badge.component.spec.ts | 20 +-- .../my-dspace-status-badge.component.ts | 9 +- ...themed-my-dspace-status-badge.component.ts | 7 +- .../status-badge.component.spec.ts | 7 +- .../status-badge/status-badge.component.ts | 8 +- .../themed-status-badge.component.ts | 7 +- .../shared/badges/themed-badges.component.ts | 7 +- .../type-badge/themed-type-badge.component.ts | 7 +- .../type-badge/type-badge.component.spec.ts | 7 +- .../badges/type-badge/type-badge.component.ts | 8 +- .../importable-list-item-control.component.ts | 7 +- ...-object-component-loader.component.spec.ts | 11 +- ...table-object-component-loader.component.ts | 8 +- .../listable-object.directive.ts | 3 +- .../item-collection.component.ts | 11 +- .../item-submitter.component.spec.ts | 24 ++-- .../item-submitter.component.ts | 10 +- .../abstract-listable-element.component.ts | 5 +- ...ctable-list-item-control.component.spec.ts | 15 +- .../selectable-list-item-control.component.ts | 11 +- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 11 +- ...tem-detail-preview-field.component.spec.ts | 24 ++-- .../item-detail-preview-field.component.ts | 9 +- .../item-detail-preview.component.spec.ts | 22 +-- .../item-detail-preview.component.ts | 20 ++- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 10 +- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 11 +- .../search-result-detail-element.component.ts | 5 +- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 10 +- ...ch-result-detail-element.component.spec.ts | 11 +- ...-search-result-detail-element.component.ts | 10 +- .../object-detail.component.spec.ts | 20 +-- .../object-detail/object-detail.component.ts | 20 ++- .../collection-grid-element.component.spec.ts | 17 ++- .../collection-grid-element.component.ts | 12 +- .../community-grid-element.component.spec.ts | 17 ++- .../community-grid-element.component.ts | 12 +- .../item/item-grid-element.component.spec.ts | 11 +- .../item/item-grid-element.component.ts | 11 +- .../object-grid/object-grid.component.ts | 21 ++- ...arch-result-grid-element.component.spec.ts | 17 ++- ...on-search-result-grid-element.component.ts | 13 +- ...arch-result-grid-element.component.spec.ts | 17 ++- ...ty-search-result-grid-element.component.ts | 19 ++- ...arch-result-grid-element.component.spec.ts | 42 +++--- ...em-search-result-grid-element.component.ts | 17 ++- .../search-result-grid-element.component.ts | 5 +- .../bitstream-list-item.component.spec.ts | 7 +- .../bitstream-list-item.component.ts | 7 +- ...rowse-entry-list-element.component.spec.ts | 15 +- .../browse-entry-list-element.component.ts | 11 +- .../bundle-list-element.component.ts | 5 +- .../collection-list-element.component.spec.ts | 11 +- .../collection-list-element.component.ts | 10 +- .../community-list-element.component.spec.ts | 11 +- .../community-list-element.component.ts | 10 +- .../identifier-data.component.html | 8 +- .../identifier-data.component.ts | 10 +- .../item/item-list-element.component.spec.ts | 10 +- .../item/item-list-element.component.ts | 9 +- ...able-notification-object.component.spec.ts | 10 +- .../listable-notification-object.component.ts | 9 +- ...nk-metadata-list-element.component.spec.ts | 7 +- ...se-link-metadata-list-element.component.ts | 8 +- ...em-metadata-list-element.component.spec.ts | 7 +- .../item-metadata-list-element.component.ts | 7 +- ...a-representation-list-element.component.ts | 5 +- ...resentation-list-element.component.spec.ts | 7 +- ...a-representation-list-element.component.ts | 5 +- ...xt-metadata-list-element.component.spec.ts | 7 +- ...in-text-metadata-list-element.component.ts | 8 +- ...arch-result-list-element.component.spec.ts | 14 +- ...ed-search-result-list-element.component.ts | 12 +- ...arch-result-list-element.component.spec.ts | 14 +- ...ed-search-result-list-element.component.ts | 12 +- ...arch-result-list-element.component.spec.ts | 14 +- ...sk-search-result-list-element.component.ts | 12 +- ...arch-result-list-element.component.spec.ts | 11 +- ...ed-search-result-list-element.component.ts | 11 +- .../item-list-preview.component.spec.ts | 56 ++++---- .../item-list-preview.component.ts | 18 ++- .../themed-item-list-preview.component.ts | 7 +- ...-list-element-submission.component.spec.ts | 11 +- ...esult-list-element-submission.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 11 +- ...ol-search-result-list-element.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 11 +- ...em-search-result-list-element.component.ts | 12 +- ...arch-result-list-element.component.spec.ts | 11 +- ...em-search-result-list-element.component.ts | 12 +- .../object-list/object-list.component.html | 2 +- .../object-list/object-list.component.spec.ts | 9 +- .../object-list/object-list.component.ts | 20 ++- ...arch-result-list-element.component.spec.ts | 10 +- ...on-search-result-list-element.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 11 +- ...ty-search-result-list-element.component.ts | 11 +- ...arch-result-list-element.component.spec.ts | 26 ++-- ...em-search-result-list-element.component.ts | 14 +- .../search-result-list-element.component.ts | 5 +- ...n-sidebar-search-list-element.component.ts | 9 +- ...y-sidebar-search-list-element.component.ts | 9 +- ...n-sidebar-search-list-element.component.ts | 9 +- ...ebar-search-list-element.component.spec.ts | 19 ++- .../sidebar-search-list-element.component.ts | 9 +- .../themed-object-list.component.ts | 7 +- .../collection-select.component.spec.ts | 11 +- .../collection-select.component.ts | 16 ++- .../item-select/item-select.component.spec.ts | 11 +- .../item-select/item-select.component.ts | 14 +- .../page-size-selector.component.spec.ts | 19 ++- .../page-size-selector.component.ts | 11 +- .../pagination/pagination.component.spec.ts | 33 +++-- .../shared/pagination/pagination.component.ts | 19 ++- .../resource-policy-create.component.spec.ts | 23 ++- .../resource-policy-create.component.ts | 11 +- .../resource-policy-edit.component.spec.ts | 23 ++- .../edit/resource-policy-edit.component.ts | 11 +- .../resource-policy-entry.component.spec.ts | 19 +-- .../entry/resource-policy-entry.component.ts | 10 ++ .../resource-policy-form.component.spec.ts | 28 ++-- .../form/resource-policy-form.component.ts | 15 +- .../resource-policies.component.spec.ts | 24 ++-- .../resource-policies.component.ts | 13 +- .../resource-policies.module.ts | 30 ++-- .../results-back-button.component.spec.ts | 16 +-- .../results-back-button.component.ts | 11 +- .../results-back-button.module.ts | 20 ++- .../themed-results-back-button.component.ts | 7 +- src/app/shared/roles/role.directive.ts | 3 +- src/app/shared/rss-feed/rss.component.spec.ts | 20 +-- src/app/shared/rss-feed/rss.component.ts | 16 ++- .../scope-selector-modal.component.spec.ts | 33 +++-- .../scope-selector-modal.component.ts | 10 +- .../search-form/search-form.component.spec.ts | 13 +- .../search-form/search-form.component.ts | 14 +- .../themed-search-form.component.ts | 7 +- .../search-export-csv.component.spec.ts | 17 ++- .../search-export-csv.component.ts | 12 +- .../search-authority-filter.component.ts | 16 ++- .../search-boolean-filter.component.ts | 14 +- .../search-facet-option.component.spec.ts | 39 +++-- .../search-facet-option.component.ts | 13 +- ...earch-facet-range-option.component.spec.ts | 37 +++-- .../search-facet-range-option.component.ts | 14 +- ...ch-facet-selected-option.component.spec.ts | 37 +++-- .../search-facet-selected-option.component.ts | 11 +- .../search-facet-filter-wrapper.component.ts | 7 +- .../search-facet-filter.component.spec.ts | 31 ++-- .../search-facet-filter.component.ts | 5 +- .../search-filter.component.spec.ts | 19 ++- .../search-filter/search-filter.component.ts | 14 +- .../search-hierarchy-filter.component.spec.ts | 18 ++- .../search-hierarchy-filter.component.ts | 16 ++- .../search-range-filter.component.spec.ts | 31 ++-- .../search-range-filter.component.ts | 18 ++- .../search-text-filter.component.ts | 16 ++- .../search-filters.component.spec.ts | 12 +- .../search-filters.component.ts | 14 +- .../themed-search-filters.component.ts | 7 +- .../search-label.component.spec.ts | 11 +- .../search-label/search-label.component.ts | 10 +- .../search-labels.component.spec.ts | 11 +- .../search-labels/search-labels.component.ts | 11 +- .../search-results.component.spec.ts | 10 +- .../search-results.component.ts | 21 ++- .../themed-search-results.component.ts | 7 +- .../search-settings.component.spec.ts | 34 +++-- .../search-settings.component.ts | 13 +- .../themed-search-settings.component.ts | 7 +- .../search-sidebar.component.spec.ts | 7 +- .../search-sidebar.component.ts | 14 +- .../themed-search-sidebar.component.ts | 7 +- ...rch-switch-configuration.component.spec.ts | 24 ++-- .../search-switch-configuration.component.ts | 11 +- .../shared/search/search.component.spec.ts | 64 ++++----- src/app/shared/search/search.component.ts | 20 ++- src/app/shared/search/search.module.ts | 28 ++-- .../shared/search/themed-search.component.ts | 7 +- src/app/shared/shared.module.ts | 40 +++--- .../page-with-sidebar.component.spec.ts | 22 ++- .../sidebar/page-with-sidebar.component.ts | 11 +- .../sidebar/sidebar-dropdown.component.ts | 9 +- .../date/starts-with-date.component.spec.ts | 11 +- .../date/starts-with-date.component.ts | 11 +- .../text/starts-with-text.component.spec.ts | 11 +- .../text/starts-with-text.component.ts | 10 +- .../subscription-modal.component.spec.ts | 24 ++-- .../subscription-modal.component.ts | 15 +- .../subscription-view.component.spec.ts | 22 +-- .../subscription-view.component.ts | 14 +- .../subscriptions/subscriptions.module.ts | 26 ++-- src/app/shared/testing/test-module.ts | 3 +- .../theme-support/themed.component.spec.ts | 16 +-- .../abstract-trackable.component.spec.ts | 11 +- .../trackable/abstract-trackable.component.ts | 5 +- .../truncatable-part.component.spec.ts | 44 +++--- .../truncatable-part.component.ts | 11 +- .../truncatable/truncatable.component.spec.ts | 11 +- .../truncatable/truncatable.component.ts | 8 +- .../file-dropzone-no-uploader.component.ts | 16 ++- src/app/shared/upload/upload.module.ts | 28 ++-- .../uploader/uploader.component.spec.ts | 24 ++-- .../upload/uploader/uploader.component.ts | 20 ++- src/app/shared/utils/auto-focus.directive.ts | 3 +- src/app/shared/utils/browser-only.pipe.ts | 3 +- src/app/shared/utils/capitalize.pipe.ts | 3 +- .../shared/utils/click-outside.directive.ts | 3 +- src/app/shared/utils/console.pipe.ts | 3 +- src/app/shared/utils/debounce.directive.ts | 3 +- src/app/shared/utils/drag-click.directive.ts | 3 +- src/app/shared/utils/emphasize.pipe.ts | 5 +- src/app/shared/utils/enum-keys-pipe.ts | 5 +- src/app/shared/utils/file-size-pipe.ts | 5 +- .../utils/file-value-accessor.directive.ts | 7 +- .../utils/in-list-validator.directive.ts | 11 +- src/app/shared/utils/markdown.pipe.ts | 3 +- .../metadatafield-validator.directive.ts | 11 +- src/app/shared/utils/object-keys-pipe.ts | 5 +- src/app/shared/utils/object-ngfor.pipe.ts | 3 +- src/app/shared/utils/object-values-pipe.ts | 5 +- .../shared/utils/require-file.validator.ts | 5 +- src/app/shared/utils/safe-url-pipe.ts | 5 +- src/app/shared/utils/short-number.pipe.ts | 3 +- src/app/shared/utils/truncate.pipe.ts | 3 +- src/app/shared/utils/var.directive.ts | 3 +- .../view-mode-switch.component.spec.ts | 33 ++--- .../view-mode-switch.component.ts | 13 +- ...llection-statistics-page.component.spec.ts | 14 +- .../collection-statistics-page.component.ts | 37 ++--- ...ed-collection-statistics-page.component.ts | 7 +- ...ommunity-statistics-page.component.spec.ts | 14 +- .../community-statistics-page.component.ts | 33 ++--- ...med-community-statistics-page.component.ts | 7 +- .../item-statistics-page.component.spec.ts | 14 +- .../item-statistics-page.component.ts | 37 ++--- .../themed-item-statistics-page.component.ts | 7 +- .../site-statistics-page.component.spec.ts | 14 +- .../site-statistics-page.component.ts | 36 ++--- .../themed-site-statistics-page.component.ts | 7 +- .../statistics-page/statistics-page.module.ts | 22 +-- ...ponent.ts => statistics-page.directive.ts} | 22 ++- .../statistics-table.component.spec.ts | 14 +- .../statistics-table.component.ts | 11 +- .../dspace/view-tracker.component.ts | 7 +- src/app/statistics/statistics.module.ts | 20 ++- .../edit/submission-edit.component.spec.ts | 19 ++- .../edit/submission-edit.component.ts | 7 +- .../edit/themed-submission-edit.component.ts | 7 +- ...bmission-form-collection.component.spec.ts | 24 ++-- .../submission-form-collection.component.ts | 24 +++- .../submission-form-footer.component.spec.ts | 26 ++-- .../submission-form-footer.component.ts | 11 +- ...mission-form-section-add.component.spec.ts | 22 +-- .../submission-form-section-add.component.ts | 9 +- .../form/submission-form.component.html | 4 +- .../form/submission-form.component.spec.ts | 20 ++- .../form/submission-form.component.ts | 17 +++ .../submission-upload-files.component.spec.ts | 22 +-- .../submission-upload-files.component.ts | 7 + ...port-external-collection.component.spec.ts | 21 ++- ...on-import-external-collection.component.ts | 16 ++- ...-import-external-preview.component.spec.ts | 21 ++- ...ssion-import-external-preview.component.ts | 7 +- ...mport-external-searchbar.component.spec.ts | 21 ++- ...ion-import-external-searchbar.component.ts | 15 +- ...bmission-import-external.component.spec.ts | 21 ++- .../submission-import-external.component.ts | 27 +++- ...ed-submission-import-external.component.ts | 7 +- .../section-accesses.component.spec.ts | 80 +++++------ .../accesses/section-accesses.component.ts | 8 +- ...sion-section-cc-licenses.component.spec.ts | 14 +- ...ubmission-section-cc-licenses.component.ts | 17 ++- .../section-container.component.spec.ts | 26 ++-- .../container/section-container.component.ts | 18 ++- .../form/section-form.component.spec.ts | 29 ++-- .../sections/form/section-form.component.ts | 8 ++ .../section-identifiers.component.spec.ts | 26 ++-- .../section-identifiers.component.ts | 14 +- .../license/section-license.component.spec.ts | 25 ++-- .../license/section-license.component.ts | 7 + .../submission/sections/sections.directive.ts | 5 +- .../content-accordion.component.spec.ts | 18 +-- .../content-accordion.component.ts | 13 +- .../metadata-information.component.spec.ts | 16 +-- .../metadata-information.component.ts | 10 +- .../publication-information.component.spec.ts | 16 +-- .../publication-information.component.ts | 10 +- .../publisher-policy.component.spec.ts | 16 +-- .../publisher-policy.component.ts | 13 +- .../section-sherpa-policies.component.spec.ts | 40 +++--- .../section-sherpa-policies.component.ts | 23 ++- ...tion-upload-access-conditions.component.ts | 5 +- ...section-upload-file-edit.component.spec.ts | 25 ++-- .../section-upload-file-edit.component.ts | 8 ++ .../section-upload-file.component.spec.ts | 24 ++-- .../file/section-upload-file.component.ts | 16 +++ .../themed-section-upload-file.component.ts | 3 +- ...section-upload-file-view.component.spec.ts | 21 ++- .../section-upload-file-view.component.ts | 14 ++ .../upload/section-upload.component.html | 2 +- .../upload/section-upload.component.spec.ts | 23 +-- .../upload/section-upload.component.ts | 17 +++ src/app/submission/submission.module.ts | 54 +++---- .../submission-submit.component.spec.ts | 18 +-- .../submit/submission-submit.component.ts | 7 +- .../themed-submission-submit.component.ts | 7 +- .../subscriptions-page.component.spec.ts | 24 ++-- .../subscriptions-page.component.ts | 15 +- .../subscriptions-page.module.ts | 12 +- ...system-wide-alert-banner.component.spec.ts | 13 +- .../system-wide-alert-banner.component.ts | 11 +- .../system-wide-alert-form.component.spec.ts | 17 ++- .../system-wide-alert-form.component.ts | 16 ++- .../system-wide-alert.module.ts | 34 +++-- .../thumbnail/themed-thumbnail.component.ts | 7 +- src/app/thumbnail/thumbnail.component.spec.ts | 13 +- src/app/thumbnail/thumbnail.component.ts | 7 + ...ced-workflow-action-page.component.spec.ts | 28 ++-- ...advanced-workflow-action-page.component.ts | 11 +- ...d-workflow-action-rating.component.spec.ts | 40 +++--- ...vanced-workflow-action-rating.component.ts | 20 ++- ...w-action-select-reviewer.component.spec.ts | 42 +++--- ...rkflow-action-select-reviewer.component.ts | 17 ++- .../reviewers-list.component.spec.ts | 22 ++- .../reviewers-list.component.ts | 25 +++- ...advanced-workflow-action.component.spec.ts | 42 +++--- .../advanced-workflow-action.component.ts | 4 +- ...-workflow-actions-loader.component.spec.ts | 12 +- ...anced-workflow-actions-loader.component.ts | 7 +- .../advanced-workflow-actions.directive.ts | 3 +- ...orkflow-item-action-page.component.spec.ts | 43 +++--- .../workflow-item-action-page.component.ts | 9 +- .../themed-workflow-item-delete.component.ts | 7 +- .../workflow-item-delete.component.spec.ts | 21 ++- .../workflow-item-delete.component.ts | 16 ++- ...hemed-workflow-item-send-back.component.ts | 7 +- .../workflow-item-send-back.component.spec.ts | 21 ++- .../workflow-item-send-back.component.ts | 16 ++- .../workflowitems-edit-page-routing.module.ts | 90 ------------ .../workflowitems-edit-page.module.ts | 44 +++--- .../workflowitems-edit-page.routes.ts | 82 +++++++++++ ...ed-workspaceitems-delete-page.component.ts | 17 ++- .../workspaceitems-delete-page.component.html | 2 +- ...rkspaceitems-delete-page.component.spec.ts | 37 +++-- .../workspaceitems-delete-page.component.ts | 15 +- .../workspaceitems-edit-page.module.ts | 18 ++- .../admin-sidebar/admin-sidebar.component.ts | 7 +- .../edit-bitstream-page.component.ts | 28 +++- .../app/breadcrumbs/breadcrumbs.component.ts | 17 ++- .../browse-by-date-page.component.ts | 40 +++++- .../browse-by-metadata-page.component.ts | 40 +++++- .../browse-by-switcher.component.ts | 9 +- .../browse-by-taxonomy-page.component.ts | 15 +- .../browse-by-title-page.component.ts | 40 +++++- .../collection-page.component.ts | 46 +++++- .../edit-item-template-page.component.ts | 20 +++ .../community-list-page.component.ts | 12 +- .../community-list.component.ts | 17 ++- .../community-page.component.ts | 52 ++++++- ...nity-page-sub-collection-list.component.ts | 18 ++- ...unity-page-sub-community-list.component.ts | 23 ++- .../dso-edit-metadata.component.ts | 25 +++- .../journal-issue/journal-issue.component.ts | 20 +++ .../journal-volume.component.ts | 20 +++ .../item-pages/journal/journal.component.ts | 23 +++ .../custom/app/footer/footer.component.ts | 7 +- .../app/forbidden/forbidden.component.ts | 6 +- .../forgot-email.component.ts | 11 +- .../forgot-password-form.component.ts | 18 ++- .../header-navbar-wrapper.component.ts | 9 +- .../custom/app/header/header.component.ts | 10 ++ .../home-news/home-news.component.ts | 11 +- .../app/home-page/home-page.component.ts | 13 +- .../top-level-community-list.component.ts | 14 +- .../end-user-agreement.component.ts | 13 +- .../feedback-form/feedback-form.component.ts | 6 + .../app/info/feedback/feedback.component.ts | 7 +- .../app/info/privacy/privacy.component.ts | 5 +- .../item-page/alerts/item-alerts.component.ts | 11 ++ .../item-status/item-status.component.ts | 22 ++- .../full-file-section.component.ts | 25 ++++ .../full/full-item-page.component.ts | 42 +++++- .../media-viewer-image.component.ts | 7 + .../media-viewer-video.component.ts | 10 ++ .../media-viewer/media-viewer.component.ts | 22 +++ .../file-section/file-section.component.ts | 33 ++++- .../title/item-page-title-field.component.ts | 4 + .../item-page/simple/item-page.component.ts | 30 +++- .../publication/publication.component.ts | 69 ++++++++- .../untyped-item/untyped-item.component.ts | 59 ++++++++ .../metadata-representation-list.component.ts | 18 ++- .../app/login-page/login-page.component.ts | 6 +- .../app/logout-page/logout-page.component.ts | 8 +- .../objectnotfound.component.ts | 10 +- .../my-dspace-page.component.ts | 21 ++- .../expandable-navbar-section.component.ts | 13 +- .../custom/app/navbar/navbar.component.ts | 8 +- .../pagenotfound/pagenotfound.component.ts | 6 +- .../profile-page/profile-page.component.ts | 25 +++- .../create-profile.component.ts | 21 ++- .../register-email.component.ts | 11 +- .../deny-request-copy.component.ts | 21 ++- .../email-request-copy.component.ts | 17 ++- .../grant-request-copy.component.ts | 26 ++-- src/themes/custom/app/root/root.component.ts | 17 +++ .../search-navbar/search-navbar.component.ts | 8 +- .../configuration-search-page.component.ts | 20 ++- .../app/search-page/search-page.component.ts | 6 +- .../auth-nav-menu/auth-nav-menu.component.ts | 11 +- .../collection-dropdown.component.ts | 8 ++ .../comcol-page-browse-by.component.ts | 19 ++- .../comcol-page-handle.component.ts | 10 +- ...te-collection-parent-selector.component.ts | 7 +- ...ate-community-parent-selector.component.ts | 6 +- .../create-item-parent-selector.component.ts | 19 ++- .../edit-collection-selector.component.ts | 7 +- .../edit-community-selector.component.ts | 7 +- .../edit-item-selector.component.ts | 7 +- .../file-download-link.component.ts | 4 + ...-relation-external-source-tab.component.ts | 36 ++++- ...nal-source-entry-import-modal.component.ts | 21 ++- ...ic-lookup-relation-search-tab.component.ts | 24 +++- .../app/shared/loading/loading.component.ts | 12 +- .../access-status-badge.component.ts | 8 +- .../shared/badges/badges.component.ts | 25 +++- .../my-dspace-status-badge.component.ts | 7 +- .../status-badge/status-badge.component.ts | 8 +- .../badges/type-badge/type-badge.component.ts | 8 +- .../collection-list-element.component.ts | 14 +- .../community-list-element.component.ts | 16 ++- .../object-list/object-list.component.ts | 21 ++- ...em-search-result-list-element.component.ts | 13 ++ ...n-sidebar-search-list-element.component.ts | 11 +- .../results-back-button.component.ts | 5 +- .../search-form/search-form.component.ts | 11 +- .../search-filters.component.ts | 11 +- .../search-results.component.ts | 17 ++- .../search-settings.component.ts | 12 +- .../search-sidebar.component.ts | 18 ++- .../date/starts-with-date.component.ts | 5 + .../text/starts-with-text.component.ts | 14 +- .../collection-statistics-page.component.ts | 15 +- .../community-statistics-page.component.ts | 15 +- .../item-statistics-page.component.ts | 15 +- .../site-statistics-page.component.ts | 15 +- .../edit/submission-edit.component.ts | 7 +- .../submission-import-external.component.ts | 28 +++- .../file/section-upload-file.component.ts | 22 ++- .../submit/submission-submit.component.ts | 11 +- .../app/thumbnail/thumbnail.component.ts | 7 + .../workflow-item-delete.component.ts | 14 +- .../workflow-item-send-back.component.ts | 14 +- .../workspace-items-delete.component.ts | 15 +- src/themes/custom/eager-theme.module.ts | 30 ++-- src/themes/custom/lazy-theme.module.ts | 124 ++++++++-------- .../header-navbar-wrapper.component.ts | 9 +- .../dspace/app/header/header.component.ts | 17 ++- .../home-news/home-news.component.ts | 7 +- .../dspace/app/navbar/navbar.component.ts | 20 ++- src/themes/dspace/eager-theme.module.ts | 24 ++-- 1311 files changed, 13140 insertions(+), 8009 deletions(-) rename src/app/statistics-page/statistics-page/{statistics-page.component.ts => statistics-page.directive.ts} (85%) delete mode 100644 src/app/workflowitems-edit-page/workflowitems-edit-page-routing.module.ts create mode 100644 src/app/workflowitems-edit-page/workflowitems-edit-page.routes.ts diff --git a/.eslintrc.json b/.eslintrc.json index af1b97849b6..985126bbc29 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -139,7 +139,6 @@ } ], "@angular-eslint/no-attribute-decorator": "error", - "@angular-eslint/no-forward-ref": "error", "@angular-eslint/no-output-native": "warn", "@angular-eslint/no-output-on-prefix": "warn", "@angular-eslint/no-conflicting-lifecycle": "warn", diff --git a/src/app/access-control/access-control.module.ts b/src/app/access-control/access-control.module.ts index 3dc4b6cedc7..46257267655 100644 --- a/src/app/access-control/access-control.module.ts +++ b/src/app/access-control/access-control.module.ts @@ -28,36 +28,34 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher = }; @NgModule({ - imports: [ - CommonModule, - SharedModule, - RouterModule, - AccessControlRoutingModule, - FormModule, - NgbAccordionModule, - SearchModule, - AccessControlFormModule, - ], - exports: [ - MembersListComponent, - ], - declarations: [ - EPeopleRegistryComponent, - EPersonFormComponent, - GroupsRegistryComponent, - GroupFormComponent, - SubgroupsListComponent, - MembersListComponent, - BulkAccessComponent, - BulkAccessBrowseComponent, - BulkAccessSettingsComponent, - ], - providers: [ - { - provide: DYNAMIC_ERROR_MESSAGES_MATCHER, - useValue: ValidateEmailErrorStateMatcher - }, - ] + imports: [ + CommonModule, + SharedModule, + RouterModule, + AccessControlRoutingModule, + FormModule, + NgbAccordionModule, + SearchModule, + AccessControlFormModule, + EPeopleRegistryComponent, + EPersonFormComponent, + GroupsRegistryComponent, + GroupFormComponent, + SubgroupsListComponent, + MembersListComponent, + BulkAccessComponent, + BulkAccessBrowseComponent, + BulkAccessSettingsComponent + ], + exports: [ + MembersListComponent, + ], + providers: [ + { + provide: DYNAMIC_ERROR_MESSAGES_MATCHER, + useValue: ValidateEmailErrorStateMatcher + }, + ] }) /** * This module handles all components related to the access control pages 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 87b2a8d5684..a42c98cb614 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 @@ -28,17 +28,17 @@ describe('BulkAccessBrowseComponent', () => { const selectableListService = jasmine.createSpyObj('SelectableListService', ['getSelectableList', 'deselectAll']); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, NgbNavModule, - TranslateModule.forRoot() - ], - declarations: [BulkAccessBrowseComponent], - providers: [ { provide: SelectableListService, useValue: selectableListService }, ], - schemas: [ + TranslateModule.forRoot(), + BulkAccessBrowseComponent + ], + providers: [{ provide: SelectableListService, useValue: selectableListService },], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { 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 e806e729c8e..8b8e3626cf7 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 @@ -14,6 +14,19 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut import { PageInfo } from '../../../core/shared/page-info.model'; import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model'; 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'; @Component({ selector: 'ds-bulk-access-browse', @@ -24,7 +37,22 @@ import { hasValue } from '../../../shared/empty.util'; provide: SEARCH_CONFIG_SERVICE, useClass: SearchConfigurationService } - ] + ], + imports: [ + PaginationComponent, + AsyncPipe, + NgbAccordionModule, + TranslateModule, + NgIf, + NgbNavModule, + ThemedSearchComponent, + BrowserOnlyPipe, + NgForOf, + NgxPaginationModule, + SelectableListItemControlComponent, + ListableObjectComponentLoaderComponent + ], + 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 e9b253147dc..562c7427ecb 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 @@ -69,18 +69,18 @@ describe('BulkAccessComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule, - TranslateModule.forRoot() - ], - declarations: [ BulkAccessComponent ], - providers: [ + TranslateModule.forRoot(), + BulkAccessComponent + ], + providers: [ { provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock }, { provide: NotificationsService, useValue: NotificationsServiceStub }, { provide: SelectableListService, useValue: selectableListServiceMock } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 04724614cb6..85fde3b208b 100644 --- a/src/app/access-control/bulk-access/bulk-access.component.ts +++ b/src/app/access-control/bulk-access/bulk-access.component.ts @@ -7,11 +7,19 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com 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'; @Component({ selector: 'ds-bulk-access', templateUrl: './bulk-access.component.html', - styleUrls: ['./bulk-access.component.scss'] + styleUrls: ['./bulk-access.component.scss'], + imports: [ + TranslateModule, + BulkAccessSettingsComponent, + BulkAccessBrowseComponent + ], + 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 14e0fdefb21..6917e861d6b 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 @@ -41,10 +41,9 @@ describe('BulkAccessSettingsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NgbAccordionModule, TranslateModule.forRoot()], - declarations: [BulkAccessSettingsComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); }); beforeEach(() => { 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 eecc0162451..a19adecb349 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 @@ -2,12 +2,22 @@ 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'; @Component({ selector: 'ds-bulk-access-settings', templateUrl: 'bulk-access-settings.component.html', styleUrls: ['./bulk-access-settings.component.scss'], - exportAs: 'dsBulkSettings' + exportAs: 'dsBulkSettings', + imports: [ + NgbAccordionModule, + TranslateModule, + NgIf, + AccessControlFormContainerComponent + ], + 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 4a09913862f..db4d350286c 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 @@ -123,16 +123,14 @@ describe('EPeopleRegistryComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - declarations: [EPeopleRegistryComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), EPeopleRegistryComponent], + providers: [ { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: AuthorizationDataService, useValue: authorizationService }, @@ -140,9 +138,9 @@ describe('EPeopleRegistryComponent', () => { { provide: Router, useValue: new RouterStub() }, { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, { provide: PaginationService, useValue: paginationService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 fb045ebb883..db7fc969632 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.ts +++ b/src/app/access-control/epeople-registry/epeople-registry.component.ts @@ -1,7 +1,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; +import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model'; @@ -22,10 +22,26 @@ 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 { PaginationComponent } from '../../shared/pagination/pagination.component'; @Component({ selector: 'ds-epeople-registry', templateUrl: './epeople-registry.component.html', + imports: [ + TranslateModule, + AsyncPipe, + NgIf, + EPersonFormComponent, + ReactiveFormsModule, + ThemedLoadingComponent, + PaginationComponent, + NgClass, + NgForOf + ], + 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 fb911e709c4..89643e2c19d 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 @@ -183,16 +183,14 @@ describe('EPersonFormComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - declarations: [EPersonFormComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), EPersonFormComponent], + providers: [ { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataService }, { provide: FormBuilderService, useValue: builderService }, @@ -200,12 +198,12 @@ describe('EPersonFormComponent', () => { { provide: AuthService, useValue: authService }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: PaginationService, useValue: paginationService }, - { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])}, + { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) }, { provide: EpersonRegistrationService, useValue: epersonRegistrationService }, EPeopleRegistryComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', { 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 d009d560589..23dd42257a5 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 @@ -6,7 +6,7 @@ import { DynamicFormLayout, DynamicInputModel } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; import { debounceTime, finalize, map, switchMap, take } from 'rxjs/operators'; import { PaginatedList } from '../../../core/data/paginated-list.model'; @@ -38,10 +38,26 @@ 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 { RouterLink } from '@angular/router'; @Component({ selector: 'ds-eperson-form', templateUrl: './eperson-form.component.html', + imports: [ + FormComponent, + NgIf, + AsyncPipe, + TranslateModule, + NgClass, + ThemedLoadingComponent, + PaginationComponent, + RouterLink + ], + 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 f8c5f3cd870..3c90b20ab38 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 @@ -191,16 +191,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 - } - }), - ], - declarations: [GroupFormComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), GroupFormComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, @@ -215,14 +213,14 @@ describe('GroupFormComponent', () => { { provide: RemoteDataBuildService, useValue: {} }, { provide: HALEndpointService, useValue: {} }, { - provide: ActivatedRoute, - useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) } + provide: ActivatedRoute, + useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) } }, { provide: Router, useValue: router }, { provide: AuthorizationDataService, useValue: authorizationService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 693e283b4a0..e75f4744362 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 @@ -8,7 +8,7 @@ import { DynamicInputModel, DynamicTextAreaModel } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ObservedValueOf, combineLatest as observableCombineLatest, @@ -48,10 +48,27 @@ import { Operation } from 'fast-json-patch'; import { ValidateGroupExists } from './validators/group-exists.validator'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { environment } from '../../../../environments/environment'; +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 { MembersListComponent } from './members-list/members-list.component'; +import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component'; @Component({ selector: 'ds-group-form', - templateUrl: './group-form.component.html' + templateUrl: './group-form.component.html', + imports: [ + FormComponent, + AlertComponent, + NgIf, + AsyncPipe, + TranslateModule, + ContextHelpDirective, + MembersListComponent, + SubgroupsListComponent + ], + 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 7c8db399bcd..06abf0c3f36 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 @@ -121,16 +121,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 - } - }), - ], - declarations: [MembersListComponent], - providers: [MembersListComponent, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), MembersListComponent], + providers: [MembersListComponent, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -138,9 +136,9 @@ describe('MembersListComponent', () => { { provide: Router, useValue: new RouterMock() }, { provide: PaginationService, useValue: paginationService }, { provide: DSONameService, useValue: new DSONameServiceMock() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 b3e686c0123..d02e77bc3fc 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,7 +1,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Observable, of as observableOf, @@ -28,6 +28,9 @@ import { PaginationComponentOptions } from '../../../../shared/pagination/pagina import { EpersonDtoModel } from '../../../../core/eperson/models/eperson-dto.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { ContextHelpDirective } from '../../../../shared/context-help.directive'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; +import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; /** * Keys to keep track of specific subscriptions @@ -69,7 +72,19 @@ export interface EPersonListActionConfig { @Component({ selector: 'ds-members-list', - templateUrl: './members-list.component.html' + templateUrl: './members-list.component.html', + imports: [ + TranslateModule, + ContextHelpDirective, + ReactiveFormsModule, + PaginationComponent, + NgIf, + AsyncPipe, + RouterLink, + NgClass, + NgForOf + ], + 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 ac5750dcaca..013aff47519 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 @@ -100,25 +100,23 @@ describe('SubgroupsListComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, + imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - declarations: [SubgroupsListComponent], - providers: [SubgroupsListComponent, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), SubgroupsListComponent], + providers: [SubgroupsListComponent, { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: GroupDataService, useValue: groupsDataServiceStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: FormBuilderService, useValue: builderService }, { provide: Router, useValue: routerStub }, { provide: PaginationService, useValue: paginationService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0cff730c628..f66fb1942ae 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,7 +1,7 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Observable, of as observableOf, Subscription } from 'rxjs'; import { map, mergeMap, switchMap, take } from 'rxjs/operators'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; @@ -19,6 +19,9 @@ import { NoContent } from '../../../../core/shared/NoContent.model'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { followLink } from '../../../../shared/utils/follow-link-config.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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 @@ -31,7 +34,18 @@ enum SubKey { @Component({ selector: 'ds-subgroups-list', - templateUrl: './subgroups-list.component.html' + templateUrl: './subgroups-list.component.html', + imports: [ + RouterLink, + AsyncPipe, + NgForOf, + ContextHelpDirective, + TranslateModule, + ReactiveFormsModule, + PaginationComponent, + NgIf + ], + 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 635ba727c26..df8208f247c 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 @@ -163,16 +163,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 - } - }), - ], - declarations: [GroupsRegistryComponent], - providers: [GroupsRegistryComponent, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), GroupsRegistryComponent], + providers: [GroupsRegistryComponent, { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataServiceStub }, @@ -183,9 +181,9 @@ describe('GroupsRegistryComponent', () => { { provide: AuthorizationDataService, useValue: authorizationService }, { provide: PaginationService, useValue: paginationService }, { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 ccfd155e393..d06c69fa64c 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,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -38,10 +38,27 @@ import { NoContent } from '../../core/shared/NoContent.model'; import { PaginationService } from '../../core/pagination/pagination.service'; import { followLink } from '../../shared/utils/follow-link-config.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { AsyncPipe, 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', templateUrl: './groups-registry.component.html', + imports: [ + ThemedLoadingComponent, + TranslateModule, + RouterLink, + ReactiveFormsModule, + AsyncPipe, + NgIf, + PaginationComponent, + NgSwitch, + NgSwitchCase, + NgbTooltipModule + ], + 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 358bd0d01e7..bbbfa106ab8 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 @@ -9,10 +9,9 @@ describe('AdminCurationTasksComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [AdminCurationTasksComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), AdminCurationTasksComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).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 9a80f341b91..aec23b7641d 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,4 +1,6 @@ import { Component } from '@angular/core'; +import { CurationFormComponent } from "../../curation-form/curation-form.component"; +import { TranslateModule } from "@ngx-translate/core"; /** * Component responsible for rendering the system wide Curation Task UI @@ -6,6 +8,11 @@ import { Component } from '@angular/core'; @Component({ selector: 'ds-admin-curation-task', templateUrl: './admin-curation-tasks.component.html', + imports: [ + CurationFormComponent, + TranslateModule + ], + 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 341aefb7044..8fbb02bbbe7 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 @@ -45,20 +45,20 @@ describe('BatchImportPageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [BatchImportPageComponent, FileValueAccessorDirective, FileValidator], - providers: [ + RouterTestingModule.withRoutes([]), + 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 673e1f23f54..664fdb20e25 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { Location } from '@angular/common'; -import { TranslateService } from '@ngx-translate/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'; @@ -17,10 +17,23 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { take } from 'rxjs/operators'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.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"; @Component({ selector: 'ds-batch-import-page', - templateUrl: './batch-import-page.component.html' + templateUrl: './batch-import-page.component.html', + imports: [ + NgIf, + TranslateModule, + FormsModule, + UiSwitchModule, + FileDropzoneNoUploaderComponent + ], + 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 814757ec713..f2b8b777955 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 @@ -42,20 +42,20 @@ describe('MetadataImportPageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [MetadataImportPageComponent, FileValueAccessorDirective, FileValidator], - providers: [ + RouterTestingModule.withRoutes([]), + 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 4236d152dcb..dd40326ac3d 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,7 @@ import { Location } from '@angular/common'; import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { METADATA_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service'; import { ProcessParameter } from '../../process-page/processes/process-parameter.model'; import { isNotEmpty } from '../../shared/empty.util'; @@ -10,10 +10,20 @@ import { RemoteData } from '../../core/data/remote-data'; import { Process } from '../../process-page/processes/process.model'; 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'; @Component({ selector: 'ds-metadata-import-page', - templateUrl: './metadata-import-page.component.html' + templateUrl: './metadata-import-page.component.html', + imports: [ + TranslateModule, + FormsModule, + FileDropzoneNoUploaderComponent + ], + standalone: true }) /** diff --git a/src/app/admin/admin-registries/admin-registries.module.ts b/src/app/admin/admin-registries/admin-registries.module.ts index 65f7b614197..b438838aa73 100644 --- a/src/app/admin/admin-registries/admin-registries.module.ts +++ b/src/app/admin/admin-registries/admin-registries.module.ts @@ -11,20 +11,18 @@ import { BitstreamFormatsModule } from './bitstream-formats/bitstream-formats.mo import { FormModule } from '../../shared/form/form.module'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - RouterModule, - BitstreamFormatsModule, - AdminRegistriesRoutingModule, - FormModule - ], - declarations: [ - MetadataRegistryComponent, - MetadataSchemaComponent, - MetadataSchemaFormComponent, - MetadataFieldFormComponent - ] + imports: [ + CommonModule, + SharedModule, + RouterModule, + BitstreamFormatsModule, + AdminRegistriesRoutingModule, + FormModule, + MetadataRegistryComponent, + MetadataSchemaComponent, + MetadataSchemaFormComponent, + MetadataFieldFormComponent + ] }) export class AdminRegistriesModule { 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 6787350d865..2771455decc 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 @@ -42,15 +42,14 @@ describe('AddBitstreamFormatComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [AddBitstreamFormatComponent], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, AddBitstreamFormatComponent], + providers: [ { provide: Router, useValue: router }, { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); }; const initBeforeEach = () => { @@ -82,15 +81,14 @@ describe('AddBitstreamFormatComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [AddBitstreamFormatComponent], - providers: [ - { provide: Router, useValue: router }, - { provide: NotificationsService, useValue: notificationService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, AddBitstreamFormatComponent], + providers: [ + { provide: Router, useValue: router }, + { provide: NotificationsService, useValue: notificationService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).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 132343dcf06..15638486504 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 @@ -3,10 +3,11 @@ 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 { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; import { RemoteData } from '../../../../core/data/remote-data'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; +import { FormatFormComponent } from '../format-form/format-form.component'; /** * This component renders the page to create a new bitstream format. @@ -14,6 +15,11 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; @Component({ selector: 'ds-add-bitstream-format', templateUrl: './add-bitstream-format.component.html', + imports: [ + FormatFormComponent, + TranslateModule + ], + standalone: true }) export class AddBitstreamFormatComponent { 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 8a44240b7e2..3290a029026 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 @@ -102,15 +102,14 @@ describe('BitstreamFormatsComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], + providers: [ { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: NotificationsService, useValue: notificationsServiceStub }, { provide: PaginationService, useValue: paginationService } - ] - }).compileComponents(); + ] +}).compileComponents(); }; const initBeforeEach = () => { @@ -230,15 +229,14 @@ describe('BitstreamFormatsComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], - providers: [ - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], + providers: [ + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService } + ] +}).compileComponents(); } )); @@ -279,15 +277,14 @@ describe('BitstreamFormatsComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], - providers: [ - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, - { provide: NotificationsService, useValue: notificationsServiceStub }, - { provide: PaginationService, useValue: paginationService } - ] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe], + providers: [ + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, + { provide: NotificationsService, useValue: notificationsServiceStub }, + { provide: PaginationService, useValue: paginationService } + ] +}).compileComponents(); } )); 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 162bf2bdb28..1727834be4d 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 @@ -7,19 +7,30 @@ 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 } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +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 { FindListOptions } from '../../../core/data/find-list-options.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { AsyncPipe, NgForOf, NgIf } from "@angular/common"; +import { PaginationComponent } from "../../../shared/pagination/pagination.component"; /** * This component renders a list of bitstream formats */ @Component({ selector: 'ds-bitstream-formats', - templateUrl: './bitstream-formats.component.html' + templateUrl: './bitstream-formats.component.html', + imports: [ + NgIf, + AsyncPipe, + RouterLink, + TranslateModule, + PaginationComponent, + NgForOf + ], + standalone: true }) export class BitstreamFormatsComponent implements OnInit, OnDestroy { diff --git a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts index afbe35a1f6b..fe4d453578a 100644 --- a/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts +++ b/src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts @@ -10,19 +10,17 @@ import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstrea import { FormModule } from '../../../shared/form/form.module'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - RouterModule, - BitstreamFormatsRoutingModule, - FormModule - ], - declarations: [ - BitstreamFormatsComponent, - EditBitstreamFormatComponent, - AddBitstreamFormatComponent, - FormatFormComponent - ] + imports: [ + CommonModule, + SharedModule, + RouterModule, + BitstreamFormatsRoutingModule, + FormModule, + BitstreamFormatsComponent, + EditBitstreamFormatComponent, + AddBitstreamFormatComponent, + FormatFormComponent + ] }) export class BitstreamFormatsModule { 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 b09c50c70ad..bd60c6f19c3 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 @@ -52,16 +52,15 @@ describe('EditBitstreamFormatComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [EditBitstreamFormatComponent], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, EditBitstreamFormatComponent], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: router }, { provide: NotificationsService, useValue: notificationService }, { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); }; const initBeforeEach = () => { @@ -103,16 +102,15 @@ describe('EditBitstreamFormatComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [EditBitstreamFormatComponent], - providers: [ - { provide: ActivatedRoute, useValue: routeStub }, - { provide: Router, useValue: router }, - { provide: NotificationsService, useValue: notificationService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, EditBitstreamFormatComponent], + providers: [ + { provide: ActivatedRoute, useValue: routeStub }, + { provide: Router, useValue: router }, + { provide: NotificationsService, useValue: notificationService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatDataService }, + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).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/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 14b109fe268..cfd7550c7b6 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 @@ -6,9 +6,11 @@ import { RemoteData } from '../../../../core/data/remote-data'; 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 { TranslateService } from '@ngx-translate/core'; +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. @@ -17,6 +19,12 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; @Component({ selector: 'ds-edit-bitstream-format', templateUrl: './edit-bitstream-format.component.html', + imports: [ + FormatFormComponent, + TranslateModule, + AsyncPipe + ], + standalone: true }) export class EditBitstreamFormatComponent implements OnInit { diff --git a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts index ca3fbcbc99a..cd5f338f813 100644 --- a/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts +++ b/src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts @@ -40,13 +40,12 @@ describe('FormatFormComponent', () => { const initAsync = () => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), ReactiveFormsModule, FormsModule, TranslateModule.forRoot(), NgbModule], - declarations: [FormatFormComponent], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), ReactiveFormsModule, FormsModule, TranslateModule.forRoot(), NgbModule, FormatFormComponent], + providers: [ { provide: Router, useValue: router }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); }; const initBeforeEach = () => { 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 142f6fb83d5..168ab6ebcde 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 @@ -16,13 +16,20 @@ import { hasValue, isEmpty } from '../../../../shared/empty.util'; import { TranslateService } from '@ngx-translate/core'; import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths'; import { environment } from '../../../../../environments/environment'; +import { FormComponent } from '../../../../shared/form/form.component'; +import { NgIf } from '@angular/common'; /** * The component responsible for rendering the form to create/edit a bitstream format */ @Component({ selector: 'ds-bitstream-format-form', - templateUrl: './format-form.component.html' + templateUrl: './format-form.component.html', + imports: [ + FormComponent, + NgIf + ], + 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 944288a7a51..70356e0a91f 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 @@ -69,16 +69,15 @@ describe('MetadataRegistryComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [MetadataRegistryComponent, PaginationComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataRegistryComponent, PaginationComponent, EnumKeysPipe], + providers: [ { provide: RegistryService, useValue: registryServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MetadataRegistryComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MetadataRegistryComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); 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 857034604e9..ae3c1f9ffa4 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 @@ -7,18 +7,32 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio import { filter, map, switchMap, take } from 'rxjs/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { toFindListOptions } from '../../../shared/pagination/pagination.utils'; import { NoContent } from '../../../core/shared/NoContent.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component'; +import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'; +import { PaginationComponent } from '../../../shared/pagination/pagination.component'; @Component({ selector: 'ds-metadata-registry', templateUrl: './metadata-registry.component.html', - styleUrls: ['./metadata-registry.component.scss'] + styleUrls: ['./metadata-registry.component.scss'], + imports: [ + MetadataSchemaFormComponent, + TranslateModule, + AsyncPipe, + PaginationComponent, + NgIf, + NgForOf, + NgClass, + RouterLink + ], + 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 b758767ddbe..3e999296d31 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 @@ -38,14 +38,13 @@ describe('MetadataSchemaFormComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [MetadataSchemaFormComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataSchemaFormComponent, EnumKeysPipe], + providers: [ { provide: RegistryService, useValue: registryServiceStub }, { provide: FormBuilderService, useValue: formBuilderServiceStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 24bf4306619..19b2cb5734f 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 @@ -9,13 +9,22 @@ import { UntypedFormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { switchMap, take, tap } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Observable, combineLatest } from 'rxjs'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { FormComponent } from '../../../../shared/form/form.component'; @Component({ selector: 'ds-metadata-schema-form', - templateUrl: './metadata-schema-form.component.html' + templateUrl: './metadata-schema-form.component.html', + imports: [ + NgIf, + AsyncPipe, + TranslateModule, + FormComponent + ], + 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 ad7b54945dd..9607490cc00 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 @@ -49,14 +49,13 @@ describe('MetadataFieldFormComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [MetadataFieldFormComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe], + providers: [ { provide: RegistryService, useValue: registryServiceStub }, { provide: FormBuilderService, useValue: formBuilderServiceStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 773e0600fbf..7be58ff02f9 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 @@ -9,14 +9,23 @@ import { UntypedFormGroup } from '@angular/forms'; import { RegistryService } from '../../../../core/registry/registry.service'; import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service'; import { take } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { combineLatest } from 'rxjs'; import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model'; import { MetadataField } from '../../../../core/metadata/metadata-field.model'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { FormComponent } from '../../../../shared/form/form.component'; @Component({ selector: 'ds-metadata-field-form', - templateUrl: './metadata-field-form.component.html' + templateUrl: './metadata-field-form.component.html', + imports: [ + NgIf, + FormComponent, + TranslateModule, + AsyncPipe + ], + 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 2b660a63634..8fde011dda6 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 @@ -131,18 +131,17 @@ describe('MetadataSchemaComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [MetadataSchemaComponent, PaginationComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataSchemaComponent, PaginationComponent, EnumKeysPipe, VarDirective], + providers: [ { provide: RegistryService, useValue: registryServiceStub }, { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: Router, useValue: new RouterStub() }, { provide: PaginationService, useValue: paginationService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 d0827e6e4d5..6816b5c16d4 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,6 @@ import { Component, OnInit } from '@angular/core'; import { RegistryService } from '../../../core/registry/registry.service'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject, combineLatest as observableCombineLatest, @@ -15,18 +15,34 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio import { map, switchMap, take } from 'rxjs/operators'; import { hasValue } from '../../../shared/empty.util'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { MetadataField } from '../../../core/metadata/metadata-field.model'; import { MetadataSchema } from '../../../core/metadata/metadata-schema.model'; import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; import { toFindListOptions } from '../../../shared/pagination/pagination.utils'; import { NoContent } from '../../../core/shared/NoContent.model'; import { PaginationService } from '../../../core/pagination/pagination.service'; +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', templateUrl: './metadata-schema.component.html', - styleUrls: ['./metadata-schema.component.scss'] + styleUrls: ['./metadata-schema.component.scss'], + imports: [ + AsyncPipe, + VarDirective, + MetadataFieldFormComponent, + TranslateModule, + PaginationComponent, + NgIf, + NgForOf, + NgClass, + RouterLink + ], + standalone: true }) /** * A component used for managing all existing metadata fields within the current metadata schema. 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 7be486d7da4..9ca5c874b45 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 @@ -9,9 +9,9 @@ describe('AdminSearchPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [AdminSearchPageComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [AdminSearchPageComponent], + schemas: [NO_ERRORS_SCHEMA] +}) .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 c9c6b84245d..f2a4f9c427c 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 @@ -1,10 +1,13 @@ import { Component } from '@angular/core'; 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'] + 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 1ea27b36b69..2ea87c3e065 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 @@ -43,14 +43,14 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - SharedModule - ], - declarations: [CollectionAdminSearchResultGridElementComponent], - providers: [ + SharedModule, + CollectionAdminSearchResultGridElementComponent + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, @@ -58,8 +58,8 @@ describe('CollectionAdminSearchResultGridElementComponent', () => { { provide: FileService, useClass: FileServiceStub }, { 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 1412090e0fe..dae11f55d06 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 @@ -6,12 +6,16 @@ import { CollectionSearchResult } from '../../../../../shared/object-collection/ 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'; @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' + 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 996366e20a4..33de48884cf 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 @@ -45,14 +45,14 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), - SharedModule - ], - declarations: [CommunityAdminSearchResultGridElementComponent], - providers: [ + SharedModule, + CommunityAdminSearchResultGridElementComponent + ], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, { provide: BitstreamDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, @@ -60,9 +60,9 @@ describe('CommunityAdminSearchResultGridElementComponent', () => { { provide: FileService, useClass: FileServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 b0d603338b8..db1eb41414f 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 @@ -6,12 +6,16 @@ import { CommunitySearchResult } from '../../../../../shared/object-collection/s 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'; @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' + 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 ee3de421317..6ef58321196 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 @@ -58,24 +58,24 @@ describe('ItemAdminSearchResultGridElementComponent', () => { init(); TestBed.configureTestingModule( { - declarations: [ItemAdminSearchResultGridElementComponent], - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - SharedModule - ], - 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] - }) + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + SharedModule, + 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 dab6694f368..ab857023d06 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 @@ -14,12 +14,15 @@ import { GenericConstructor } from '../../../../../core/shared/generic-construct import { ListableObjectDirective } from '../../../../../shared/object-collection/shared/listable-object/listable-object.directive'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.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' + 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: [ListableObjectDirective, 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/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 8937847ff53..d33237bb7f7 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 @@ -32,16 +32,16 @@ describe('CollectionAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [CollectionAdminSearchResultListElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }, + RouterTestingModule.withRoutes([]), + CollectionAdminSearchResultListElementComponent + ], + providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] - }) + 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 8bcf20b2305..f04b2d346db 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 @@ -6,12 +6,17 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l 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'; +import { CollectionSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/collection-search-result/collection-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' + 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 110d77b1e56..eb4810e0373 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 @@ -32,16 +32,16 @@ describe('CommunityAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [CommunityAdminSearchResultListElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }, + RouterTestingModule.withRoutes([]), + CommunityAdminSearchResultListElementComponent + ], + providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] - }) + 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 9419ae3f3f1..9812b91a448 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 @@ -6,12 +6,17 @@ import { SearchResultListElementComponent } from '../../../../../shared/object-l 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'; +import { CommunitySearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/community-search-result/community-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' + 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 667e8edea9f..ff470dea153 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 @@ -29,16 +29,16 @@ describe('ItemAdminSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [ItemAdminSearchResultListElementComponent], - providers: [{ provide: TruncatableService, useValue: {} }, + RouterTestingModule.withRoutes([]), + ItemAdminSearchResultListElementComponent + ], + providers: [{ provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }], - schemas: [NO_ERRORS_SCHEMA] - }) + schemas: [NO_ERRORS_SCHEMA] +}) .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 b1dea113414..3c3fd182580 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 @@ -5,12 +5,16 @@ import { listableObjectComponent } from '../../../../../shared/object-collection import { Context } from '../../../../../core/shared/context.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; +import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component'; +import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.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' + 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 f354ac5f895..3a78620ea4a 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 @@ -32,13 +32,13 @@ describe('ItemAdminSearchResultActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [ItemAdminSearchResultActionsComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + RouterTestingModule.withRoutes([]), + 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 fcc3cf0f17b..4651f022607 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 @@ -10,11 +10,16 @@ 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'; @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' + 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-search-page/admin-search.module.ts b/src/app/admin/admin-search-page/admin-search.module.ts index 353d6dd4985..e88fc8b5b59 100644 --- a/src/app/admin/admin-search-page/admin-search.module.ts +++ b/src/app/admin/admin-search-page/admin-search.module.ts @@ -24,16 +24,14 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - SearchModule, - SharedModule.withEntryComponents(), - JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents() - ], - declarations: [ - AdminSearchPageComponent, - ...ENTRY_COMPONENTS - ] + imports: [ + SearchModule, + SharedModule.withEntryComponents(), + JournalEntitiesModule.withEntryComponents(), + ResearchEntitiesModule.withEntryComponents(), + AdminSearchPageComponent, + ...ENTRY_COMPONENTS + ] }) export class AdminSearchModule { /** 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 260a364d7a8..efea15bfaf1 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 @@ -21,14 +21,13 @@ describe('AdminSidebarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot()], - declarations: [AdminSidebarSectionComponent, TestComponent], - providers: [ - {provide: 'sectionDataProvider', useValue: {model: {link: 'google.com'}, icon: iconString}}, - {provide: MenuService, useValue: menuService}, - {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - ] - }).overrideComponent(AdminSidebarSectionComponent, { + 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, { set: { entryComponents: [TestComponent] } @@ -61,14 +60,13 @@ describe('AdminSidebarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot()], - declarations: [AdminSidebarSectionComponent, TestComponent], - providers: [ - {provide: 'sectionDataProvider', useValue: {model: {link: 'google.com', disabled: true}, icon: iconString}}, - {provide: MenuService, useValue: menuService}, - {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - ] - }).overrideComponent(AdminSidebarSectionComponent, { + 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, { set: { entryComponents: [TestComponent] } @@ -101,8 +99,10 @@ describe('AdminSidebarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 d6cd803622b..e56836d11ba 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 @@ -6,17 +6,20 @@ import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.mo import { MenuSection } from '../../../shared/menu/menu-section.model'; import { MenuID } from '../../../shared/menu/menu-id.model'; import { isEmpty } from '../../../shared/empty.util'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass } from '@angular/common'; /** * Represents a non-expandable section in the admin sidebar */ @Component({ - /* eslint-disable @angular-eslint/component-selector */ - selector: 'li[ds-admin-sidebar-section]', - templateUrl: './admin-sidebar-section.component.html', - styleUrls: ['./admin-sidebar-section.component.scss'], - + /* eslint-disable @angular-eslint/component-selector */ + selector: 'li[ds-admin-sidebar-section]', + templateUrl: './admin-sidebar-section.component.html', + styleUrls: ['./admin-sidebar-section.component.scss'], + standalone: true, + imports: [NgClass, RouterLink, TranslateModule] }) @rendersSectionForMenu(MenuID.ADMIN, false) 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 88efd2a711e..36fb094880a 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts @@ -57,9 +57,8 @@ describe('AdminSidebarComponent', () => { }); scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule], - declarations: [AdminSidebarComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, { provide: MenuService, useValue: menuService }, @@ -70,14 +69,14 @@ describe('AdminSidebarComponent', () => { { provide: ScriptDataService, useValue: scriptService }, { provide: ActivatedRoute, useValue: routeStub }, { - provide: NgbModal, useValue: { - open: () => {/*comment*/ + provide: NgbModal, useValue: { + open: () => { + } } - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(AdminSidebarComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 26ded965d4d..2c0caf619fd 100644 --- a/src/app/admin/admin-sidebar/admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/admin-sidebar.component.ts @@ -10,15 +10,20 @@ import { AuthorizationDataService } from '../../core/data/feature-authorization/ import { MenuID } from '../../shared/menu/menu-id.model'; import { ActivatedRoute } from '@angular/router'; 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] + 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 dd31f757c23..c995357cc72 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 @@ -20,15 +20,14 @@ describe('ExpandableAdminSidebarSectionComponent', () => { const iconString = 'test'; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TranslateModule.forRoot()], - declarations: [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] } @@ -71,8 +70,9 @@ describe('ExpandableAdminSidebarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 4555c0fa938..94679086b24 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 @@ -10,16 +10,20 @@ import { map } from 'rxjs/operators'; import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator'; import { MenuID } from '../../../shared/menu/menu-id.model'; import { Router } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe } from '@angular/common'; /** * Represents a expandable section in the sidebar */ @Component({ - /* eslint-disable @angular-eslint/component-selector */ - selector: 'li[ds-expandable-admin-sidebar-section]', - templateUrl: './expandable-admin-sidebar-section.component.html', - styleUrls: ['./expandable-admin-sidebar-section.component.scss'], - animations: [rotate, slide, bgColor] + /* eslint-disable @angular-eslint/component-selector */ + selector: 'li[ds-expandable-admin-sidebar-section]', + templateUrl: './expandable-admin-sidebar-section.component.html', + styleUrls: ['./expandable-admin-sidebar-section.component.scss'], + animations: [rotate, slide, bgColor], + standalone: true, + imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule] }) @rendersSectionForMenu(MenuID.ADMIN, true) 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 f2f35725e8a..917c2302a5b 100644 --- a/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts +++ b/src/app/admin/admin-sidebar/themed-admin-sidebar.component.ts @@ -6,9 +6,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', + selector: 'ds-themed-admin-sidebar', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) export class ThemedAdminSidebarComponent extends ThemedComponent { protected getComponentName(): string { 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 c80bc677f22..95d84ab8065 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 @@ -9,9 +9,9 @@ describe('AdminSearchPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [AdminWorkflowPageComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [AdminWorkflowPageComponent], + schemas: [NO_ERRORS_SCHEMA] +}) .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 c3ccc9555a2..085b5c2976c 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 @@ -1,10 +1,13 @@ import { Component } from '@angular/core'; 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'] + 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 04377fcc81a..92c2f4b1064 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 @@ -35,13 +35,13 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [WorkflowItemAdminWorkflowActionsComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + RouterTestingModule.withRoutes([]), + 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 480c48f25ef..b8753129182 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 @@ -5,11 +5,16 @@ 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' + 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 6e917ed0888..7acd388537e 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 @@ -31,15 +31,14 @@ describe('SupervisionOrderGroupSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [SupervisionOrderGroupSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), SupervisionOrderGroupSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, { provide: NotificationsService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 2eec0cfd0cc..fee610ff538 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,6 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators'; import { NotificationsService } from 'src/app/shared/notifications/notifications.service'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; @@ -8,6 +8,10 @@ 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 { RemoteData } from '../../../../../../core/data/remote-data'; +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 - @@ -17,9 +21,11 @@ import { RemoteData } from '../../../../../../core/data/remote-data'; */ @Component({ - selector: 'ds-supervision-group-selector', - styleUrls: ['./supervision-order-group-selector.component.scss'], - templateUrl: './supervision-order-group-selector.component.html', + 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 2f4ed631ccc..b3f8e5ef59a 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 @@ -16,20 +16,20 @@ describe('SupervisionOrderStatusComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbTooltipModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ SupervisionOrderStatusComponent, VarDirective ], - schemas: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + SupervisionOrderStatusComponent, VarDirective + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }) + ] +}) .compileComponents(); }); 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 93c6441e920..c0dd5eb5782 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 @@ -9,6 +9,10 @@ import { getFirstCompletedRemoteData } from '../../../../../../core/shared/opera import { isNotEmpty } from '../../../../../../shared/empty.util'; import { RemoteData } from '../../../../../../core/data/remote-data'; import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf, NgFor, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../../../../../../shared/utils/var.directive'; export interface SupervisionOrderListEntry { supervisionOrder: SupervisionOrder; @@ -16,9 +20,11 @@ export interface SupervisionOrderListEntry { } @Component({ - selector: 'ds-supervision-order-status', - templateUrl: './supervision-order-status.component.html', - styleUrls: ['./supervision-order-status.component.scss'] + 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 a8f0581ec0e..e9afa547988 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 @@ -53,19 +53,19 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModalModule, TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - declarations: [WorkspaceItemAdminWorkflowActionsComponent], - providers: [ + RouterTestingModule.withRoutes([]), + WorkspaceItemAdminWorkflowActionsComponent + ], + providers: [ { provide: DSONameService, useClass: DSONameServiceMock }, { provide: NotificationsService, useValue: notificationService }, { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 36678460da1..9329cc20e39 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 @@ -3,7 +3,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { map, Observable } from 'rxjs'; import { switchMap, take, tap } from 'rxjs/operators'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { Item } from '../../../../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators'; @@ -16,7 +16,7 @@ import { import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model'; import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model'; -import { SupervisionOrderListEntry } from './supervision-order-status/supervision-order-status.component'; +import { SupervisionOrderListEntry, SupervisionOrderStatusComponent } from './supervision-order-status/supervision-order-status.component'; import { ConfirmationModalComponent } from '../../../../../shared/confirmation-modal/confirmation-modal.component'; import { hasValue } from '../../../../../shared/empty.util'; import { NotificationsService } from '../../../../../shared/notifications/notifications.service'; @@ -24,11 +24,15 @@ import { SupervisionOrderDataService } from '../../../../../core/supervision-ord import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; import { getSearchResultFor } from '../../../../../shared/search/search-result-element-decorator'; +import { RouterLink } from '@angular/router'; +import { NgClass, NgIf } from '@angular/common'; @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' + 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 8035c53547e..c3ee9fa37b9 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 @@ -55,24 +55,24 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => { init(); TestBed.configureTestingModule( { - declarations: [WorkflowItemSearchResultAdminWorkflowGridElementComponent, ItemGridElementComponent, ListableObjectDirective], - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ], - providers: [ - { provide: LinkService, useValue: linkService }, - { provide: ThemeService, useValue: themeService }, - { + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + WorkflowItemSearchResultAdminWorkflowGridElementComponent, ItemGridElementComponent, ListableObjectDirective + ], + providers: [ + { provide: LinkService, useValue: linkService }, + { provide: ThemeService, useValue: themeService }, + { provide: TruncatableService, useValue: { - isCollapsed: () => observableOf(true), + isCollapsed: () => observableOf(true), } - }, - { provide: BitstreamDataService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + }, + { provide: BitstreamDataService, useValue: {} }, + ], + schemas: [NO_ERRORS_SCHEMA] +}) .overrideComponent(WorkflowItemSearchResultAdminWorkflowGridElementComponent, { set: { entryComponents: [ItemGridElementComponent] 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 fd9d21e227d..421b924cc60 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 @@ -24,12 +24,17 @@ import { take } from 'rxjs/operators'; import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { ThemeService } from '../../../../../shared/theme-support/theme.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component'; +import { NgIf } from '@angular/common'; @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' + 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: [ListableObjectDirective, NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule] }) /** * 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 b9e752c1047..6a1edc4240b 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 @@ -67,25 +67,25 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => { init(); TestBed.configureTestingModule( { - declarations: [WorkspaceItemSearchResultAdminWorkflowGridElementComponent, ItemGridElementComponent, ListableObjectDirective], - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ], - providers: [ - { provide: LinkService, useValue: linkService }, - { provide: ThemeService, useValue: themeService }, - { + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + WorkspaceItemSearchResultAdminWorkflowGridElementComponent, ItemGridElementComponent, ListableObjectDirective + ], + 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 } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + }, + { provide: BitstreamDataService, useValue: {} }, + { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService } + ], + schemas: [NO_ERRORS_SCHEMA] +}) .overrideComponent(WorkspaceItemSearchResultAdminWorkflowGridElementComponent, { set: { entryComponents: [ItemGridElementComponent] 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 d6f39e79feb..067a8312489 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 @@ -37,12 +37,17 @@ import { SupervisionOrder } from '../../../../../core/supervision-order/models/s import { PaginatedList } from '../../../../../core/data/paginated-list.model'; import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { AsyncPipe } from '@angular/common'; +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' + 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: [ListableObjectDirective, WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule] }) /** * 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 ab5d8b79a84..957b55c9ae1 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 @@ -48,20 +48,20 @@ describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => { init(); TestBed.configureTestingModule( { - declarations: [WorkflowItemSearchResultAdminWorkflowListElementComponent], - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ], - providers: [ - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + 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 } + ], + 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 d0e773d696c..da3ab10a761 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 @@ -20,12 +20,18 @@ import { } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; +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' + 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 19eefc9c481..1a4d4392fe8 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 @@ -60,21 +60,21 @@ describe('WorkspaceItemSearchResultAdminWorkflowListElementComponent', () => { init(); TestBed.configureTestingModule( { - declarations: [WorkspaceItemSearchResultAdminWorkflowListElementComponent], - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]), - ], - providers: [ - { provide: TruncatableService, useValue: mockTruncatableService }, - { provide: LinkService, useValue: linkService }, - { provide: DSONameService, useClass: DSONameServiceMock }, - { provide: SupervisionOrderDataService, useValue: supervisionOrderDataService }, - { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), + WorkspaceItemSearchResultAdminWorkflowListElementComponent + ], + providers: [ + { provide: TruncatableService, useValue: mockTruncatableService }, + { provide: LinkService, useValue: linkService }, + { provide: DSONameService, useClass: DSONameServiceMock }, + { 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 3d6d1c8e445..2de5cfcb7a2 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 @@ -31,12 +31,18 @@ import { SupervisionOrder } from '../../../../../core/supervision-order/models/s import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service'; import { PaginatedList } from '../../../../../core/data/paginated-list.model'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.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' + 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/admin/admin-workflow-page/admin-workflow.module.ts b/src/app/admin/admin-workflow-page/admin-workflow.module.ts index 21990c1ea9b..64f3747be33 100644 --- a/src/app/admin/admin-workflow-page/admin-workflow.module.ts +++ b/src/app/admin/admin-workflow-page/admin-workflow.module.ts @@ -37,21 +37,19 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - SearchModule, - SharedModule.withEntryComponents() - ], - declarations: [ - AdminWorkflowPageComponent, - SupervisionOrderGroupSelectorComponent, - SupervisionOrderStatusComponent, - WorkflowItemAdminWorkflowActionsComponent, - WorkspaceItemAdminWorkflowActionsComponent, - ...ENTRY_COMPONENTS - ], - exports: [ - AdminWorkflowPageComponent - ] + imports: [ + SearchModule, + SharedModule.withEntryComponents(), + AdminWorkflowPageComponent, + SupervisionOrderGroupSelectorComponent, + SupervisionOrderStatusComponent, + WorkflowItemAdminWorkflowActionsComponent, + WorkspaceItemAdminWorkflowActionsComponent, + ...ENTRY_COMPONENTS + ], + exports: [ + AdminWorkflowPageComponent + ] }) export class AdminWorkflowModuleModule { /** diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 3dc0036854e..4da844f728d 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -21,21 +21,19 @@ const ENTRY_COMPONENTS = [ @NgModule({ - imports: [ - AdminRoutingModule, - AdminRegistriesModule, - AccessControlModule, - AdminSearchModule.withEntryComponents(), - AdminWorkflowModuleModule.withEntryComponents(), - SharedModule, - UiSwitchModule, - UploadModule, - ], - declarations: [ - AdminCurationTasksComponent, - MetadataImportPageComponent, - BatchImportPageComponent - ] + imports: [ + AdminRoutingModule, + AdminRegistriesModule, + AccessControlModule, + AdminSearchModule.withEntryComponents(), + AdminWorkflowModuleModule.withEntryComponents(), + SharedModule, + UiSwitchModule, + UploadModule, + AdminCurationTasksComponent, + MetadataImportPageComponent, + BatchImportPageComponent + ] }) export class AdminModule { /** diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index deb68f1ea92..d621f96a70d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -186,8 +186,8 @@ import { ThemedPageErrorComponent } from './page-error/themed-page-error.compone }, { path: WORKFLOW_ITEM_MODULE_PATH, - loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.module') - .then((m) => m.WorkflowItemsEditPageModule), + loadChildren: () => import('./workflowitems-edit-page/workflowitems-edit-page.routes') + .then((m) => m.workflowItemsEditPageRoutes), canActivate: [EndUserAgreementCurrentUserGuard] }, { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ba7b7382278..32d669ca270 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,5 @@ import { distinctUntilChanged, take, withLatestFrom } from 'rxjs/operators'; -import { DOCUMENT, isPlatformBrowser } from '@angular/common'; +import { DOCUMENT, isPlatformBrowser, AsyncPipe } from '@angular/common'; import { AfterViewInit, ChangeDetectionStrategy, @@ -31,12 +31,15 @@ import { models } from './core/core.module'; import { ThemeService } from './shared/theme-support/theme.service'; import { IdleModalComponent } from './shared/idle-modal/idle-modal.component'; import { distinctNext } from './core/shared/distinct-next'; +import { ThemedRootComponent } from './root/themed-root.component'; @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, + standalone: true, + imports: [ThemedRootComponent, AsyncPipe] }) export class AppComponent implements OnInit, AfterViewInit { notificationOptions; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 89e361821ba..968cdc70763 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -115,20 +115,18 @@ const EXPORTS = [ ]; @NgModule({ - imports: [ - BrowserModule.withServerTransition({ appId: 'dspace-angular' }), - ...IMPORTS - ], - providers: [ - ...PROVIDERS - ], - declarations: [ - ...DECLARATIONS, - ], - exports: [ - ...EXPORTS, - ...DECLARATIONS, - ] + imports: [ + BrowserModule.withServerTransition({ appId: 'dspace-angular' }), + ...IMPORTS, + ...DECLARATIONS + ], + providers: [ + ...PROVIDERS + ], + exports: [ + ...EXPORTS, + ...DECLARATIONS, + ] }) export class AppModule { 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 c41351f3806..ced95e686f2 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 @@ -42,23 +42,23 @@ describe('BitstreamAuthorizationsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [BitstreamAuthorizationsComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + BitstreamAuthorizationsComponent + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, BitstreamAuthorizationsComponent, - ], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 adc06387804..480a59e33a1 100644 --- a/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts +++ b/src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts @@ -1,15 +1,25 @@ import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, RouterLink } from '@angular/router'; import { Observable } from 'rxjs'; import { first, map } from 'rxjs/operators'; 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', templateUrl: './bitstream-authorizations.component.html', + imports: [ + ResourcePoliciesComponent, + AsyncPipe, + TranslateModule, + RouterLink + ], + 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 59261e56d28..f18a65329ee 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 @@ -90,9 +90,8 @@ describe('BitstreamDownloadPageComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot()], - declarations: [BitstreamDownloadPageComponent], - providers: [ + imports: [CommonModule, TranslateModule.forRoot(), BitstreamDownloadPageComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: AuthorizationDataService, useValue: authorizationService }, @@ -102,8 +101,8 @@ describe('BitstreamDownloadPageComponent', () => { { provide: ServerResponseService, useValue: serverResponseService }, { 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 0b8e6a66e5b..2e28968ed77 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 @@ -13,15 +13,21 @@ import { HardRedirectService } from '../../core/services/hard-redirect.service'; import { getForbiddenRoute } from '../../app-routing-paths'; import { RemoteData } from '../../core/data/remote-data'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; -import { isPlatformServer, Location } from '@angular/common'; +import { AsyncPipe, isPlatformServer, Location } from '@angular/common'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { ServerResponseService } from '../../core/services/server-response.service'; import { SignpostingLink } from '../../core/data/signposting-links.model'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-bitstream-download-page', - templateUrl: './bitstream-download-page.component.html' + templateUrl: './bitstream-download-page.component.html', + imports: [ + AsyncPipe, + TranslateModule + ], + standalone: true }) /** * Page component for downloading a bitstream diff --git a/src/app/bitstream-page/bitstream-page.module.ts b/src/app/bitstream-page/bitstream-page.module.ts index 9bbe3d200c2..dbe897c8c69 100644 --- a/src/app/bitstream-page/bitstream-page.module.ts +++ b/src/app/bitstream-page/bitstream-page.module.ts @@ -13,19 +13,17 @@ import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-e * This module handles all components that are necessary for Bitstream related pages */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - BitstreamPageRoutingModule, - FormModule, - ResourcePoliciesModule - ], - declarations: [ - BitstreamAuthorizationsComponent, - EditBitstreamPageComponent, - ThemedEditBitstreamPageComponent, - BitstreamDownloadPageComponent, - ] + imports: [ + CommonModule, + SharedModule, + BitstreamPageRoutingModule, + FormModule, + ResourcePoliciesModule, + BitstreamAuthorizationsComponent, + EditBitstreamPageComponent, + ThemedEditBitstreamPageComponent, + BitstreamDownloadPageComponent + ] }) export class BitstreamPageModule { } 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 b83f2b96643..68f50a84246 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 @@ -192,26 +192,25 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [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) }), - snapshot: { queryParams: {} } + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + snapshot: { queryParams: {} } } - }, - { provide: BitstreamDataService, useValue: bitstreamService }, - { provide: DSONameService, useValue: dsoNameService }, - { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + ChangeDetectorRef + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); @@ -481,26 +480,25 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [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)}), - snapshot: {queryParams: {}} + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + snapshot: { queryParams: {} } } - }, - {provide: BitstreamDataService, useValue: bitstreamService}, - {provide: DSONameService, useValue: dsoNameService}, - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + ChangeDetectorRef + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { @@ -606,25 +604,24 @@ describe('EditBitstreamPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [EditBitstreamPageComponent, FileSizePipe, VarDirective], - providers: [ - {provide: NotificationsService, useValue: notificationsService}, - {provide: DynamicFormService, useValue: formService}, - {provide: ActivatedRoute, - useValue: { - data: observableOf({bitstream: createSuccessfulRemoteDataObject(bitstream)}), - snapshot: {queryParams: {}} - } - }, - {provide: BitstreamDataService, useValue: bitstreamService}, - {provide: DSONameService, useValue: dsoNameService}, - {provide: BitstreamFormatDataService, useValue: bitstreamFormatService}, - { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, - ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule, EditBitstreamPageComponent, FileSizePipe, VarDirective], + providers: [ + { provide: NotificationsService, useValue: notificationsService }, + { provide: DynamicFormService, useValue: formService }, + { provide: ActivatedRoute, + useValue: { + data: observableOf({ bitstream: createSuccessfulRemoteDataObject(bitstream) }), + snapshot: { queryParams: {} } + } + }, + { provide: BitstreamDataService, useValue: bitstreamService }, + { provide: DSONameService, useValue: dsoNameService }, + { provide: BitstreamFormatDataService, useValue: bitstreamFormatService }, + { provide: PrimaryBitstreamService, useValue: primaryBitstreamService }, + ChangeDetectorRef + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 b77d2151a9b..202d17633c6 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,11 +1,11 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; import { Bitstream } from '../../core/shared/bitstream.model'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { filter, map, switchMap, tap } from 'rxjs/operators'; import { combineLatest, combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; import { DynamicFormControlModel, DynamicFormGroupModel, DynamicFormLayout, DynamicFormService, DynamicInputModel, DynamicSelectModel } from '@ng-dynamic-forms/core'; import { UntypedFormGroup } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import cloneDeep from 'lodash/cloneDeep'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; @@ -16,7 +16,7 @@ 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 { Location } from '@angular/common'; +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'; @@ -26,12 +26,31 @@ import { Item } from '../../core/shared/item.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 { PrimaryBitstreamService } from '../../core/data/primary-bitstream.service'; +import { FormComponent } from '../../shared/form/form.component'; +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', styleUrls: ['./edit-bitstream-page.component.scss'], templateUrl: './edit-bitstream-page.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + imports: [ + FormComponent, + NgIf, + VarDirective, + ThemedThumbnailComponent, + AsyncPipe, + RouterLink, + ErrorComponent, + ThemedLoadingComponent, + TranslateModule, + FileSizePipe + ], + 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 dcca28a495e..48f4e32c9e8 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 @@ -3,9 +3,10 @@ import { EditBitstreamPageComponent } from './edit-bitstream-page.component'; import { ThemedComponent } from '../../shared/theme-support/themed.component'; @Component({ - selector: 'ds-themed-edit-bitstream-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 69387e75346..a52df4d8a4f 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.spec.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.spec.ts @@ -40,23 +40,21 @@ describe('BreadcrumbsComponent', () => { } as BreadcrumbsService; TestBed.configureTestingModule({ - declarations: [ - BreadcrumbsComponent, - VarDirective, - ], - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + } }), - ], - providers: [ + BreadcrumbsComponent, + 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 248fb446ed7..7511d47d055 100644 --- a/src/app/breadcrumbs/breadcrumbs.component.ts +++ b/src/app/breadcrumbs/breadcrumbs.component.ts @@ -2,6 +2,11 @@ import { Component } from '@angular/core'; 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 @@ -9,7 +14,9 @@ import { Observable } from 'rxjs'; @Component({ selector: 'ds-breadcrumbs', templateUrl: './breadcrumbs.component.html', - styleUrls: ['./breadcrumbs.component.scss'] + styleUrls: ['./breadcrumbs.component.scss'], + standalone: true, + 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 1869a440b90..73efb811aec 100644 --- a/src/app/breadcrumbs/themed-breadcrumbs.component.ts +++ b/src/app/breadcrumbs/themed-breadcrumbs.component.ts @@ -6,9 +6,10 @@ import { BreadcrumbsComponent } from './breadcrumbs.component'; * Themed wrapper for BreadcrumbsComponent */ @Component({ - selector: 'ds-themed-breadcrumbs', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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-page/browse-by-date-page.component.spec.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts index e41d3a45b25..d6bb0715c5d 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.spec.ts @@ -85,9 +85,8 @@ describe('BrowseByDatePageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BrowseByDatePageComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BrowseByDatePageComponent, EnumKeysPipe, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: BrowseService, useValue: mockBrowseService }, { provide: DSpaceObjectDataService, useValue: mockDsoService }, @@ -95,9 +94,9 @@ describe('BrowseByDatePageComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: ChangeDetectorRef, useValue: mockCdRef }, { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts index 7074190e1eb..048cc0e6b07 100644 --- a/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts @@ -19,11 +19,41 @@ import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; import { RemoteData } from '../../core/data/remote-data'; 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 { 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'; @Component({ selector: 'ds-browse-by-date-page', styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html', + standalone: true, + imports: [ + VarDirective, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + NgIf, + ThemedComcolPageHandleComponent, + ComcolPageContentComponent, + DsoEditMenuComponent, + ThemedComcolPageBrowseByComponent, + BrowseByComponent, + TranslateModule, + ThemedLoadingComponent + ] }) /** * Component for browsing items by metadata definition of type 'date' diff --git a/src/app/browse-by/browse-by-date-page/themed-browse-by-date-page.component.ts b/src/app/browse-by/browse-by-date-page/themed-browse-by-date-page.component.ts index 8eeae0c5de5..c2548178364 100644 --- a/src/app/browse-by/browse-by-date-page/themed-browse-by-date-page.component.ts +++ b/src/app/browse-by/browse-by-date-page/themed-browse-by-date-page.component.ts @@ -7,9 +7,10 @@ import {BrowseByDataType, rendersBrowseBy} from '../browse-by-switcher/browse-by * Themed wrapper for BrowseByDatePageComponent * */ @Component({ - selector: 'ds-themed-browse-by-metadata-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + selector: 'ds-themed-browse-by-metadata-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) @rendersBrowseBy(BrowseByDataType.Date) diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts index a5beeb8a452..18aea01330a 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.spec.ts @@ -102,18 +102,17 @@ describe('BrowseByMetadataPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BrowseByMetadataPageComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BrowseByMetadataPageComponent, EnumKeysPipe, VarDirective], + 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: environmentMock } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts index 113bc67c924..0173e3f13c2 100644 --- a/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -22,13 +22,43 @@ import { Collection } from '../../core/shared/collection.model'; import { Community } from '../../core/shared/community.model'; 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 { 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'; export const BBM_PAGINATION_ID = 'bbm'; @Component({ selector: 'ds-browse-by-metadata-page', styleUrls: ['./browse-by-metadata-page.component.scss'], - templateUrl: './browse-by-metadata-page.component.html' + templateUrl: './browse-by-metadata-page.component.html', + imports: [ + VarDirective, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + NgIf, + ThemedComcolPageHandleComponent, + ComcolPageContentComponent, + DsoEditMenuComponent, + ThemedComcolPageBrowseByComponent, + BrowseByComponent, + TranslateModule, + ThemedLoadingComponent + ], + standalone: true }) /** * Component for browsing (items) by metadata definition. diff --git a/src/app/browse-by/browse-by-metadata-page/themed-browse-by-metadata-page.component.ts b/src/app/browse-by/browse-by-metadata-page/themed-browse-by-metadata-page.component.ts index b0679258e91..ff16fda15f2 100644 --- a/src/app/browse-by/browse-by-metadata-page/themed-browse-by-metadata-page.component.ts +++ b/src/app/browse-by/browse-by-metadata-page/themed-browse-by-metadata-page.component.ts @@ -7,9 +7,10 @@ import {BrowseByDataType, rendersBrowseBy} from '../browse-by-switcher/browse-by * Themed wrapper for BrowseByMetadataPageComponent **/ @Component({ - selector: 'ds-themed-browse-by-metadata-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + selector: 'ds-themed-browse-by-metadata-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) @rendersBrowseBy(BrowseByDataType.Metadata) 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 c13405dd4d2..752693998d3 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 @@ -57,14 +57,14 @@ describe('BrowseBySwitcherComponent', () => { }); TestBed.configureTestingModule({ - declarations: [BrowseBySwitcherComponent], - providers: [ + imports: [BrowseBySwitcherComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: ThemeService, useValue: themeService }, { provide: BROWSE_BY_COMPONENT_FACTORY, useValue: jasmine.createSpy('getComponentByBrowseByType').and.returnValue(null) } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 35e4edf9005..5f52c67e458 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 @@ -8,8 +8,9 @@ import { BrowseDefinition } from '../../core/shared/browse-definition.model'; import { ThemeService } from '../../shared/theme-support/theme.service'; @Component({ - selector: 'ds-browse-by-switcher', - templateUrl: './browse-by-switcher.component.html' + selector: 'ds-browse-by-switcher', + templateUrl: './browse-by-switcher.component.html', + standalone: true }) /** * Component for determining what Browse-By component to use depending on the metadata (browse ID) provided diff --git a/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts index 0187d4e3c5e..9ba4ca89d9a 100644 --- a/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/themed-browse-by-switcher.component.ts @@ -7,9 +7,10 @@ import { BrowseBySwitcherComponent } from './browse-by-switcher.component'; * Themed wrapper for BrowseBySwitcherComponent */ @Component({ - selector: 'ds-themed-browse-by-switcher', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html' + selector: 'ds-themed-browse-by-switcher', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) export class ThemedBrowseBySwitcherComponent extends ThemedComponent { protected getComponentName(): string { diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts index c724017b1fd..a424a4db650 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.spec.ts @@ -28,14 +28,13 @@ describe('BrowseByTaxonomyPageComponent', () => { }); await TestBed.configureTestingModule({ - imports: [ TranslateModule.forRoot() ], - declarations: [ BrowseByTaxonomyPageComponent ], - providers: [ + imports: [TranslateModule.forRoot(), BrowseByTaxonomyPageComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: ThemeService, useValue: themeService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); }); diff --git a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts index cf6345bf394..e05ec22a13b 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, Inject, OnDestroy } 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 } from '@angular/router'; +import { ActivatedRoute, RouterLink } from '@angular/router'; import { Observable, Subscription } from 'rxjs'; import { BrowseDefinition } from '../../core/shared/browse-definition.model'; import { GenericConstructor } from '../../core/shared/generic-constructor'; @@ -9,11 +9,19 @@ import { BROWSE_BY_COMPONENT_FACTORY } from '../browse-by-switcher/browse-by-dec import { map } from 'rxjs/operators'; import { ThemeService } from 'src/app/shared/theme-support/theme.service'; 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'; @Component({ selector: 'ds-browse-by-taxonomy-page', templateUrl: './browse-by-taxonomy-page.component.html', - styleUrls: ['./browse-by-taxonomy-page.component.scss'] + styleUrls: ['./browse-by-taxonomy-page.component.scss'], + imports: [ + VocabularyTreeviewComponent, + RouterLink, + TranslateModule + ], + standalone: true }) /** * Component for browsing items by metadata in a hierarchical controlled vocabulary diff --git a/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts b/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts index 212044b8539..8e45056c735 100644 --- a/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts +++ b/src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.ts @@ -4,9 +4,10 @@ import { rendersBrowseBy } from '../browse-by-switcher/browse-by-decorator'; import { BrowseByTaxonomyPageComponent } from './browse-by-taxonomy-page.component'; @Component({ - selector: 'ds-themed-browse-by-taxonomy-page', - templateUrl: '../../shared/theme-support/themed.component.html', - styleUrls: [] + selector: 'ds-themed-browse-by-taxonomy-page', + templateUrl: '../../shared/theme-support/themed.component.html', + styleUrls: [], + standalone: true }) /** * Themed wrapper for BrowseByTaxonomyPageComponent diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts index e32c0ac430d..abeebe07a00 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.spec.ts @@ -70,18 +70,17 @@ describe('BrowseByTitlePageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [BrowseByTitlePageComponent, EnumKeysPipe, VarDirective], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BrowseByTitlePageComponent, EnumKeysPipe, VarDirective], + 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] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts index 58df79ebe85..71bf668e98d 100644 --- a/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts @@ -14,11 +14,41 @@ import { map } from 'rxjs/operators'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { AppConfig, APP_CONFIG } 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 { 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'; @Component({ - selector: 'ds-browse-by-title-page', - styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], - templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html' + selector: 'ds-browse-by-title-page', + styleUrls: ['../browse-by-metadata-page/browse-by-metadata-page.component.scss'], + templateUrl: '../browse-by-metadata-page/browse-by-metadata-page.component.html', + standalone: true, + imports: [ + VarDirective, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + NgIf, + ThemedComcolPageHandleComponent, + ComcolPageContentComponent, + DsoEditMenuComponent, + ThemedComcolPageBrowseByComponent, + BrowseByComponent, + TranslateModule, + ThemedLoadingComponent + ], }) /** * Component for browsing items by title (dc.title) diff --git a/src/app/browse-by/browse-by-title-page/themed-browse-by-title-page.component.ts b/src/app/browse-by/browse-by-title-page/themed-browse-by-title-page.component.ts index 4a1bcc0bc11..35234d599c2 100644 --- a/src/app/browse-by/browse-by-title-page/themed-browse-by-title-page.component.ts +++ b/src/app/browse-by/browse-by-title-page/themed-browse-by-title-page.component.ts @@ -7,9 +7,10 @@ import {BrowseByDataType, rendersBrowseBy} from '../browse-by-switcher/browse-by * Themed wrapper for BrowseByTitlePageComponent */ @Component({ - selector: 'ds-themed-browse-by-title-page', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + selector: 'ds-themed-browse-by-title-page', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) @rendersBrowseBy(BrowseByDataType.Title) diff --git a/src/app/browse-by/browse-by.module.ts b/src/app/browse-by/browse-by.module.ts index c0e2d3f9ff8..e82536a9e4a 100644 --- a/src/app/browse-by/browse-by.module.ts +++ b/src/app/browse-by/browse-by.module.ts @@ -29,21 +29,19 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - SharedBrowseByModule, - CommonModule, - ComcolModule, - DsoPageModule, - FormModule, - ], - declarations: [ - BrowseBySwitcherComponent, - ThemedBrowseBySwitcherComponent, - ...ENTRY_COMPONENTS - ], - exports: [ - BrowseBySwitcherComponent - ] + imports: [ + SharedBrowseByModule, + CommonModule, + ComcolModule, + DsoPageModule, + FormModule, + BrowseBySwitcherComponent, + ThemedBrowseBySwitcherComponent, + ...ENTRY_COMPONENTS + ], + exports: [ + BrowseBySwitcherComponent + ] }) export class BrowseByModule { /** 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 aae200b4019..778fcca12b5 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChange, SimpleChanges } from '@angular/core'; import { Observable } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { DynamicFormControlModel, DynamicFormOptionConfig, @@ -23,6 +23,11 @@ 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'; /** @@ -31,7 +36,18 @@ import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; @Component({ selector: 'ds-collection-form', styleUrls: ['../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.scss'], - templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html' + templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', + standalone: true, + imports: [ + FormComponent, + TranslateModule, + UploaderComponent, + AsyncPipe, + ComcolPageLogoComponent, + NgIf, + NgClass, + VarDirective + ], }) export class CollectionFormComponent extends ComColFormComponent implements OnInit, OnChanges { /** diff --git a/src/app/collection-page/collection-form/collection-form.module.ts b/src/app/collection-page/collection-form/collection-form.module.ts index ddf18f05869..88debb19575 100644 --- a/src/app/collection-page/collection-form/collection-form.module.ts +++ b/src/app/collection-page/collection-form/collection-form.module.ts @@ -6,17 +6,15 @@ import { ComcolModule } from '../../shared/comcol/comcol.module'; import { FormModule } from '../../shared/form/form.module'; @NgModule({ - imports: [ - ComcolModule, - FormModule, - SharedModule - ], - declarations: [ - CollectionFormComponent, - ], - exports: [ - CollectionFormComponent - ] + imports: [ + ComcolModule, + FormModule, + SharedModule, + CollectionFormComponent + ], + exports: [ + CollectionFormComponent + ] }) export class CollectionFormModule { 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 db844b588f9..dede5dbdfb3 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 @@ -168,9 +168,8 @@ describe('CollectionItemMapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 }, @@ -186,8 +185,8 @@ describe('CollectionItemMapperComponent', () => { { provide: GroupDataService, useValue: groupDataService }, { 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 e0e4aaf9302..11b788450f8 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 @@ -20,7 +20,7 @@ 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 { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { isNotEmpty } from '../../shared/empty.util'; import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component'; @@ -30,6 +30,10 @@ import { SearchService } from '../../core/shared/search/search.service'; 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 { ItemSelectComponent } from '../../shared/object-select/item-select/item-select.component'; @Component({ selector: 'ds-collection-item-mapper', @@ -45,7 +49,16 @@ import { FeatureID } from '../../core/data/feature-authorization/feature-id'; provide: SEARCH_CONFIG_SERVICE, useClass: SearchConfigurationService } - ] + ], + imports: [ + ThemedSearchFormComponent, + NgbNavModule, + TranslateModule, + AsyncPipe, + ItemSelectComponent, + NgIf + ], + standalone: true }) /** * Component used to map items to a collection diff --git a/src/app/collection-page/collection-page.component.ts b/src/app/collection-page/collection-page.component.ts index 16704cef52e..512c8407918 100644 --- a/src/app/collection-page/collection-page.component.ts +++ b/src/app/collection-page/collection-page.component.ts @@ -31,6 +31,26 @@ import { redirectOn4xx } from '../core/shared/authorized.operators'; import { BROWSE_LINKS_TO_FOLLOW } from '../core/browse/browse.service'; import { DSONameService } from '../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../src/config/app-config.interface'; +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 { + DsoPageSubscriptionButtonComponent +} from '../shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.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'; @Component({ selector: 'ds-collection-page', @@ -40,7 +60,25 @@ import { APP_CONFIG, AppConfig } from '../../../src/config/app-config.interface' animations: [ fadeIn, fadeInOut - ] + ], + imports: [ + ComcolPageContentComponent, + ErrorComponent, + NgIf, + ThemedLoadingComponent, + TranslateModule, + ViewTrackerComponent, + VarDirective, + AsyncPipe, + ComcolPageHeaderComponent, + ComcolPageLogoComponent, + ThemedComcolPageHandleComponent, + DsoEditMenuComponent, + DsoPageSubscriptionButtonComponent, + ThemedComcolPageBrowseByComponent, + ObjectCollectionComponent + ], + standalone: true }) export class CollectionPageComponent implements OnInit { collectionRD$: Observable>; diff --git a/src/app/collection-page/collection-page.module.ts b/src/app/collection-page/collection-page.module.ts index 6bcefed2b72..ba908f9fcc1 100644 --- a/src/app/collection-page/collection-page.module.ts +++ b/src/app/collection-page/collection-page.module.ts @@ -20,29 +20,27 @@ import { DsoSharedModule } from '../dso-shared/dso-shared.module'; import { DsoPageModule } from '../shared/dso-page/dso-page.module'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - CollectionPageRoutingModule, - StatisticsModule.forRoot(), - EditItemPageModule, - CollectionFormModule, - ComcolModule, - DsoSharedModule, - DsoPageModule, - ], - declarations: [ - CollectionPageComponent, - ThemedCollectionPageComponent, - CreateCollectionPageComponent, - DeleteCollectionPageComponent, - EditItemTemplatePageComponent, - ThemedEditItemTemplatePageComponent, - CollectionItemMapperComponent - ], - providers: [ - SearchService, - ], + imports: [ + CommonModule, + SharedModule, + CollectionPageRoutingModule, + StatisticsModule.forRoot(), + EditItemPageModule, + CollectionFormModule, + ComcolModule, + DsoSharedModule, + DsoPageModule, + CollectionPageComponent, + ThemedCollectionPageComponent, + CreateCollectionPageComponent, + DeleteCollectionPageComponent, + EditItemTemplatePageComponent, + ThemedEditItemTemplatePageComponent, + CollectionItemMapperComponent + ], + providers: [ + SearchService, + ] }) export class CollectionPageModule { 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 5a4295cb260..d062f39e958 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 @@ -22,22 +22,21 @@ describe('CreateCollectionPageComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [CreateCollectionPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, CreateCollectionPageComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CollectionDataService, useValue: {} }, { - provide: CommunityDataService, - useValue: { findById: () => observableOf({ payload: { name: 'test' } }) } + provide: CommunityDataService, + useValue: { findById: () => observableOf({ payload: { name: 'test' } }) } }, { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, - { provide: RequestService, useValue: {}} - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + { provide: RequestService, useValue: {} } + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 a8cf594c3b0..6ce30a1848d 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 @@ -6,9 +6,11 @@ import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/crea import { Collection } from '../../core/shared/collection.model'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +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 @@ -16,7 +18,13 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-create-collection', styleUrls: ['./create-collection-page.component.scss'], - templateUrl: './create-collection-page.component.html' + templateUrl: './create-collection-page.component.html', + imports: [ + CollectionFormComponent, + TranslateModule, + AsyncPipe + ], + 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 9fc88932d07..b95b8958fbd 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 @@ -19,17 +19,16 @@ describe('DeleteCollectionPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [DeleteCollectionPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0a1b87e58b3..20f676ff02d 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 @@ -4,8 +4,10 @@ import { DeleteComColPageComponent } from '../../shared/comcol/comcol-forms/dele import { NotificationsService } from '../../shared/notifications/notifications.service'; import { CollectionDataService } from '../../core/data/collection-data.service'; import { Collection } from '../../core/shared/collection.model'; -import { TranslateService } from '@ngx-translate/core'; +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'; /** * Component that represents the page where a user can delete an existing Collection @@ -13,7 +15,14 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-delete-collection', styleUrls: ['./delete-collection-page.component.scss'], - templateUrl: './delete-collection-page.component.html' + templateUrl: './delete-collection-page.component.html', + imports: [ + TranslateModule, + AsyncPipe, + NgIf, + VarDirective + ], + 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 04da8bbcd92..5eaa42077ba 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 @@ -8,8 +8,8 @@ xdescribe('CollectionAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CollectionAccessControlComponent ] - }) + imports: [CollectionAccessControlComponent] +}) .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 4192fe5a9a3..17cfbf3bfd9 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 @@ -5,11 +5,21 @@ import { Community } from '../../../core/shared/community.model'; import { ActivatedRoute } from '@angular/router'; import { map } from 'rxjs/operators'; 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'; @Component({ selector: 'ds-collection-access-control', templateUrl: './collection-access-control.component.html', styleUrls: ['./collection-access-control.component.scss'], + imports: [ + AccessControlFormContainerComponent, + NgIf, + AsyncPipe + ], + 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 c8e529443a4..8127a3b6e8c 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 @@ -37,17 +37,17 @@ describe('CollectionAuthorizationsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule - ], - declarations: [CollectionAuthorizationsComponent], - providers: [ + imports: [ + CommonModule, + CollectionAuthorizationsComponent + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, CollectionAuthorizationsComponent, - ], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 d1b59a0c903..3c84c4ccbbd 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 @@ -6,10 +6,17 @@ import { first, map } from 'rxjs/operators'; 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 + ], + 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 2cf25734e12..ea292747e50 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 @@ -34,14 +34,13 @@ describe('CollectionCurateComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [CollectionCurateComponent], - providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: DSONameService, useValue: dsoNameService} - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), CollectionCurateComponent], + providers: [ + { provide: ActivatedRoute, useValue: routeStub }, + { provide: DSONameService, useValue: dsoNameService } + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 e20f229cd64..2a09a6e00fc 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 @@ -6,6 +6,9 @@ import { ActivatedRoute } from '@angular/router'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; 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'; /** * Component for managing a collection's curation tasks @@ -13,6 +16,12 @@ import { hasValue } from '../../../shared/empty.util'; @Component({ selector: 'ds-collection-curate', templateUrl: './collection-curate.component.html', + imports: [ + CurationFormComponent, + TranslateModule, + AsyncPipe + ], + 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 7cc54bd994c..e9575a15ba1 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 @@ -59,18 +59,17 @@ describe('CollectionMetadataComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [CollectionMetadataComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, CollectionMetadataComponent], + providers: [ { provide: CollectionDataService, useValue: {} }, { provide: ItemTemplateDataService, useValue: itemTemplateServiceStub }, { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } }, { provide: NotificationsService, useValue: notificationsService }, { provide: RequestService, useValue: requestService }, - { provide: Router, useValue: routerMock} - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + { provide: Router, useValue: routerMock } + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 634363527f7..0d075d6db94 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 @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { ComcolMetadataComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component'; import { Collection } from '../../../core/shared/collection.model'; import { CollectionDataService } from '../../../core/data/collection-data.service'; -import { ActivatedRoute, NavigationEnd, Router, Scroll } from '@angular/router'; +import { ActivatedRoute, NavigationEnd, Router, RouterLink, Scroll } from '@angular/router'; import { ItemTemplateDataService } from '../../../core/data/item-template-data.service'; import { combineLatest as combineLatestObservable, Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; @@ -10,11 +10,14 @@ 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 { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { RequestService } from '../../../core/data/request.service'; import { getCollectionItemTemplateRoute } from '../../collection-page-routing-paths'; import { NoContent } from '../../../core/shared/NoContent.model'; import { hasValue } from '../../../shared/empty.util'; +import { CollectionFormComponent } from '../../collection-form/collection-form.component'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { VarDirective } from '../../../shared/utils/var.directive'; /** * Component for editing a collection's metadata @@ -22,6 +25,15 @@ import { hasValue } from '../../../shared/empty.util'; @Component({ selector: 'ds-collection-metadata', templateUrl: './collection-metadata.component.html', + imports: [ + CollectionFormComponent, + RouterLink, + AsyncPipe, + TranslateModule, + NgIf, + VarDirective + ], + 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 c375a23ddf9..fd75a001733 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 @@ -69,25 +69,23 @@ describe('CollectionRolesComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ ComcolModule, SharedModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), - NoopAnimationsModule - ], - declarations: [ - CollectionRolesComponent, - ], - providers: [ + NoopAnimationsModule, + 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0177cc3a386..7049168eeb9 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 @@ -7,6 +7,10 @@ import { Collection } from '../../../core/shared/collection.model'; import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { HALLink } from '../../../core/shared/hal-link.model'; 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 @@ -14,6 +18,12 @@ import { hasValue } from '../../../shared/empty.util'; @Component({ selector: 'ds-collection-roles', templateUrl: './collection-roles.component.html', + imports: [ + ComcolRoleComponent, + NgForOf, + AsyncPipe + ], + 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 3eb83ebe8ac..54af5296e70 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 @@ -99,19 +99,18 @@ describe('CollectionSourceControlsComponent', () => { requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [CollectionSourceControlsComponent, VarDirective], - providers: [ - {provide: ScriptDataService, useValue: scriptDataService}, - {provide: ProcessDataService, useValue: processDataService}, - {provide: RequestService, useValue: requestService}, - {provide: NotificationsService, useValue: notificationsService}, - {provide: CollectionDataService, useValue: collectionService}, - {provide: HttpClient, useValue: httpClient}, - {provide: BitstreamDataService, useValue: bitstreamService} - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceControlsComponent, VarDirective], + providers: [ + { provide: ScriptDataService, useValue: scriptDataService }, + { provide: ProcessDataService, useValue: processDataService }, + { provide: RequestService, useValue: requestService }, + { provide: NotificationsService, useValue: notificationsService }, + { provide: CollectionDataService, useValue: collectionService }, + { provide: HttpClient, useValue: httpClient }, + { provide: BitstreamDataService, useValue: bitstreamService } + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 7113c25e9f6..f96fad01871 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 @@ -17,10 +17,12 @@ import { NotificationsService } from '../../../../shared/notifications/notificat import { Collection } from '../../../../core/shared/collection.model'; import { CollectionDataService } from '../../../../core/data/collection-data.service'; import { Process } from '../../../../process-page/processes/process.model'; -import { TranslateService } from '@ngx-translate/core'; +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'; /** * Component that contains the controls to run, reset and test the harvest @@ -29,6 +31,13 @@ import { ContentSourceSetSerializer } from '../../../../core/shared/content-sour selector: 'ds-collection-source-controls', styleUrls: ['./collection-source-controls.component.scss'], templateUrl: './collection-source-controls.component.html', + imports: [ + TranslateModule, + AsyncPipe, + NgIf, + VarDirective + ], + standalone: true }) export class CollectionSourceControlsComponent implements 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 e7e98d95233..529488a7185 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 @@ -119,9 +119,8 @@ describe('CollectionSourceComponent', () => { requestService = jasmine.createSpyObj('requestService', ['removeByHrefSubstring', 'setStaleByHrefSubstring']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [CollectionSourceComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule, CollectionSourceComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Location, useValue: location }, @@ -130,9 +129,9 @@ describe('CollectionSourceComponent', () => { { provide: Router, useValue: router }, { provide: CollectionDataService, useValue: collectionService }, { provide: RequestService, useValue: requestService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 2d1308cc83a..4a77e1ac4aa 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 @@ -10,8 +10,8 @@ import { DynamicRadioGroupModel, DynamicSelectModel } from '@ng-dynamic-forms/core'; -import { Location } from '@angular/common'; -import { TranslateService } from '@ngx-translate/core'; +import { AsyncPipe, Location, NgIf } from '@angular/common'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { UntypedFormGroup } from '@angular/forms'; @@ -31,6 +31,9 @@ import { RequestService } from '../../../core/data/request.service'; import { environment } from '../../../../environments/environment'; import { FieldUpdate } from '../../../core/data/object-updates/field-update.model'; import { FieldUpdates } from '../../../core/data/object-updates/field-updates.model'; +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"; /** * Component for managing the content source of the collection @@ -38,6 +41,15 @@ import { FieldUpdates } from '../../../core/data/object-updates/field-updates.mo @Component({ selector: 'ds-collection-source', templateUrl: './collection-source.component.html', + imports: [ + AsyncPipe, + TranslateModule, + NgIf, + ThemedLoadingComponent, + FormComponent, + CollectionSourceControlsComponent + ], + standalone: true }) export class CollectionSourceComponent extends AbstractTrackableComponent implements OnInit, OnDestroy { /** 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 00f05f50c0f..c60a34f8b9d 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 @@ -38,14 +38,13 @@ describe('EditCollectionPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [EditCollectionPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, EditCollectionPageComponent], + providers: [ { provide: CollectionDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 62fbb3ee3df..da037696b7b 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,15 +1,27 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink, RouterOutlet } from '@angular/router'; import { EditComColPageComponent } from '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { Collection } from '../../core/shared/collection.model'; 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 */ @Component({ selector: 'ds-edit-collection', - templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html' + templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', + imports: [ + RouterLink, + TranslateModule, + NgClass, + NgForOf, + RouterOutlet, + NgIf, + AsyncPipe + ], + standalone: true }) export class EditCollectionPageComponent extends EditComColPageComponent { type = 'collection'; diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts index 8d0cb179f1f..adaa964a7c6 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts @@ -22,26 +22,24 @@ import { AccessControlFormModule } from '../../shared/access-control-form-contai * Module that contains all components related to the Edit Collection page administrator functionality */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - EditCollectionPageRoutingModule, - CollectionFormModule, - ResourcePoliciesModule, - FormModule, - ComcolModule, - AccessControlFormModule, - ], - declarations: [ - EditCollectionPageComponent, - CollectionMetadataComponent, - CollectionRolesComponent, - CollectionCurateComponent, - CollectionSourceComponent, - CollectionAccessControlComponent, - CollectionSourceControlsComponent, - CollectionAuthorizationsComponent - ] + imports: [ + CommonModule, + SharedModule, + EditCollectionPageRoutingModule, + CollectionFormModule, + ResourcePoliciesModule, + FormModule, + ComcolModule, + AccessControlFormModule, + EditCollectionPageComponent, + CollectionMetadataComponent, + CollectionRolesComponent, + CollectionCurateComponent, + CollectionSourceComponent, + CollectionAccessControlComponent, + CollectionSourceControlsComponent, + CollectionAuthorizationsComponent + ] }) export class EditCollectionPageModule { 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 72b776dd7d5..248c70758bf 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 @@ -28,14 +28,13 @@ describe('EditItemTemplatePageComponent', () => { findByCollectionID: createSuccessfulRemoteDataObject$({}) }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [EditItemTemplatePageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, EditItemTemplatePageComponent], + providers: [ { provide: ItemTemplateDataService, useValue: itemTemplateService }, { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: createSuccessfulRemoteDataObject(collection) }) } } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 238ec5e37a2..6c42e5420a1 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 @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { RemoteData } from '../../core/data/remote-data'; import { Collection } from '../../core/shared/collection.model'; -import { ActivatedRoute } from '@angular/router'; +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'; @@ -10,10 +10,27 @@ import { Item } from '../../core/shared/item.model'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { AlertType } from '../../shared/alert/alert-type'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +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'; @Component({ selector: 'ds-edit-item-template-page', templateUrl: './edit-item-template-page.component.html', + imports: [ + ThemedDsoEditMetadataComponent, + RouterLink, + AsyncPipe, + VarDirective, + NgIf, + TranslateModule, + ThemedLoadingComponent, + AlertComponent + ], + 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 b53f4e6c45d..4679c0e18d1 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 @@ -3,9 +3,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', + 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 2faf418423a..fab3bfa83d8 100644 --- a/src/app/collection-page/themed-collection-page.component.ts +++ b/src/app/collection-page/themed-collection-page.component.ts @@ -6,9 +6,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', + 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.component.spec.ts b/src/app/community-list-page/community-list-page.component.spec.ts index 080a0a9e18d..0e1230a4122 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 @@ -11,20 +11,20 @@ describe('CommunityListPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + }, }), - ], - declarations: [CommunityListPageComponent], - providers: [ + CommunityListPageComponent + ], + providers: [ CommunityListPageComponent, - ], - 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 5ab3cce5de3..a2e511f8a9e 100644 --- a/src/app/community-list-page/community-list-page.component.ts +++ b/src/app/community-list-page/community-list-page.component.ts @@ -1,12 +1,16 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedCommunityListComponent } from './community-list/themed-community-list.component'; /** * Page with title and the community list tree, as described in community-list.component; * navigated to with community-list.page.routing.module */ @Component({ - selector: 'ds-community-list-page', - templateUrl: './community-list-page.component.html', + 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-page.module.ts b/src/app/community-list-page/community-list-page.module.ts index 15946b2e89a..73b7ed64211 100644 --- a/src/app/community-list-page/community-list-page.module.ts +++ b/src/app/community-list-page/community-list-page.module.ts @@ -19,19 +19,17 @@ const DECLARATIONS = [ * The page which houses a title and the community list, as described in community-list.component */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - CommunityListPageRoutingModule, - CdkTreeModule, - ], - declarations: [ - ...DECLARATIONS - ], - exports: [ - ...DECLARATIONS, - CdkTreeModule, - ], + imports: [ + CommonModule, + SharedModule, + CommunityListPageRoutingModule, + CdkTreeModule, + ...DECLARATIONS + ], + exports: [ + ...DECLARATIONS, + CdkTreeModule, + ] }) export class CommunityListPageModule { 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 ce6b27dbeb2..78dec6dffe4 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 @@ -186,21 +186,22 @@ describe('CommunityListComponent', () => { } }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + }, }), CdkTreeModule, RouterTestingModule, - RouterLinkWithHref], - declarations: [CommunityListComponent], - providers: [CommunityListComponent, + RouterLinkWithHref, + CommunityListComponent + ], + providers: [CommunityListComponent, { provide: CommunityListService, useValue: communityListServiceStub },], - schemas: [CUSTOM_ELEMENTS_SCHEMA], - }) + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}) .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 90dd6b3c05d..ba5adc51162 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,13 +1,19 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { take } from 'rxjs/operators'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; -import { CommunityListService} from '../community-list-service'; +import { CommunityListService } from '../community-list-service'; import { CommunityListDatasource } from '../community-list-datasource'; -import { FlatTreeControl } from '@angular/cdk/tree'; +import { CdkTreeModule, FlatTreeControl } from '@angular/cdk/tree'; import { isEmpty } from '../../shared/empty.util'; 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'; /** * A tree-structured list of nodes representing the communities, their subCommunities and collections. @@ -19,6 +25,8 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-community-list', templateUrl: './community-list.component.html', + standalone: true, + 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 4a986e737c1..62f4cb306ac 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 @@ -4,9 +4,10 @@ import { Component } from '@angular/core'; @Component({ - selector: 'ds-themed-community-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 20fa97bedd1..8b0cb4e281d 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 @@ -6,9 +6,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', + 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 fa4809738d9..c718ec6ef8a 100644 --- a/src/app/community-page/community-form/community-form.component.ts +++ b/src/app/community-page/community-form/community-form.component.ts @@ -7,13 +7,18 @@ import { } from '@ng-dynamic-forms/core'; import { Community } from '../../core/shared/community.model'; import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; -import { TranslateService } from '@ngx-translate/core'; +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 { VarDirective } from '../../shared/utils/var.directive'; /** * Form used for creating and editing communities @@ -21,7 +26,18 @@ import { environment } from '../../../environments/environment'; @Component({ selector: 'ds-community-form', styleUrls: ['../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.scss'], - templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html' + templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', + standalone: true, + imports: [ + FormComponent, + TranslateModule, + UploaderComponent, + AsyncPipe, + ComcolPageLogoComponent, + NgIf, + NgClass, + VarDirective + ], }) export class CommunityFormComponent extends ComColFormComponent implements OnChanges { /** diff --git a/src/app/community-page/community-form/community-form.module.ts b/src/app/community-page/community-form/community-form.module.ts index 925d218973f..a8bddb5ffed 100644 --- a/src/app/community-page/community-form/community-form.module.ts +++ b/src/app/community-page/community-form/community-form.module.ts @@ -6,17 +6,15 @@ import { ComcolModule } from '../../shared/comcol/comcol.module'; import { FormModule } from '../../shared/form/form.module'; @NgModule({ - imports: [ - ComcolModule, - FormModule, - SharedModule - ], - declarations: [ - CommunityFormComponent, - ], - exports: [ - CommunityFormComponent - ] + imports: [ + ComcolModule, + FormModule, + SharedModule, + CommunityFormComponent + ], + exports: [ + CommunityFormComponent + ] }) export class CommunityFormModule { diff --git a/src/app/community-page/community-page.component.ts b/src/app/community-page/community-page.component.ts index a5bbff3cee7..9dd045957a6 100644 --- a/src/app/community-page/community-page.component.ts +++ b/src/app/community-page/community-page.component.ts @@ -20,13 +20,57 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { getCommunityPageRoute } from './community-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 { ThemedLoadingComponent } from '../shared/loading/themed-loading.component'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +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 { + 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 { + DsoPageSubscriptionButtonComponent +} from '../shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.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'; @Component({ selector: 'ds-community-page', styleUrls: ['./community-page.component.scss'], templateUrl: './community-page.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - animations: [fadeInOut] + animations: [fadeInOut], + imports: [ + ComcolPageContentComponent, + ErrorComponent, + ThemedLoadingComponent, + NgIf, + TranslateModule, + ThemedCommunityPageSubCommunityListComponent, + ThemedCollectionPageSubCollectionListComponent, + ThemedComcolPageBrowseByComponent, + DsoEditMenuComponent, + DsoPageSubscriptionButtonComponent, + ThemedComcolPageHandleComponent, + ComcolPageLogoComponent, + ComcolPageHeaderComponent, + AsyncPipe, + ViewTrackerComponent, + VarDirective + ], + standalone: true }) /** * This component represents a detail page for a single community diff --git a/src/app/community-page/community-page.module.ts b/src/app/community-page/community-page.module.ts index 45ffb2a7868..d997351bca6 100644 --- a/src/app/community-page/community-page.module.ts +++ b/src/app/community-page/community-page.module.ts @@ -31,21 +31,19 @@ const DECLARATIONS = [CommunityPageComponent, DeleteCommunityPageComponent]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - CommunityPageRoutingModule, - StatisticsModule.forRoot(), - CommunityFormModule, - ComcolModule, - DsoPageModule, - ], - declarations: [ - ...DECLARATIONS - ], - exports: [ - ...DECLARATIONS - ] + imports: [ + CommonModule, + SharedModule, + CommunityPageRoutingModule, + StatisticsModule.forRoot(), + CommunityFormModule, + ComcolModule, + DsoPageModule, + ...DECLARATIONS + ], + exports: [ + ...DECLARATIONS + ] }) export class CommunityPageModule { 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 fbff82efd86..55681a05090 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 @@ -19,17 +19,16 @@ describe('CreateCommunityPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [CreateCommunityPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, CreateCommunityPageComponent], + providers: [ { provide: CommunityDataService, useValue: { findById: () => observableOf({}) } }, { provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } }, { provide: Router, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: RequestService, useValue: {} } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 eea09083887..b0756c12758 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 @@ -5,9 +5,12 @@ import { RouteService } from '../../core/services/route.service'; import { Router } from '@angular/router'; import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +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'; /** * Component that represents the page where a user can create a new Community @@ -15,7 +18,15 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-create-community', styleUrls: ['./create-community-page.component.scss'], - templateUrl: './create-community-page.component.html' + templateUrl: './create-community-page.component.html', + imports: [ + CommunityFormComponent, + TranslateModule, + VarDirective, + NgIf, + AsyncPipe + ], + 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 55d0508c103..4fcc1cc26f1 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 @@ -19,17 +19,16 @@ describe('DeleteCommunityPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [DeleteCommunityPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, 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(); + { provide: RequestService, useValue: {} } + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 65b7c81b38b..83eb1981aa8 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 @@ -4,8 +4,10 @@ import { CommunityDataService } from '../../core/data/community-data.service'; 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 { TranslateService } from '@ngx-translate/core'; +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'; /** * Component that represents the page where a user can delete an existing Community @@ -13,7 +15,14 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-delete-community', styleUrls: ['./delete-community-page.component.scss'], - templateUrl: './delete-community-page.component.html' + templateUrl: './delete-community-page.component.html', + imports: [ + TranslateModule, + AsyncPipe, + VarDirective, + NgIf + ], + 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 d895cfd820b..8b9d0d3815a 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 @@ -8,8 +8,8 @@ xdescribe('CommunityAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CommunityAccessControlComponent ] - }) + imports: [CommunityAccessControlComponent] +}) .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 8a216e38dfa..1ab0a3a4dbc 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 @@ -5,11 +5,21 @@ import { ActivatedRoute } from '@angular/router'; import { map } from 'rxjs/operators'; 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'; @Component({ selector: 'ds-community-access-control', templateUrl: './community-access-control.component.html', styleUrls: ['./community-access-control.component.scss'], + imports: [ + AccessControlFormContainerComponent, + NgIf, + AsyncPipe + ], + 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 719cf83a26f..41042f3578b 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 @@ -37,17 +37,17 @@ describe('CommunityAuthorizationsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule - ], - declarations: [CommunityAuthorizationsComponent], - providers: [ + imports: [ + CommonModule, + CommunityAuthorizationsComponent + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, ChangeDetectorRef, CommunityAuthorizationsComponent, - ], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 7a9f224311d..68c87d87ecd 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 @@ -4,10 +4,17 @@ import { Observable } from 'rxjs'; import { first, map } from 'rxjs/operators'; 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 + ], + 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 1b1ee2c9f95..c24a0296029 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 @@ -34,14 +34,13 @@ describe('CommunityCurateComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [CommunityCurateComponent], - providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: DSONameService, useValue: dsoNameService} - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), CommunityCurateComponent], + providers: [ + { provide: ActivatedRoute, useValue: routeStub }, + { provide: DSONameService, useValue: dsoNameService } + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 8ae04af8f15..aa71c09fe9f 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 @@ -6,6 +6,9 @@ import { RemoteData } from '../../../core/data/remote-data'; import { Observable } from 'rxjs'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; 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"; /** * Component for managing a community's curation tasks @@ -13,6 +16,12 @@ import { hasValue } from '../../../shared/empty.util'; @Component({ selector: 'ds-community-curate', templateUrl: './community-curate.component.html', + imports: [ + CurationFormComponent, + TranslateModule, + AsyncPipe + ], + 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 c597fac0bd3..9de18344b13 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 @@ -17,15 +17,14 @@ describe('CommunityMetadataComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [CommunityMetadataComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, CommunityMetadataComponent], + providers: [ { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: { parent: { data: observableOf({ dso: { payload: {} } }) } } }, { provide: NotificationsService, useValue: new NotificationsServiceStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 a2dbfa6eb61..5a08bc84105 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 @@ -5,6 +5,8 @@ import { Community } from '../../../core/shared/community.model'; import { CommunityDataService } from '../../../core/data/community-data.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { TranslateService } from '@ngx-translate/core'; +import { CommunityFormComponent } from '../../community-form/community-form.component'; +import { AsyncPipe } from '@angular/common'; /** * Component for editing a community's metadata @@ -12,6 +14,11 @@ import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'ds-community-metadata', templateUrl: './community-metadata.component.html', + imports: [ + CommunityFormComponent, + AsyncPipe + ], + 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 f1f9e77caa6..615baf8897c 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 @@ -54,25 +54,23 @@ describe('CommunityRolesComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ ComcolModule, SharedModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), - NoopAnimationsModule - ], - declarations: [ - CommunityRolesComponent, - ], - providers: [ + NoopAnimationsModule, + 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 9468aa7048b..a04bf3a6f1d 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 @@ -6,6 +6,10 @@ import { Community } from '../../../core/shared/community.model'; import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { RemoteData } from '../../../core/data/remote-data'; 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'; /** * Component for managing a community's roles @@ -13,6 +17,12 @@ import { HALLink } from '../../../core/shared/hal-link.model'; @Component({ selector: 'ds-community-roles', templateUrl: './community-roles.component.html', + imports: [ + ComcolRoleComponent, + AsyncPipe, + NgForOf + ], + standalone: true }) export class CommunityRolesComponent implements OnInit { 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 3a4c3351c32..0843366fbc6 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 @@ -38,14 +38,13 @@ describe('EditCommunityPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule], - declarations: [EditCommunityPageComponent], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule, EditCommunityPageComponent], + providers: [ { provide: CommunityDataService, useValue: {} }, { provide: ActivatedRoute, useValue: routeStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 54a6ee49442..c50bad802a6 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,27 @@ import { Component } from '@angular/core'; import { Community } from '../../core/shared/community.model'; -import { ActivatedRoute, Router } from '@angular/router'; +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 */ @Component({ selector: 'ds-edit-community', - templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html' + templateUrl: '../../shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.html', + standalone: true, + imports: [ + RouterLink, + TranslateModule, + NgClass, + NgForOf, + RouterOutlet, + NgIf, + AsyncPipe + ] }) export class EditCommunityPageComponent extends EditComColPageComponent { type = 'community'; diff --git a/src/app/community-page/edit-community-page/edit-community-page.module.ts b/src/app/community-page/edit-community-page/edit-community-page.module.ts index 5190d6a0083..65ad5e3df78 100644 --- a/src/app/community-page/edit-community-page/edit-community-page.module.ts +++ b/src/app/community-page/edit-community-page/edit-community-page.module.ts @@ -19,23 +19,21 @@ import { * Module that contains all components related to the Edit Community page administrator functionality */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - EditCommunityPageRoutingModule, - CommunityFormModule, - ComcolModule, - ResourcePoliciesModule, - AccessControlFormModule, - ], - declarations: [ - EditCommunityPageComponent, - CommunityCurateComponent, - CommunityMetadataComponent, - CommunityRolesComponent, - CommunityAuthorizationsComponent, - CommunityAccessControlComponent - ] + imports: [ + CommonModule, + SharedModule, + EditCommunityPageRoutingModule, + CommunityFormModule, + ComcolModule, + ResourcePoliciesModule, + AccessControlFormModule, + EditCommunityPageComponent, + CommunityCurateComponent, + CommunityMetadataComponent, + CommunityRolesComponent, + CommunityAuthorizationsComponent, + CommunityAccessControlComponent + ] }) export class EditCommunityPageModule { diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts index bca3c42a950..dd7a6411cd8 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts @@ -147,15 +147,15 @@ describe('CommunityPageSubCollectionList Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([]), NgbModule, - NoopAnimationsModule - ], - declarations: [CommunityPageSubCollectionListComponent], - providers: [ + NoopAnimationsModule, + CommunityPageSubCollectionListComponent + ], + providers: [ { provide: CollectionDataService, useValue: collectionDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -165,9 +165,9 @@ describe('CommunityPageSubCollectionList Component', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts index 3a77149e5be..efd435af38f 100644 --- a/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts @@ -14,12 +14,28 @@ 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 { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; +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 { VarDirective } from "../../shared/utils/var.directive"; @Component({ selector: 'ds-community-page-sub-collection-list', styleUrls: ['./community-page-sub-collection-list.component.scss'], templateUrl: './community-page-sub-collection-list.component.html', - animations:[fadeIn] + animations: [fadeIn], + imports: [ + ObjectCollectionComponent, + ErrorComponent, + ThemedLoadingComponent, + NgIf, + TranslateModule, + AsyncPipe, + VarDirective + ], + standalone: true }) export class CommunityPageSubCollectionListComponent implements OnInit, OnDestroy { @Input() community: Community; diff --git a/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts b/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts index f1f49f204c2..cc4f208d938 100644 --- a/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts +++ b/src/app/community-page/sub-collection-list/themed-community-page-sub-collection-list.component.ts @@ -4,9 +4,10 @@ import { Component, Input } from '@angular/core'; import { Community } from '../../core/shared/community.model'; @Component({ - selector: 'ds-themed-community-page-sub-collection-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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/sub-community-list/community-page-sub-community-list.component.spec.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts index 0a14fe6dd14..a5a8feda599 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.spec.ts @@ -148,15 +148,15 @@ describe('CommunityPageSubCommunityListComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([]), NgbModule, - NoopAnimationsModule - ], - declarations: [CommunityPageSubCommunityListComponent], - providers: [ + NoopAnimationsModule, + CommunityPageSubCommunityListComponent + ], + providers: [ { provide: CommunityDataService, useValue: communityDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -166,9 +166,9 @@ describe('CommunityPageSubCommunityListComponent Component', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts index 5a0409a0519..8bd288debf4 100644 --- a/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts +++ b/src/app/community-page/sub-community-list/community-page-sub-community-list.component.ts @@ -13,12 +13,28 @@ 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 { ErrorComponent } from '../../shared/error/error.component'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { VarDirective } from '../../shared/utils/var.directive'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-community-page-sub-community-list', styleUrls: ['./community-page-sub-community-list.component.scss'], templateUrl: './community-page-sub-community-list.component.html', - animations: [fadeIn] + animations: [fadeIn], + imports: [ + ErrorComponent, + ThemedLoadingComponent, + VarDirective, + NgIf, + ObjectCollectionComponent, + AsyncPipe, + TranslateModule + ], + standalone: true }) /** * Component to render the sub-communities of a Community diff --git a/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts b/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts index 852c53186ef..4521ac3ce79 100644 --- a/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts +++ b/src/app/community-page/sub-community-list/themed-community-page-sub-community-list.component.ts @@ -4,9 +4,10 @@ import { Component, Input } from '@angular/core'; import { Community } from '../../core/shared/community.model'; @Component({ - selector: 'ds-themed-community-page-sub-community-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 eeb058fb047..8a4aa4094b6 100644 --- a/src/app/community-page/themed-community-page.component.ts +++ b/src/app/community-page/themed-community-page.component.ts @@ -6,9 +6,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', + 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.service.spec.ts b/src/app/core/auth/auth.service.spec.ts index b38d17aecdb..874a62cac3e 100644 --- a/src/app/core/auth/auth.service.spec.ts +++ b/src/app/core/auth/auth.service.spec.ts @@ -112,32 +112,31 @@ describe('AuthService test', () => { beforeEach(() => { init(); TestBed.configureTestingModule({ - imports: [ - CommonModule, - StoreModule.forRoot({ authReducer }, { + imports: [ + CommonModule, + StoreModule.forRoot({ authReducer }, { runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false + strictStateImmutability: false, + strictActionImmutability: false } - }), - ], - declarations: [], - 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/eperson/eperson-data.service.spec.ts b/src/app/core/eperson/eperson-data.service.spec.ts index b4b939eebf4..65fb52e0763 100644 --- a/src/app/core/eperson/eperson-data.service.spec.ts +++ b/src/app/core/eperson/eperson-data.service.spec.ts @@ -64,20 +64,19 @@ describe('EPersonDataService', () => { halService = new HALEndpointServiceStub(restEndpointURL); TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, StoreModule.forRoot({}), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [], - providers: [], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + providers: [], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); } beforeEach(() => { diff --git a/src/app/core/eperson/group-data.service.spec.ts b/src/app/core/eperson/group-data.service.spec.ts index b424aed1aa0..2b15222eafa 100644 --- a/src/app/core/eperson/group-data.service.spec.ts +++ b/src/app/core/eperson/group-data.service.spec.ts @@ -51,20 +51,19 @@ describe('GroupDataService', () => { halService = new HALEndpointServiceStub(restEndpointURL); objectCache = getMockObjectCacheService(); TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, StoreModule.forRoot({}), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [], - providers: [], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + providers: [], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); } function initTestService() { diff --git a/src/app/core/google-recaptcha/google-recaptcha.module.ts b/src/app/core/google-recaptcha/google-recaptcha.module.ts index 64620a48f4d..7cb9cacc363 100644 --- a/src/app/core/google-recaptcha/google-recaptcha.module.ts +++ b/src/app/core/google-recaptcha/google-recaptcha.module.ts @@ -13,10 +13,9 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [ CommonModule ], - providers: [...PROVIDERS], - declarations: [...COMPONENTS], - exports: [...COMPONENTS] + imports: [CommonModule, ...COMPONENTS], + providers: [...PROVIDERS], + exports: [...COMPONENTS] }) /** diff --git a/src/app/core/registry/registry.service.spec.ts b/src/app/core/registry/registry.service.spec.ts index e9dfbe7e2c3..0ea5eebb0b1 100644 --- a/src/app/core/registry/registry.service.spec.ts +++ b/src/app/core/registry/registry.service.spec.ts @@ -31,7 +31,11 @@ import { RemoteData } from '../data/remote-data'; import { NoContent } from '../shared/NoContent.model'; import { FindListOptions } from '../data/find-list-options.model'; -@Component({ template: '' }) +@Component({ + template: '', + standalone: true, + imports: [CommonModule] +}) class DummyComponent { } @@ -144,18 +148,15 @@ describe('RegistryService', () => { beforeEach(() => { init(); TestBed.configureTestingModule({ - imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot()], - declarations: [ - DummyComponent - ], - providers: [ + imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot(), DummyComponent], + 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/shared/search/search.service.spec.ts b/src/app/core/shared/search/search.service.spec.ts index fe5b495ab0c..a0681476b74 100644 --- a/src/app/core/shared/search/search.service.spec.ts +++ b/src/app/core/shared/search/search.service.spec.ts @@ -29,7 +29,11 @@ import { Angulartics2 } from 'angulartics2'; import { SearchFilterConfig } from '../../../shared/search/models/search-filter-config.model'; import anything = jasmine.anything; -@Component({ template: '' }) +@Component({ + template: '', + standalone: true, + imports: [CommonModule] +}) class DummyComponent { } @@ -41,29 +45,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' }, - ]) - ], - declarations: [ - 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); }); @@ -110,29 +112,27 @@ describe('SearchService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - RouterTestingModule.withRoutes([ + imports: [ + CommonModule, + RouterTestingModule.withRoutes([ { path: 'search', component: DummyComponent, pathMatch: 'full' }, - ]) - ], - declarations: [ - 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/curation-form/curation-form.component.spec.ts b/src/app/curation-form/curation-form.component.spec.ts index dc70b925e83..7f7defe35c6 100644 --- a/src/app/curation-form/curation-form.component.spec.ts +++ b/src/app/curation-form/curation-form.component.spec.ts @@ -61,18 +61,17 @@ describe('CurationFormComponent', () => { router = new RouterStub(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), FormsModule, ReactiveFormsModule], - declarations: [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: Router, useValue: router }, { provide: ConfigurationDataService, useValue: configurationDataService }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/curation-form/curation-form.component.ts b/src/app/curation-form/curation-form.component.ts index 2c0e900a662..dd6c804917d 100644 --- a/src/app/curation-form/curation-form.component.ts +++ b/src/app/curation-form/curation-form.component.ts @@ -1,10 +1,10 @@ import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; import { ScriptDataService } from '../core/data/processes/script-data.service'; -import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { getFirstCompletedRemoteData } from '../core/shared/operators'; import { find, map } from 'rxjs/operators'; import { NotificationsService } from '../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { hasValue, isEmpty, isNotEmpty } from '../shared/empty.util'; import { RemoteData } from '../core/data/remote-data'; import { Router } from '@angular/router'; @@ -15,14 +15,17 @@ import { ConfigurationProperty } from '../core/shared/configuration-property.mod import { Observable } from 'rxjs'; import { getProcessDetailRoute } from '../process-page/process-page-routing.paths'; import { HandleService } from '../shared/handle.service'; +import { NgFor, NgIf } from '@angular/common'; 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' + selector: 'ds-curation-form', + templateUrl: './curation-form.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgFor, NgIf, TranslateModule] }) export class CurationFormComponent implements 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 3ca0dba3b64..d28e92dcda6 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 @@ -54,12 +54,10 @@ describe('DsoEditMetadataFieldValuesComponent', () => { draggingMdField$ = new BehaviorSubject(null); TestBed.configureTestingModule({ - declarations: [DsoEditMetadataFieldValuesComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataFieldValuesComponent, VarDirective], + providers: [], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 2702e0ba1f8..b6093c3d171 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 @@ -3,12 +3,17 @@ import { DsoEditMetadataChangeType, DsoEditMetadataForm, DsoEditMetadataValue } import { Observable } from 'rxjs/internal/Observable'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; -import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +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'; @Component({ - selector: 'ds-dso-edit-metadata-field-values', - styleUrls: ['./dso-edit-metadata-field-values.component.scss'], - templateUrl: './dso-edit-metadata-field-values.component.html', + 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 a0a1da1f1e9..c6a215cbd3e 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 @@ -12,12 +12,10 @@ describe('DsoEditMetadataHeadersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [DsoEditMetadataHeadersComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - 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 9c21c8ac9ea..bc34ebdde60 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 @@ -1,9 +1,12 @@ import { Component, Input } from '@angular/core'; +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', + 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 dfda2a50d1e..572426e437a 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 @@ -1,9 +1,12 @@ import { Component, Input } from '@angular/core'; +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', + 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 67a6f98ac06..64721c1ec50 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 @@ -49,14 +49,13 @@ describe('DsoEditMetadataValueComponent', () => { initServices(); TestBed.configureTestingModule({ - declarations: [DsoEditMetadataValueComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataValueComponent, VarDirective], + providers: [ { provide: RelationshipDataService, useValue: relationshipService }, { provide: DSONameService, useValue: dsoNameService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 3fdcd381abc..f740493e1fa 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 @@ -12,11 +12,22 @@ import { map } from 'rxjs/operators'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { EMPTY } from 'rxjs/internal/observable/empty'; +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'; @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', + 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] }) /** * 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 7067c44fbb4..c8463701a15 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 @@ -71,16 +71,15 @@ describe('DsoEditMetadataComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['error', 'success']); TestBed.configureTestingModule({ - declarations: [DsoEditMetadataComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsoEditMetadataComponent, VarDirective], + providers: [ TestDataService, { provide: DATA_SERVICE_FACTORY, useValue: jasmine.createSpy('getDataServiceFor').and.returnValue(TestDataService) }, { provide: NotificationsService, useValue: notificationsService }, ArrayMoveChangeAnalyzer, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 d44817be842..d51f87b42fe 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 @@ -15,18 +15,27 @@ import { import { UpdateDataService } from '../../core/data/update-data.service'; import { ResourceType } from '../../core/shared/resource-type'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { MetadataFieldSelectorComponent } from './metadata-field-selector/metadata-field-selector.component'; import { Observable } from 'rxjs/internal/Observable'; import { ArrayMoveChangeAnalyzer } from '../../core/data/array-move-change-analyzer.service'; import { DATA_SERVICE_FACTORY } from '../../core/data/base/data-service.decorator'; import { GenericConstructor } from '../../core/shared/generic-constructor'; 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'; @Component({ - selector: 'ds-dso-edit-metadata', - styleUrls: ['./dso-edit-metadata.component.scss'], - templateUrl: './dso-edit-metadata.component.html', + 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 de8736df94d..678bf5d7f6c 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 @@ -51,14 +51,13 @@ describe('MetadataFieldSelectorComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['error', 'success']); TestBed.configureTestingModule({ - declarations: [MetadataFieldSelectorComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), MetadataFieldSelectorComponent, VarDirective], + providers: [ { provide: RegistryService, useValue: registryService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 fc0d57046d0..956866733a6 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 @@ -18,19 +18,23 @@ import { } from '../../../core/shared/operators'; import { Observable } from 'rxjs/internal/Observable'; import { RegistryService } from '../../../core/registry/registry.service'; -import { UntypedFormControl } from '@angular/forms'; +import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; import { hasValue } from '../../../shared/empty.util'; import { Subscription } from 'rxjs/internal/Subscription'; import { of } from 'rxjs/internal/observable/of'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SortDirection, SortOptions } from '../../../core/cache/models/sort-options.model'; +import { ClickOutsideDirective } from '../../../shared/utils/click-outside.directive'; +import { NgClass, NgIf, NgFor, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-metadata-field-selector', - styleUrls: ['./metadata-field-selector.component.scss'], - templateUrl: './metadata-field-selector.component.html' + 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 ba21907c99e..e31ada791c1 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 @@ -5,9 +5,10 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { UpdateDataService } from '../../core/data/update-data.service'; @Component({ - selector: 'ds-themed-dso-edit-metadata', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html', + 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/dso-shared/dso-shared.module.ts b/src/app/dso-shared/dso-shared.module.ts index 7d44d6a9206..e5fc3ce1497 100644 --- a/src/app/dso-shared/dso-shared.module.ts +++ b/src/app/dso-shared/dso-shared.module.ts @@ -9,27 +9,25 @@ import { DsoEditMetadataValueHeadersComponent } from './dso-edit-metadata/dso-ed import { ThemedDsoEditMetadataComponent } from './dso-edit-metadata/themed-dso-edit-metadata.component'; @NgModule({ - imports: [ - SharedModule, - ], - declarations: [ - DsoEditMetadataComponent, - ThemedDsoEditMetadataComponent, - MetadataFieldSelectorComponent, - DsoEditMetadataFieldValuesComponent, - DsoEditMetadataValueComponent, - DsoEditMetadataHeadersComponent, - DsoEditMetadataValueHeadersComponent, - ], - exports: [ - DsoEditMetadataComponent, - ThemedDsoEditMetadataComponent, - MetadataFieldSelectorComponent, - DsoEditMetadataFieldValuesComponent, - DsoEditMetadataValueComponent, - DsoEditMetadataHeadersComponent, - DsoEditMetadataValueHeadersComponent, - ], + imports: [ + SharedModule, + DsoEditMetadataComponent, + ThemedDsoEditMetadataComponent, + MetadataFieldSelectorComponent, + DsoEditMetadataFieldValuesComponent, + DsoEditMetadataValueComponent, + DsoEditMetadataHeadersComponent, + DsoEditMetadataValueHeadersComponent + ], + exports: [ + DsoEditMetadataComponent, + ThemedDsoEditMetadataComponent, + MetadataFieldSelectorComponent, + DsoEditMetadataFieldValuesComponent, + DsoEditMetadataValueComponent, + DsoEditMetadataHeadersComponent, + DsoEditMetadataValueHeadersComponent, + ] }) export class DsoSharedModule { 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 6c556167609..edad6ff19b8 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 @@ -47,14 +47,13 @@ describe('JournalIssueGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [JournalIssueGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, JournalIssueGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalIssueGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalIssueGridElementComponent, { set: { 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 3e577316135..e17313ef7c7 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 14f63d57814..c1b1576beb6 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 @@ -47,14 +47,13 @@ describe('JournalVolumeGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [JournalVolumeGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, JournalVolumeGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalVolumeGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 eb88c25a129..19963fc490d 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 e4a23754419..f75f3265da9 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 @@ -53,14 +53,13 @@ describe('JournalGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [JournalGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, JournalGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalGridElementComponent, { set: { 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 1d7c1e5b732..8c9ccc6a97d 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 a2a6c91d2d5..cd0458af1b1 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 @@ -3,13 +3,22 @@ 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 17c8575a0e9..bb41d10cebd 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 @@ -3,13 +3,22 @@ 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 4fa554ff3b1..c5683751ef8 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 @@ -3,13 +3,22 @@ import { focusShadow } from '../../../../../shared/animations/focus'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 59af3b9e7ba..339430a2049 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 @@ -43,13 +43,13 @@ describe('JournalIssueListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalIssueListElementComponent, TruncatePipe], - providers: [ + imports: [JournalIssueListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalIssueListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 454c1400504..1ffe5d32c66 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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' + 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 663c1e477ef..fd690d8283e 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 @@ -43,13 +43,13 @@ describe('JournalVolumeListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalVolumeListElementComponent, TruncatePipe], - providers: [ + imports: [JournalVolumeListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalVolumeListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalVolumeListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).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 5a5bfde49e1..75a77e07cd9 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 @@ -3,12 +3,15 @@ import { AbstractListableElementComponent } from '../../../../shared/object-coll 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'; @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' + 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 e5dd55772bd..87ebb34563c 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 @@ -37,13 +37,13 @@ describe('JournalListElementComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - declarations: [JournalListElementComponent, TruncatePipe], - providers: [ + imports: [JournalListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 fa83c3cff40..7a69dfad59f 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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' + 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 178ed86c40c..4f3d3f8102e 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 @@ -73,15 +73,14 @@ const enviromentNoThumbs = { describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [JournalIssueSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalIssueSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalIssueSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -161,15 +160,14 @@ describe('JournalIssueSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalIssueSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [JournalIssueSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - 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 d804006eb13..03122ebca6b 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 @@ -2,12 +2,20 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; @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' + 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 71fa83a3b1e..087977a5653 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 @@ -72,15 +72,14 @@ const enviromentNoThumbs = { describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [JournalVolumeSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalVolumeSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalVolumeSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -159,15 +158,14 @@ describe('JournalVolumeSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalVolumeSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [JournalVolumeSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalVolumeSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalVolumeSearchResultListElementComponent, { set: {changeDetection: ChangeDetectionStrategy.Default} }).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 2a01d20668c..c6eb23d8185 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 @@ -2,12 +2,20 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; @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' + 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 07970d71282..9af76539fb2 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 @@ -68,15 +68,14 @@ const enviromentNoThumbs = { describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [JournalSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -131,15 +130,14 @@ describe('JournalSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [JournalSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [JournalSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - 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 38150d1a6a3..c0bf12fd4d5 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 @@ -2,12 +2,20 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; @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' + 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 84764e9e600..d64b65a4464 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 @@ -6,12 +6,17 @@ import { Component } from '@angular/core'; import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { Item } from '../../../../../core/shared/item.model'; import { isNotEmpty } from '../../../../../shared/empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 7af5487f402..fc3e6caba9d 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 @@ -6,12 +6,17 @@ import { Component } from '@angular/core'; import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { Item } from '../../../../../core/shared/item.model'; import { isNotEmpty } from '../../../../../shared/empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 4a26b293d9b..250ca4accc7 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 @@ -6,12 +6,17 @@ import { Component } from '@angular/core'; import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { Item } from '../../../../../core/shared/item.model'; import { isNotEmpty } from '../../../../../shared/empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 b749edd7324..bdb945c42f8 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 @@ -2,12 +2,24 @@ 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('JournalIssue', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal-issue', - styleUrls: ['./journal-issue.component.scss'], - templateUrl: './journal-issue.component.html' + 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 89ee4ad1d2f..7a7e1993b5f 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 @@ -2,12 +2,24 @@ 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('JournalVolume', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal-volume', - styleUrls: ['./journal-volume.component.scss'], - templateUrl: './journal-volume.component.html' + 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 6e2ded334b0..d60d4a29864 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 @@ -75,17 +75,17 @@ describe('JournalComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), RouterTestingModule, - ], - declarations: [JournalComponent, GenericItemPageFieldComponent, TruncatePipe], - providers: [ + JournalComponent, GenericItemPageFieldComponent, TruncatePipe + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: {} }, @@ -106,10 +106,9 @@ describe('JournalComponent', () => { { provide: SearchService, useValue: {} }, { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(JournalComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(JournalComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).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 4fc03b31c79..c7459c355ed 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 @@ -2,12 +2,25 @@ 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 { 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('Journal', ViewMode.StandalonePage) @Component({ - selector: 'ds-journal', - styleUrls: ['./journal.component.scss'], - templateUrl: './journal.component.html' + 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/journal-entities/journal-entities.module.ts b/src/app/entity-groups/journal-entities/journal-entities.module.ts index 338bbe0cd66..77392fd1db9 100644 --- a/src/app/entity-groups/journal-entities/journal-entities.module.ts +++ b/src/app/entity-groups/journal-entities/journal-entities.module.ts @@ -46,16 +46,14 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - ItemSharedModule, - SharedModule, - ResultsBackButtonModule, - DsoPageModule - ], - declarations: [ - ...ENTRY_COMPONENTS - ] + imports: [ + CommonModule, + ItemSharedModule, + SharedModule, + ResultsBackButtonModule, + DsoPageModule, + ...ENTRY_COMPONENTS + ] }) export class JournalEntitiesModule { /** 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 097e973201f..ad6b047dbec 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 @@ -53,14 +53,13 @@ describe('OrgUnitGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [OrgUnitGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, OrgUnitGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrgUnitGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 05a7f6c8c5d..9df2acd4052 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 ca0784e9972..5f55cef6f90 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 @@ -47,14 +47,13 @@ describe('PersonGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [PersonGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, PersonGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonGridElementComponent, { set: { 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 2e3ce5804ea..e237579d0f7 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 3f92bfe4107..7909f3d6aed 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 @@ -41,14 +41,13 @@ describe('ProjectGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ProjectGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, ProjectGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ProjectGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 58547960cff..090e61c4e7e 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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', + 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 872b4b27e38..b4b76bf49e7 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 @@ -3,13 +3,22 @@ import { listableObjectComponent } from '../../../../../shared/object-collection import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 851d9007554..35e9322cba9 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 @@ -3,13 +3,22 @@ import { listableObjectComponent } from '../../../../../shared/object-collection import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 6dfbe93e3e1..bb2f7daf4a3 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 @@ -3,13 +3,22 @@ import { listableObjectComponent } from '../../../../../shared/object-collection import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { NgIf, AsyncPipe } from '@angular/common'; +import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.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] + 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 275accc9561..6d04ebb07b0 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 @@ -37,13 +37,13 @@ describe('OrgUnitListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [OrgUnitListElementComponent, TruncatePipe], - providers: [ + imports: [OrgUnitListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrgUnitListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 32254595aad..50a821b7d4a 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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' + 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 dc874b8ec84..9c06c68c2a2 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 @@ -37,13 +37,13 @@ describe('PersonListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [PersonListElementComponent, TruncatePipe], - providers: [ + imports: [PersonListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 f35ed90c58a..516c08d5640 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 @@ -3,12 +3,15 @@ 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 { Item } from '../../../../core/shared/item.model'; +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' + 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 02241e3060f..7fea008e08b 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 @@ -37,13 +37,13 @@ describe('ProjectListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ProjectListElementComponent, TruncatePipe], - providers: [ + imports: [ProjectListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ProjectListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 5f158158d89..b7190b2e007 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 @@ -3,12 +3,15 @@ import { AbstractListableElementComponent } from '../../../../shared/object-coll 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'; @listableObjectComponent('Project', ViewMode.ListElement) @Component({ - selector: 'ds-project-list-element', - styleUrls: ['./project-list-element.component.scss'], - templateUrl: './project-list-element.component.html' + 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 9609a9582aa..ad626118cc1 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 @@ -68,22 +68,19 @@ const enviromentNoThumbs = { describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - } - )], - declarations: [ OrgUnitSearchResultListElementComponent , TruncatePipe], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), OrgUnitSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [ NO_ERRORS_SCHEMA ] - }).overrideComponent(OrgUnitSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(OrgUnitSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -138,22 +135,19 @@ describe('OrgUnitSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - } - )], - declarations: [OrgUnitSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), OrgUnitSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrgUnitSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(OrgUnitSearchResultListElementComponent, { set: {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 a9edb530cbc..3582158b8c9 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 @@ -2,12 +2,21 @@ 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 { 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 { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; +import { RouterLink } from '@angular/router'; +import { NgIf, NgClass, AsyncPipe } 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' + 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 31018520f62..53548b07fde 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 @@ -68,22 +68,19 @@ const enviromentNoThumbs = { describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - } - )], - declarations: [PersonSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), PersonSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -138,22 +135,19 @@ describe('PersonSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - } - )], - declarations: [PersonSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), PersonSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonSearchResultListElementComponent, { set: {changeDetection: ChangeDetectionStrategy.Default} }).compileComponents(); })); 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 41e9e14b1a4..cb981ebf548 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 @@ -9,12 +9,21 @@ import { import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; +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 { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; +import { RouterLink } from '@angular/router'; +import { NgIf, NgClass, NgFor, AsyncPipe } 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' + 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 0cb3e63e870..0214a6f8430 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 @@ -67,15 +67,14 @@ const enviromentNoThumbs = { describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ProjectSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [ProjectSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ProjectSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ProjectSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -130,16 +129,14 @@ describe('ProjectSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ProjectSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [ProjectSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - - ], - - 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 aaf98a8091f..a9f6914584e 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 @@ -2,12 +2,19 @@ import { Component } from '@angular/core'; import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../../../core/shared/view-mode.model'; 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 { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; +import { RouterLink } from '@angular/router'; +import { NgIf, NgClass, AsyncPipe } 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' + 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 25ff6181b2d..c00c1d64704 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 @@ -5,12 +5,17 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared import { Component } from '@angular/core'; import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { Item } from '../../../../../core/shared/item.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 edae6c9ec9b..124b7b62258 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 @@ -8,14 +8,18 @@ import { Item } from '../../../../../core/shared/item.model'; import { isNotEmpty } from '../../../../../shared/empty.util'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { LinkService } from '../../../../../core/cache/builders/link.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 6fbb9d26fc0..22c24ff9b27 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 @@ -5,12 +5,17 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared import { Component } from '@angular/core'; import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component'; import { Item } from '../../../../../core/shared/item.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +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' + 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 03a91c34b55..23b1c59d135 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 @@ -2,12 +2,25 @@ 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 { 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('OrgUnit', ViewMode.StandalonePage) @Component({ - selector: 'ds-org-unit', - styleUrls: ['./org-unit.component.scss'], - templateUrl: './org-unit.component.html' + 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] }) /** * 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 e5e2a523389..e5671af1687 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 @@ -2,12 +2,25 @@ 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 { 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('Person', ViewMode.StandalonePage) @Component({ - selector: 'ds-person', - styleUrls: ['./person.component.scss'], - templateUrl: './person.component.html' + 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 b573ffc58ed..46bde0d720e 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 @@ -2,12 +2,25 @@ 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 { 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 { 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 { NgIf, AsyncPipe } from '@angular/common'; @listableObjectComponent('Project', ViewMode.StandalonePage) @Component({ - selector: 'ds-project', - styleUrls: ['./project.component.scss'], - templateUrl: './project.component.html' + 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 429f2986b94..ad530fdb054 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 @@ -21,12 +21,12 @@ describe('OrgUnitItemMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports:[ - NgbModule - ], - declarations: [OrgUnitItemMetadataListElementComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrgUnitItemMetadataListElementComponent, { + imports: [ + NgbModule, + OrgUnitItemMetadataListElementComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(OrgUnitItemMetadataListElementComponent, { set: { 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 183bebe10ca..839241742f7 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 @@ -2,11 +2,16 @@ import { Component } from '@angular/core'; import { metadataRepresentationComponent } from '../../../../shared/metadata-representation/metadata-representation.decorator'; import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model'; 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 { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; @metadataRepresentationComponent('OrgUnit', MetadataRepresentationType.Item) @Component({ - selector: 'ds-org-unit-item-metadata-list-element', - templateUrl: './org-unit-item-metadata-list-element.component.html' + 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 b9ebf19b676..340cb77d623 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 @@ -23,12 +23,12 @@ describe('PersonItemMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports:[ - NgbModule - ], - declarations: [PersonItemMetadataListElementComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonItemMetadataListElementComponent, { + imports: [ + NgbModule, + PersonItemMetadataListElementComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonItemMetadataListElementComponent, { set: { 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 f3d0a28fda1..293bfc97546 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 @@ -2,11 +2,17 @@ import { Component } from '@angular/core'; import { metadataRepresentationComponent } from '../../../../shared/metadata-representation/metadata-representation.decorator'; import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model'; 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 { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; +import { NgIf, NgFor } from '@angular/common'; @metadataRepresentationComponent('Person', MetadataRepresentationType.Item) @Component({ - selector: 'ds-person-item-metadata-list-element', - templateUrl: './person-item-metadata-list-element.component.html' + 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 afa565ce406..edbc9d4fe59 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 @@ -23,15 +23,15 @@ describe('ProjectItemMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports:[ - NgbModule - ], - declarations: [ProjectItemMetadataListElementComponent], - providers: [ + imports: [ + NgbModule, + ProjectItemMetadataListElementComponent + ], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ProjectItemMetadataListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ProjectItemMetadataListElementComponent, { set: { 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 a38a1f5cffd..fd3b9dd217d 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 @@ -3,11 +3,16 @@ import { metadataRepresentationComponent } from '../../../../shared/metadata-rep import { MetadataRepresentationType } from '../../../../core/shared/metadata-representation/metadata-representation.model'; 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 { TruncatableComponent } from '../../../../shared/truncatable/truncatable.component'; @metadataRepresentationComponent('Project', MetadataRepresentationType.Item) @Component({ - selector: 'ds-project-item-metadata-list-element', - templateUrl: './project-item-metadata-list-element.component.html' + 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/research-entities.module.ts b/src/app/entity-groups/research-entities/research-entities.module.ts index 95b183f6303..0f8c6d0667b 100644 --- a/src/app/entity-groups/research-entities/research-entities.module.ts +++ b/src/app/entity-groups/research-entities/research-entities.module.ts @@ -69,17 +69,15 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - ItemSharedModule, - SharedModule, - NgbTooltipModule, - ResultsBackButtonModule, - DsoPageModule, - ], - declarations: [ - ...COMPONENTS, - ] + imports: [ + CommonModule, + ItemSharedModule, + SharedModule, + NgbTooltipModule, + ResultsBackButtonModule, + DsoPageModule, + ...COMPONENTS + ] }) export class ResearchEntitiesModule { /** 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 a5d56c15542..50e9b493464 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 @@ -24,10 +24,9 @@ describe('ExternalSourceEntryListSubmissionElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ExternalSourceEntryListSubmissionElementComponent], - imports: [TranslateModule.forRoot()], - 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 7dee15ca05b..25321378bc2 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 @@ -6,13 +6,16 @@ import { Context } from '../../../../../core/shared/context.model'; import { Component, OnInit } from '@angular/core'; import { Metadata } from '../../../../../core/shared/metadata.utils'; import { MetadataValue } from '../../../../../core/shared/metadata.models'; +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' + 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 45f5c5f41c6..50140776249 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 @@ -100,8 +100,8 @@ describe('OrgUnitSearchResultListSubmissionElementComponent', () => { } }; TestBed.configureTestingModule({ - declarations: [OrgUnitSearchResultListSubmissionElementComponent, TruncatePipe], - providers: [ + imports: [OrgUnitSearchResultListSubmissionElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: NotificationsService, useValue: {} }, @@ -121,10 +121,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, { set: { 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 ef58007baee..3bace20fb39 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 @@ -18,13 +18,18 @@ import { SelectableListService } from '../../../../../shared/object-list/selecta import { NameVariantModalComponent } from '../../name-variant-modal/name-variant-modal.component'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; +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' + 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 0981d895ec6..8d3ced16445 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 @@ -18,14 +18,13 @@ describe('OrgUnitInputSuggestionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [OrgUnitInputSuggestionsComponent], - imports: [ + imports: [ FormsModule, - ], - providers: [ - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrgUnitInputSuggestionsComponent, { + 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 a7fe2a99dda..5aa93d32260 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,20 +1,25 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; +import { NgClass, NgFor, AsyncPipe } from '@angular/common'; +import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; +import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.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 - } - ] + 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] }) /** 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 9e4d3471506..e5d66e7b53d 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 @@ -103,8 +103,8 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], - providers: [ + imports: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: NotificationsService, useValue: {} }, @@ -112,7 +112,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: NgbModal, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: SelectableListService, useValue: {} }, - { provide: Store, useValue: {}}, + { provide: Store, useValue: {} }, { provide: ObjectCacheService, useValue: {} }, { provide: UUIDService, useValue: {} }, { provide: RemoteDataBuildService, useValue: {} }, @@ -123,10 +123,9 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonSearchResultListSubmissionElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonSearchResultListSubmissionElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -183,8 +182,8 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], - providers: [ + imports: [PersonSearchResultListSubmissionElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: mockRelationshipService }, { provide: NotificationsService, useValue: {} }, @@ -192,7 +191,7 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: NgbModal, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: SelectableListService, useValue: {} }, - { provide: Store, useValue: {}}, + { provide: Store, useValue: {} }, { provide: ObjectCacheService, useValue: {} }, { provide: UUIDService, useValue: {} }, { provide: RemoteDataBuildService, useValue: {} }, @@ -203,10 +202,9 @@ describe('PersonSearchResultListElementSubmissionComponent', () => { { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PersonSearchResultListSubmissionElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PersonSearchResultListSubmissionElementComponent, { set: { 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 c9826e440be..d687d548afe 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 @@ -18,12 +18,18 @@ import { ItemDataService } from '../../../../../core/data/item-data.service'; import { SelectableListService } from '../../../../../shared/object-list/selectable-list/selectable-list.service'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface'; +import { FormsModule } from '@angular/forms'; +import { PersonInputSuggestionsComponent } from './person-suggestions/person-input-suggestions.component'; +import { ThumbnailComponent } from '../../../../../thumbnail/thumbnail.component'; +import { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; @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' + 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 5109a199635..4b5afe07ef7 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,20 +1,25 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; import { InputSuggestionsComponent } from '../../../../../../shared/input-suggestions/input-suggestions.component'; +import { NgClass, NgFor, AsyncPipe } from '@angular/common'; +import { DebounceDirective } from '../../../../../../shared/utils/debounce.directive'; +import { ClickOutsideDirective } from '../../../../../../shared/utils/click-outside.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 - } - ] + 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] }) /** 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 4a28c203fce..90282578566 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 @@ -17,10 +17,9 @@ describe('NameVariantModalComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [NameVariantModalComponent], - imports: [NgbModule, TranslateModule.forRoot()], - 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 eb6f7d01ac5..e92c47c242e 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 @@ -1,14 +1,17 @@ import { Component, Input } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; /** * This component a pop up for when the user selects a custom name variant during submission for a relationship$ * 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'] + 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 9f0250edc47..ebf63a71144 100644 --- a/src/app/footer/footer.component.spec.ts +++ b/src/app/footer/footer.component.spec.ts @@ -28,19 +28,18 @@ describe('Footer component', () => { // waitForAsync beforeEach beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [FooterComponent], // declare the test component - providers: [ + imports: [CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), FooterComponent], + providers: [ FooterComponent, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); // synchronous beforeEach diff --git a/src/app/footer/footer.component.ts b/src/app/footer/footer.component.ts index f5e4c3799a1..efd81faaebd 100644 --- a/src/app/footer/footer.component.ts +++ b/src/app/footer/footer.component.ts @@ -5,11 +5,16 @@ import { environment } from '../../environments/environment'; import { Observable } from 'rxjs'; 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'; @Component({ - selector: 'ds-footer', - styleUrls: ['footer.component.scss'], - templateUrl: 'footer.component.html' + 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 e8f64f3434b..d3c74e74c45 100644 --- a/src/app/footer/themed-footer.component.ts +++ b/src/app/footer/themed-footer.component.ts @@ -6,9 +6,10 @@ import { FooterComponent } from './footer.component'; * Themed wrapper for FooterComponent */ @Component({ - selector: 'ds-themed-footer', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 b622a0f066e..5f46fa9198c 100644 --- a/src/app/forbidden/forbidden.component.ts +++ b/src/app/forbidden/forbidden.component.ts @@ -1,14 +1,18 @@ import { Component, OnInit } from '@angular/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'] + 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 830529c8fa0..5bd24f3434e 100644 --- a/src/app/forbidden/themed-forbidden.component.ts +++ b/src/app/forbidden/themed-forbidden.component.ts @@ -6,9 +6,10 @@ import { ForbiddenComponent } from './forbidden.component'; * Themed wrapper for ForbiddenComponent */ @Component({ - selector: 'ds-themed-forbidden', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 6ce13c31d3e..97b43ccbaa8 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 @@ -11,10 +11,9 @@ describe('ForgotEmailComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule], - declarations: [ForgotEmailComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, ForgotEmailComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(ForgotEmailComponent); 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 66a61ed7ee0..758b4d9d23a 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,10 +1,17 @@ import { Component } from '@angular/core'; -import { TYPE_REQUEST_FORGOT } from '../../register-email-form/register-email-form.component'; +import { + RegisterEmailFormComponent, + TYPE_REQUEST_FORGOT +} from '../../register-email-form/register-email-form.component'; @Component({ selector: 'ds-forgot-email', styleUrls: ['./forgot-email.component.scss'], - templateUrl: './forgot-email.component.html' + templateUrl: './forgot-email.component.html', + imports: [ + RegisterEmailFormComponent + ], + 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 da3848db1d6..2727bd1e3e2 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 @@ -6,9 +6,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' + 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 92d72d83df6..9b8276c6025 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 @@ -53,18 +53,17 @@ describe('ForgotPasswordFormComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule], - declarations: [ForgotPasswordFormComponent], - 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(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, ForgotPasswordFormComponent], + 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(); })); 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 e20683e6e3c..6174fcae7fa 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,6 +1,6 @@ import { Component } from '@angular/core'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { Observable } from 'rxjs'; import { Registration } from '../../core/shared/registration.model'; @@ -12,11 +12,22 @@ import { RemoteData } from '../../core/data/remote-data'; import { EPerson } from '../../core/eperson/models/eperson.model'; 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, NgIf } from '@angular/common'; @Component({ selector: 'ds-forgot-password-form', styleUrls: ['./forgot-password-form.component.scss'], - templateUrl: './forgot-password-form.component.html' + templateUrl: './forgot-password-form.component.html', + imports: [ + TranslateModule, + ProfilePageSecurityFormComponent, + AsyncPipe, + NgIf + ], + 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 3fb1b67e011..24e8abfde70 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 @@ -6,9 +6,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' + 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.module.ts b/src/app/forgot-password/forgot-password.module.ts index 593149d2a5e..23e03619adf 100644 --- a/src/app/forgot-password/forgot-password.module.ts +++ b/src/app/forgot-password/forgot-password.module.ts @@ -10,20 +10,18 @@ import { ThemedForgotPasswordFormComponent } from './forgot-password-form/themed import { ThemedForgotEmailComponent } from './forgot-password-email/themed-forgot-email.component'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - ForgotPasswordRoutingModule, - RegisterEmailFormModule, - ProfilePageModule, - ], - declarations: [ - ForgotEmailComponent, - ThemedForgotEmailComponent, - ForgotPasswordFormComponent, - ThemedForgotPasswordFormComponent, - ], - providers: [] + imports: [ + CommonModule, + SharedModule, + ForgotPasswordRoutingModule, + RegisterEmailFormModule, + ProfilePageModule, + ForgotEmailComponent, + ThemedForgotEmailComponent, + ForgotPasswordFormComponent, + ThemedForgotPasswordFormComponent + ], + providers: [] }) /** 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 a610b2cb026..3ca19e75685 100644 --- a/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts +++ b/src/app/header-nav-wrapper/header-navbar-wrapper.component.ts @@ -5,14 +5,19 @@ import { hasValue } from '../shared/empty.util'; import { Observable, Subscription } from 'rxjs'; 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 { NgClass, AsyncPipe } 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', + 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, OnDestroy { @HostBinding('class.open') isOpen = false; 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 02d09c44ef4..aa324a7147a 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 @@ -6,9 +6,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', + 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 2d1b5bad203..5e79beb1bdf 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 @@ -17,12 +17,11 @@ describe('ContextHelpToggleComponent', () => { ]); contextHelpService.tooltipCount$.and.returnValue(observableOf(0)); await TestBed.configureTestingModule({ - declarations: [ ContextHelpToggleComponent ], - providers: [ + providers: [ { provide: ContextHelpService, useValue: contextHelpService }, - ], - imports: [ TranslateModule.forRoot() ] - }) + ], + 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 6685df71063..ee46b888069 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 @@ -2,15 +2,19 @@ import { Component, OnInit } from '@angular/core'; import { ContextHelpService } from '../../shared/context-help.service'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, AsyncPipe } from '@angular/common'; /** * Renders a "context help toggle" button that toggles the visibility of tooltip buttons on the page. * 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'] + 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 9bc952cee35..f8e9933db63 100644 --- a/src/app/header/header.component.spec.ts +++ b/src/app/header/header.component.spec.ts @@ -20,16 +20,17 @@ describe('HeaderComponent', () => { // waitForAsync beforeEach beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, - ReactiveFormsModule], - declarations: [HeaderComponent], - providers: [ + ReactiveFormsModule, + HeaderComponent + ], + providers: [ { provide: MenuService, useValue: menuService } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); // compile template and css })); diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index 366b4f5e7a1..4abcc8bcf06 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -2,14 +2,24 @@ import { Component } from '@angular/core'; import { Observable } from 'rxjs'; 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'; /** * Represents the header with the logo and simple navigation */ @Component({ - selector: 'ds-header', - styleUrls: ['header.component.scss'], - templateUrl: 'header.component.html', + selector: 'ds-header', + styleUrls: ['header.component.scss'], + templateUrl: 'header.component.html', + standalone: true, + imports: [RouterLink, NgbDropdownModule, ThemedSearchNavbarComponent, LangSwitchComponent, ContextHelpToggleComponent, ThemedAuthNavMenuComponent, ImpersonateNavbarComponent, TranslateModule] }) export class HeaderComponent { /** diff --git a/src/app/header/themed-header.component.ts b/src/app/header/themed-header.component.ts index 51c817b63dc..670ffc57556 100644 --- a/src/app/header/themed-header.component.ts +++ b/src/app/header/themed-header.component.ts @@ -6,9 +6,10 @@ import { HeaderComponent } from './header.component'; * Themed wrapper for HeaderComponent */ @Component({ - selector: 'ds-themed-header', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 b4532415b89..cf5bb480795 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 @@ -17,22 +17,20 @@ describe('HealthInfoComponentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbCollapseModule, NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), HealthInfoComponentComponent, ObjNgFor - ] - }) + ] +}) .compileComponents(); }); 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 d2cb393f091..c37e2217da9 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,15 +1,20 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, forwardRef } from '@angular/core'; import { HealthInfoComponent } from '../../models/health-component.model'; import { HealthComponentComponent } from '../../health-panel/health-component/health-component.component'; +import { ObjNgFor } from '../../../shared/utils/object-ngfor.pipe'; +import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgFor, NgIf, TitleCasePipe } from '@angular/common'; /** * Shows a health info object */ @Component({ - selector: 'ds-health-info-component', - templateUrl: './health-info-component.component.html', - styleUrls: ['./health-info-component.component.scss'] + selector: 'ds-health-info-component', + templateUrl: './health-info-component.component.html', + styleUrls: ['./health-info-component.component.scss'], + standalone: true, + imports: [NgFor, NgIf, NgbCollapseModule, forwardRef(() => HealthInfoComponentComponent), 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 5a9b8bf0aa5..7adc2bc96e0 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 @@ -15,21 +15,19 @@ describe('HealthInfoComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), HealthInfoComponent, ObjNgFor - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); }); 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 186d00299cb..818b85e5ce8 100644 --- a/src/app/health-page/health-info/health-info.component.ts +++ b/src/app/health-page/health-info/health-info.component.ts @@ -3,6 +3,11 @@ import { Component, Input, OnInit } from '@angular/core'; 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'; /** * A component to render a "health-info component" object. @@ -12,9 +17,11 @@ import { HealthInfoResponse } from '../models/health-component.model'; * API. */ @Component({ - selector: 'ds-health-info', - templateUrl: './health-info.component.html', - styleUrls: ['./health-info.component.scss'] + 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.component.spec.ts b/src/app/health-page/health-page.component.spec.ts index f3847ab0926..fa48724b6a8 100644 --- a/src/app/health-page/health-page.component.spec.ts +++ b/src/app/health-page/health-page.component.spec.ts @@ -35,21 +35,21 @@ describe('HealthPageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbNavModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ HealthPageComponent ], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + HealthPageComponent + ], + providers: [ { provide: HealthService, useValue: healthService } - ] - }) + ] +}) .compileComponents(); }); diff --git a/src/app/health-page/health-page.component.ts b/src/app/health-page/health-page.component.ts index aa7bd7cba46..50ab79427c8 100644 --- a/src/app/health-page/health-page.component.ts +++ b/src/app/health-page/health-page.component.ts @@ -5,11 +5,19 @@ 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 { HealthInfoComponent } from './health-info/health-info.component'; +import { HealthPanelComponent } from './health-panel/health-panel.component'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-health-page', - templateUrl: './health-page.component.html', - styleUrls: ['./health-page.component.scss'] + 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-page.module.ts b/src/app/health-page/health-page.module.ts index 02a6a91a5f0..5b27a0ab359 100644 --- a/src/app/health-page/health-page.module.ts +++ b/src/app/health-page/health-page.module.ts @@ -15,21 +15,19 @@ import { HealthInfoComponentComponent } from './health-info/health-info-componen @NgModule({ - imports: [ - CommonModule, - HealthPageRoutingModule, - NgbModule, - SharedModule, - TranslateModule - ], - declarations: [ - HealthPageComponent, - HealthPanelComponent, - HealthStatusComponent, - HealthComponentComponent, - HealthInfoComponent, - HealthInfoComponentComponent, - ] + imports: [ + CommonModule, + HealthPageRoutingModule, + NgbModule, + SharedModule, + TranslateModule, + HealthPageComponent, + HealthPanelComponent, + HealthStatusComponent, + HealthComponentComponent, + HealthInfoComponent, + HealthInfoComponentComponent + ] }) export class HealthPageModule { } 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 a8ec2b65e07..f3285d4cf55 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 @@ -18,23 +18,21 @@ describe('HealthComponentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbCollapseModule, NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), HealthComponentComponent, ObjNgFor - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); }); 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 f2391c9c4cf..df970b49a05 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,9 +1,13 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, forwardRef } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { HealthComponent } from '../../models/health-component.model'; 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 { NgIf, NgFor, TitleCasePipe } from '@angular/common'; /** * A component to render a "health component" object. @@ -13,9 +17,11 @@ import { AlertType } from '../../../shared/alert/alert-type'; * API. */ @Component({ - selector: 'ds-health-component', - templateUrl: './health-component.component.html', - styleUrls: ['./health-component.component.scss'] + selector: 'ds-health-component', + templateUrl: './health-component.component.html', + styleUrls: ['./health-component.component.scss'], + standalone: true, + imports: [NgIf, NgFor, NgbCollapseModule, forwardRef(() => HealthComponentComponent), 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 1d9c856ddbb..d3b0a648086 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 @@ -18,24 +18,22 @@ describe('HealthPanelComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbNavModule, NgbAccordionModule, CommonModule, BrowserAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [ HealthPanelComponent, ObjNgFor - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 1c056daf20f..c8f1b140f39 100644 --- a/src/app/health-page/health-panel/health-panel.component.ts +++ b/src/app/health-page/health-panel/health-panel.component.ts @@ -1,16 +1,23 @@ import { Component, Input, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/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 { 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'] + 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 f0f61ebdbbe..54ee8442826 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 @@ -13,17 +13,17 @@ describe('HealthStatusComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbTooltipModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ HealthStatusComponent ] - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + HealthStatusComponent + ] +}) .compileComponents(); }); 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 172baeee71e..341c4983825 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,13 +1,18 @@ import { Component, Input } from '@angular/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'] + 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 62c8e94671a..8d7890de483 100644 --- a/src/app/home-page/home-news/home-news.component.ts +++ b/src/app/home-page/home-news/home-news.component.ts @@ -1,9 +1,10 @@ import { Component, } from '@angular/core'; @Component({ - selector: 'ds-home-news', - styleUrls: ['./home-news.component.scss'], - templateUrl: './home-news.component.html' + 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 da7233f4a43..fcc16a3485f 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 @@ -3,9 +3,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', + selector: 'ds-themed-home-news', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) /** diff --git a/src/app/home-page/home-page.component.ts b/src/app/home-page/home-page.component.ts index c151cbbb164..92f15b9c888 100644 --- a/src/app/home-page/home-page.component.ts +++ b/src/app/home-page/home-page.component.ts @@ -4,10 +4,19 @@ import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { Site } from '../core/shared/site.model'; import { environment } from '../../environments/environment'; +import { TranslateModule } from '@ngx-translate/core'; +import { RecentItemListComponent } from './recent-item-list/recent-item-list.component'; +import { ThemedTopLevelCommunityListComponent } from './top-level-community-list/themed-top-level-community-list.component'; +import { ThemedSearchFormComponent } from '../shared/search-form/themed-search-form.component'; +import { ViewTrackerComponent } from '../statistics/angulartics/dspace/view-tracker.component'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { ThemedHomeNewsComponent } from './home-news/themed-home-news.component'; @Component({ - selector: 'ds-home-page', - styleUrls: ['./home-page.component.scss'], - templateUrl: './home-page.component.html' + 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] }) export class HomePageComponent implements OnInit { diff --git a/src/app/home-page/home-page.module.ts b/src/app/home-page/home-page.module.ts index 1681abd8058..1d9f6f9bc0f 100644 --- a/src/app/home-page/home-page.module.ts +++ b/src/app/home-page/home-page.module.ts @@ -25,20 +25,18 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule.withEntryComponents(), - JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents(), - HomePageRoutingModule, - StatisticsModule.forRoot() - ], - declarations: [ - ...DECLARATIONS, - ], - exports: [ - ...DECLARATIONS, - ], + imports: [ + CommonModule, + SharedModule.withEntryComponents(), + JournalEntitiesModule.withEntryComponents(), + ResearchEntitiesModule.withEntryComponents(), + HomePageRoutingModule, + StatisticsModule.forRoot(), + ...DECLARATIONS + ], + exports: [ + ...DECLARATIONS, + ] }) export class HomePageModule { 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 edcb4f84f83..2969e320f99 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 @@ -40,15 +40,15 @@ describe('RecentItemListComponent', () => { }; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ 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(); }); 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 9a8535d970a..41a214f527f 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 @@ -15,19 +15,26 @@ import { toDSpaceObjectListRD } from '../../core/shared/operators'; import { Observable } from 'rxjs'; import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; import { APP_CONFIG, AppConfig } from '../../../config/app-config.interface'; -import { isPlatformBrowser } from '@angular/common'; +import { isPlatformBrowser, NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; import { setPlaceHolderAttributes } from '../../shared/utils/object-list-utils'; import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model'; +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'; +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 - ] + 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 c0ef723b383..96e0ec70c4c 100644 --- a/src/app/home-page/themed-home-page.component.ts +++ b/src/app/home-page/themed-home-page.component.ts @@ -3,9 +3,10 @@ import { HomePageComponent } from './home-page.component'; import { Component } from '@angular/core'; @Component({ - selector: 'ds-themed-home-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 6eb74cc0a92..5ccf8c713d7 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 @@ -3,9 +3,10 @@ import { TopLevelCommunityListComponent } from './top-level-community-list.compo import { ThemedComponent } from '../../shared/theme-support/themed.component'; @Component({ - selector: 'ds-themed-top-level-community-list', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 d1a3d3631f1..58f4159e1c7 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 @@ -141,15 +141,15 @@ describe('TopLevelCommunityList Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([]), NgbModule, - NoopAnimationsModule - ], - declarations: [TopLevelCommunityListComponent], - providers: [ + NoopAnimationsModule, + TopLevelCommunityListComponent + ], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: CommunityDataService, useValue: communityDataServiceStub }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, @@ -160,9 +160,9 @@ describe('TopLevelCommunityList Component', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 7d58f57196e..8de99ab412b 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 @@ -13,16 +13,24 @@ import { hasValue } from '../../shared/empty.util'; import { switchMap } from 'rxjs/operators'; import { PaginationService } from '../../core/pagination/pagination.service'; import { AppConfig, APP_CONFIG } from 'src/config/app-config.interface'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { ErrorComponent } from '../../shared/error/error.component'; +import { ObjectCollectionComponent } from '../../shared/object-collection/object-collection.component'; +import { NgIf, AsyncPipe } from '@angular/common'; +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] + 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.component.spec.ts b/src/app/import-external-page/import-external-page.component.spec.ts index 00bdd4be288..38a836a63d0 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 @@ -10,12 +10,12 @@ describe('ImportExternalPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ ImportExternalPageComponent ], - providers:[ + imports: [ImportExternalPageComponent], + providers: [ { provide: ThemeService, useValue: getMockThemeService() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 00709dad164..4cb8062ceba 100644 --- a/src/app/import-external-page/import-external-page.component.ts +++ b/src/app/import-external-page/import-external-page.component.ts @@ -1,4 +1,7 @@ import { Component } from '@angular/core'; +import { + ThemedSubmissionImportExternalComponent +} from '../submission/import-external/themed-submission-import-external.component'; /** * Component representing the external import page of the submission. @@ -6,7 +9,11 @@ import { Component } from '@angular/core'; @Component({ selector: 'ds-import-external-page', templateUrl: './import-external-page.component.html', - styleUrls: ['./import-external-page.component.scss'] + styleUrls: ['./import-external-page.component.scss'], + imports: [ + ThemedSubmissionImportExternalComponent + ], + standalone: true }) export class ImportExternalPageComponent { diff --git a/src/app/import-external-page/import-external-page.module.ts b/src/app/import-external-page/import-external-page.module.ts index 1a0fd9e3604..a0147838d48 100644 --- a/src/app/import-external-page/import-external-page.module.ts +++ b/src/app/import-external-page/import-external-page.module.ts @@ -10,18 +10,16 @@ import { JournalEntitiesModule } from '../entity-groups/journal-entities/journal import { ResearchEntitiesModule } from '../entity-groups/research-entities/research-entities.module'; @NgModule({ - imports: [ - CommonModule, - SharedModule.withEntryComponents(), - CoreModule.forRoot(), - ImportExternalRoutingModule, - SubmissionModule, - JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents() - ], - declarations: [ - ImportExternalPageComponent - ] + imports: [ + CommonModule, + SharedModule.withEntryComponents(), + CoreModule.forRoot(), + ImportExternalRoutingModule, + SubmissionModule, + JournalEntitiesModule.withEntryComponents(), + ResearchEntitiesModule.withEntryComponents(), + 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 64a15bfc4ea..c8c142d12dc 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 @@ -9,10 +9,9 @@ describe('EndUserAgreementContentComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [EndUserAgreementContentComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), EndUserAgreementContentComponent], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 faa7d5a78f2..a7fb34f2854 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,9 +1,13 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; @Component({ - selector: 'ds-end-user-agreement-content', - templateUrl: './end-user-agreement-content.component.html', - styleUrls: ['./end-user-agreement-content.component.scss'] + 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 dc4f4cf4124..8e436521c97 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 @@ -48,18 +48,17 @@ describe('EndUserAgreementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [EndUserAgreementComponent], - providers: [ + imports: [TranslateModule.forRoot(), EndUserAgreementComponent], + providers: [ { provide: EndUserAgreementService, useValue: endUserAgreementService }, { provide: NotificationsService, useValue: notificationsService }, { provide: AuthService, useValue: authService }, { provide: Store, useValue: store }, { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 bcb5e0ce9d9..3b041e411c4 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 @@ -7,14 +7,18 @@ import { AppState } from '../../app.reducer'; import { LogOutAction } from '../../core/auth/auth.actions'; import { EndUserAgreementService } from '../../core/end-user-agreement/end-user-agreement.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +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 { EndUserAgreementContentComponent } from './end-user-agreement-content/end-user-agreement-content.component'; @Component({ - selector: 'ds-end-user-agreement', - templateUrl: './end-user-agreement.component.html', - styleUrls: ['./end-user-agreement.component.scss'] + 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 74eb545b8a0..9f02abf28ad 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 @@ -6,9 +6,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', + 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 c3d38a28768..d07ad8be570 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 @@ -37,9 +37,8 @@ describe('FeedbackFormComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [FeedbackFormComponent], - providers: [ + imports: [TranslateModule.forRoot(), FeedbackFormComponent], + providers: [ { provide: RouteService, useValue: routeServiceStub }, { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, { provide: NotificationsService, useValue: notificationService }, @@ -47,9 +46,9 @@ describe('FeedbackFormComponent', () => { { provide: AuthService, useValue: authService }, { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, { provide: Router, useValue: routerStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 684f974701b..8e442efc85d 100644 --- a/src/app/info/feedback/feedback-form/feedback-form.component.ts +++ b/src/app/info/feedback/feedback-form/feedback-form.component.ts @@ -3,9 +3,9 @@ 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 } from '@angular/forms'; +import { UntypedFormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { AuthService } from '../../../core/auth/auth.service'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @@ -14,11 +14,15 @@ import { getHomePageRoute } from '../../../app-routing-paths'; import { take } from 'rxjs/operators'; import { NativeWindowRef, NativeWindowService } from '../../../core/services/window.service'; import { URLCombiner } from '../../../core/url-combiner/url-combiner'; +import { ErrorComponent } from '../../../shared/error/error.component'; +import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-feedback-form', - templateUrl: './feedback-form.component.html', - styleUrls: ['./feedback-form.component.scss'] + 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 9b42db629fa..1a6253ae7f3 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 @@ -6,9 +6,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', + 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 810c3b703fc..ced48410d22 100644 --- a/src/app/info/feedback/feedback.component.spec.ts +++ b/src/app/info/feedback/feedback.component.spec.ts @@ -9,10 +9,9 @@ describe('FeedbackComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [FeedbackComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), FeedbackComponent], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/info/feedback/feedback.component.ts b/src/app/info/feedback/feedback.component.ts index 3c0924b4de5..a1bbd99212b 100644 --- a/src/app/info/feedback/feedback.component.ts +++ b/src/app/info/feedback/feedback.component.ts @@ -1,9 +1,12 @@ 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'] + 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 68581c32fd7..144453daa63 100644 --- a/src/app/info/feedback/themed-feedback.component.ts +++ b/src/app/info/feedback/themed-feedback.component.ts @@ -6,9 +6,10 @@ import { FeedbackComponent } from './feedback.component'; * Themed wrapper for FeedbackComponent */ @Component({ - selector: 'ds-themed-feedback', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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.module.ts b/src/app/info/info.module.ts index ccc4af0a7dd..7c7a9c4647b 100644 --- a/src/app/info/info.module.ts +++ b/src/app/info/info.module.ts @@ -29,18 +29,16 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - InfoRoutingModule, - ], - declarations: [ - ...DECLARATIONS - ], - exports: [ - ...DECLARATIONS - ], - providers: [FeedbackGuard] + imports: [ + CommonModule, + SharedModule, + InfoRoutingModule, + ...DECLARATIONS + ], + exports: [ + ...DECLARATIONS + ], + providers: [FeedbackGuard] }) export class InfoModule { } 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 682e30273a8..d510551649e 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 @@ -9,10 +9,9 @@ describe('PrivacyContentComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [PrivacyContentComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), PrivacyContentComponent], + 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 6a7b394cf49..5d5a10580cb 100644 --- a/src/app/info/privacy/privacy-content/privacy-content.component.ts +++ b/src/app/info/privacy/privacy-content/privacy-content.component.ts @@ -1,9 +1,13 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; @Component({ - selector: 'ds-privacy-content', - templateUrl: './privacy-content.component.html', - styleUrls: ['./privacy-content.component.scss'] + 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 6f93adec12f..fe548131cb9 100644 --- a/src/app/info/privacy/privacy.component.spec.ts +++ b/src/app/info/privacy/privacy.component.spec.ts @@ -9,10 +9,9 @@ describe('PrivacyComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [PrivacyComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), PrivacyComponent], + 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 dc9d3d69dcd..7640e19b9e8 100644 --- a/src/app/info/privacy/privacy.component.ts +++ b/src/app/info/privacy/privacy.component.ts @@ -1,9 +1,12 @@ 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'] + 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 7f2ee80ffc3..e99f583dbd3 100644 --- a/src/app/info/privacy/themed-privacy.component.ts +++ b/src/app/info/privacy/themed-privacy.component.ts @@ -6,9 +6,10 @@ import { PrivacyComponent } from './privacy.component'; * Themed wrapper for PrivacyComponent */ @Component({ - selector: 'ds-themed-privacy', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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/item-page/alerts/item-alerts.component.spec.ts b/src/app/item-page/alerts/item-alerts.component.spec.ts index a933eb6a589..c44c17eb478 100644 --- a/src/app/item-page/alerts/item-alerts.component.spec.ts +++ b/src/app/item-page/alerts/item-alerts.component.spec.ts @@ -12,10 +12,9 @@ describe('ItemAlertsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemAlertsComponent], - imports: [TranslateModule.forRoot()], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [TranslateModule.forRoot(), ItemAlertsComponent], + 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 2b1df58c9f7..4612b94f174 100644 --- a/src/app/item-page/alerts/item-alerts.component.ts +++ b/src/app/item-page/alerts/item-alerts.component.ts @@ -1,11 +1,22 @@ 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 { NgIf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; @Component({ selector: 'ds-item-alerts', templateUrl: './item-alerts.component.html', - styleUrls: ['./item-alerts.component.scss'] + styleUrls: ['./item-alerts.component.scss'], + imports: [ + AlertComponent, + NgIf, + TranslateModule, + RouterLink + ], + 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 9ed9b514049..192d5bd0588 100644 --- a/src/app/item-page/alerts/themed-item-alerts.component.ts +++ b/src/app/item-page/alerts/themed-item-alerts.component.ts @@ -7,9 +7,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; * Themed wrapper for {@link ItemAlertsComponent} */ @Component({ - selector: 'ds-themed-item-alerts', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 cbfbdf361f4..553f1f3d13b 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 @@ -100,20 +100,19 @@ describe('BitstreamRequestACopyPageComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), FormsModule, ReactiveFormsModule], - declarations: [BitstreamRequestACopyPageComponent], - providers: [ - {provide: Location, useValue: location}, - {provide: ActivatedRoute, useValue: activatedRoute}, - {provide: Router, useValue: router}, - {provide: AuthorizationDataService, useValue: authorizationService}, - {provide: AuthService, useValue: authService}, - {provide: ItemRequestDataService, useValue: itemRequestDataService}, - {provide: NotificationsService, useValue: notificationsService}, - {provide: DSONameService, useValue: new DSONameServiceMock()}, - {provide: BitstreamDataService, useValue: bitstreamDataService}, - ] - }) + imports: [CommonModule, TranslateModule.forRoot(), FormsModule, ReactiveFormsModule, BitstreamRequestACopyPageComponent], + providers: [ + { provide: Location, useValue: location }, + { provide: ActivatedRoute, useValue: activatedRoute }, + { provide: Router, useValue: router }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: AuthService, useValue: authService }, + { provide: ItemRequestDataService, useValue: itemRequestDataService }, + { provide: NotificationsService, useValue: notificationsService }, + { 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 77e1049d87f..2891caa0046 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,6 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { filter, map, switchMap, take } from 'rxjs/operators'; -import { ActivatedRoute, Router } from '@angular/router'; +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'; @@ -9,21 +9,35 @@ 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 { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { EPerson } from '../../../core/eperson/models/eperson.model'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; +import { + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormControl, + UntypedFormGroup, + Validators +} from '@angular/forms'; import { ItemRequestDataService } from '../../../core/data/item-request-data.service'; import { ItemRequest } from '../../../core/shared/item-request.model'; import { Item } from '../../../core/shared/item.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; -import { Location } from '@angular/common'; +import { AsyncPipe, Location, NgIf } from '@angular/common'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { getItemPageRoute } from '../../item-page-routing-paths'; @Component({ selector: 'ds-bitstream-request-a-copy-page', - templateUrl: './bitstream-request-a-copy-page.component.html' + templateUrl: './bitstream-request-a-copy-page.component.html', + imports: [ + TranslateModule, + RouterLink, + AsyncPipe, + ReactiveFormsModule, + NgIf + ], + 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 e85dca2a98d..cbbbab5c531 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 @@ -287,9 +287,8 @@ describe('UploadBitstreamComponent', () => { }; TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [UploadBitstreamComponent, VarDirective], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, UploadBitstreamComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: ItemDataService, useValue: mockItemDataService }, @@ -297,10 +296,10 @@ describe('UploadBitstreamComponent', () => { { provide: AuthService, useValue: authServiceStub }, { provide: BundleDataService, useValue: bundleService }, { provide: RequestService, useValue: requestService } - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).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 56b88806eda..1474ab53a93 100644 --- a/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts +++ b/src/app/item-page/bitstreams/upload/upload-bitstream.component.ts @@ -9,7 +9,7 @@ import { hasValue, isEmpty, isNotEmpty } from '../../../shared/empty.util'; import { ItemDataService } from '../../../core/data/item-data.service'; import { AuthService } from '../../../core/auth/auth.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { Bundle } from '../../../core/shared/bundle.model'; import { BundleDataService } from '../../../core/data/bundle-data.service'; @@ -20,10 +20,26 @@ import { getBitstreamModuleRoute } from '../../../app-routing-paths'; import { getEntityEditRoute } from '../../item-page-routing-paths'; import { environment } from '../../../../environments/environment'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +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'; @Component({ selector: 'ds-upload-bitstream', - templateUrl: './upload-bitstream.component.html' + templateUrl: './upload-bitstream.component.html', + imports: [ + TranslateModule, + AsyncPipe, + VarDirective, + NgIf, + DsoInputSuggestionsComponent, + FormsModule, + UploaderComponent + ], + 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 80002f614b6..11487d0d29b 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 @@ -18,8 +18,9 @@ import { FieldUpdate } from '../../../core/data/object-updates/field-update.mode import { FieldUpdates } from '../../../core/data/object-updates/field-updates.model'; @Component({ - selector: 'ds-abstract-item-update', - template: '' + 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.component.spec.ts b/src/app/item-page/edit-item-page/edit-item-page.component.spec.ts index 2521f7e67d5..46f48cb00af 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 @@ -65,22 +65,20 @@ describe('ItemPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [EditItemPageComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), EditItemPageComponent], + providers: [ { provide: ActivatedRoute, useValue: mockRoute }, { provide: Router, useValue: mockRouter }, 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 652b85916e9..e6ed3376996 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,6 +1,6 @@ import { fadeIn, fadeInOut } from '../../shared/animations/fade'; import { ChangeDetectionStrategy, Component, Injector, OnInit } from '@angular/core'; -import { ActivatedRoute, CanActivate, Route, Router } from '@angular/router'; +import { ActivatedRoute, CanActivate, Route, Router, RouterLink, RouterOutlet } from '@angular/router'; import { RemoteData } from '../../core/data/remote-data'; import { Item } from '../../core/shared/item.model'; import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs'; @@ -8,6 +8,9 @@ import { map } from 'rxjs/operators'; 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', @@ -16,7 +19,18 @@ import { GenericConstructor } from '../../core/shared/generic-constructor'; animations: [ fadeIn, fadeInOut - ] + ], + imports: [ + TranslateModule, + NgClass, + NgIf, + NgForOf, + AsyncPipe, + NgbTooltipModule, + RouterLink, + RouterOutlet + ], + 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 0a75394dddc..e33a0a0b2bd 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 @@ -51,58 +51,56 @@ import { * Module that contains all components related to the Edit Item page administrator functionality */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - NgbTooltipModule, - EditItemPageRoutingModule, - SearchPageModule, - DragDropModule, - ResourcePoliciesModule, - NgbModule, - ItemVersionsModule, - DsoSharedModule, - ResultsBackButtonModule, - AccessControlFormModule, - ], - declarations: [ - EditItemPageComponent, - ItemOperationComponent, - AbstractSimpleItemActionComponent, - AbstractItemUpdateComponent, - ItemWithdrawComponent, - ItemReinstateComponent, - ItemPrivateComponent, - ItemPublicComponent, - ItemDeleteComponent, - ItemStatusComponent, - ThemedItemStatusComponent, - ItemRelationshipsComponent, - ItemBitstreamsComponent, - ItemVersionHistoryComponent, - ItemEditBitstreamComponent, - ItemEditBitstreamBundleComponent, - PaginatedDragAndDropBitstreamListComponent, - EditRelationshipComponent, - EditRelationshipListComponent, - ItemCollectionMapperComponent, - ItemMoveComponent, - ItemEditBitstreamDragHandleComponent, - VirtualMetadataComponent, - ItemAuthorizationsComponent, - IdentifierDataComponent, - ItemRegisterDoiComponent, - ItemCurateComponent, - ItemAccessControlComponent, - ], - providers: [ - BundleDataService, - IdentifierDataService, - ObjectValuesPipe - ], - exports: [ - ItemOperationComponent, - ] + imports: [ + CommonModule, + SharedModule, + NgbTooltipModule, + EditItemPageRoutingModule, + SearchPageModule, + DragDropModule, + ResourcePoliciesModule, + NgbModule, + ItemVersionsModule, + DsoSharedModule, + ResultsBackButtonModule, + AccessControlFormModule, + EditItemPageComponent, + ItemOperationComponent, + AbstractSimpleItemActionComponent, + AbstractItemUpdateComponent, + ItemWithdrawComponent, + ItemReinstateComponent, + ItemPrivateComponent, + ItemPublicComponent, + ItemDeleteComponent, + ItemStatusComponent, + ThemedItemStatusComponent, + ItemRelationshipsComponent, + ItemBitstreamsComponent, + ItemVersionHistoryComponent, + ItemEditBitstreamComponent, + ItemEditBitstreamBundleComponent, + PaginatedDragAndDropBitstreamListComponent, + EditRelationshipComponent, + EditRelationshipListComponent, + ItemCollectionMapperComponent, + ItemMoveComponent, + ItemEditBitstreamDragHandleComponent, + VirtualMetadataComponent, + ItemAuthorizationsComponent, + IdentifierDataComponent, + ItemRegisterDoiComponent, + ItemCurateComponent, + ItemAccessControlComponent + ], + providers: [ + BundleDataService, + IdentifierDataService, + ObjectValuesPipe + ], + 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 d841b97e2ac..3af22dd61f5 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 @@ -8,8 +8,8 @@ xdescribe('ItemAccessControlComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ItemAccessControlComponent ] - }) + imports: [ItemAccessControlComponent] +}) .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 874b6244949..80ba803fae4 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 @@ -5,11 +5,21 @@ import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { RemoteData } from '../../../core/data/remote-data'; import { Item } from '../../../core/shared/item.model'; import { ActivatedRoute } from '@angular/router'; +import { + AccessControlFormContainerComponent +} from '../../../shared/access-control-form-container/access-control-form-container.component'; +import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-item-access-control', templateUrl: './item-access-control.component.html', - styleUrls: [ './item-access-control.component.scss' ], + styleUrls: ['./item-access-control.component.scss'], + imports: [ + AccessControlFormContainerComponent, + NgIf, + AsyncPipe + ], + 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 5d2afbaf4ce..a95977c389b 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 @@ -73,23 +73,21 @@ describe('ItemAuthorizationsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), ItemAuthorizationsComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, ItemAuthorizationsComponent - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -167,8 +165,9 @@ describe('ItemAuthorizationsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 635cf455b55..f3f6ebd0bb0 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 @@ -17,6 +17,12 @@ 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'; /** * Interface for a bundle's bitstream map entry @@ -29,7 +35,18 @@ interface BundleBitstreamsMapEntry { @Component({ selector: 'ds-item-authorizations', templateUrl: './item-authorizations.component.html', - styleUrls:['./item-authorizations.component.scss'] + styleUrls: ['./item-authorizations.component.scss'], + imports: [ + ResourcePoliciesComponent, + NgbCollapseModule, + TranslateModule, + NgForOf, + NgForTrackByIdDirective, + AsyncPipe, + NgIf, + AlertComponent + ], + 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 10e18121313..f82765c68fe 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 @@ -149,9 +149,8 @@ describe('ItemBitstreamsComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ItemBitstreamsComponent, ObjectValuesPipe, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), ItemBitstreamsComponent, ObjectValuesPipe, VarDirective], + providers: [ { provide: ItemDataService, useValue: itemService }, { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: Router, useValue: router }, @@ -163,10 +162,10 @@ describe('ItemBitstreamsComponent', () => { { provide: SearchConfigurationService, useValue: searchConfig }, { provide: BundleDataService, useValue: bundleService }, ChangeDetectorRef - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { 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 ee53bd919c2..b02d2f2571b 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 @@ -4,9 +4,9 @@ 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 } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; @@ -25,11 +25,28 @@ import { Operation } from 'fast-json-patch'; import { FieldUpdate } from '../../../core/data/object-updates/field-update.model'; import { FieldUpdates } from '../../../core/data/object-updates/field-updates.model'; import { FieldChangeType } from '../../../core/data/object-updates/field-change-type.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'; @Component({ selector: 'ds-item-bitstreams', styleUrls: ['./item-bitstreams.component.scss'], templateUrl: './item-bitstreams.component.html', + imports: [ + AsyncPipe, + TranslateModule, + ItemEditBitstreamBundleComponent, + RouterLink, + NgIf, + ItemEditBitstreamDragHandleComponent, + NgForOf, + ThemedLoadingComponent + ], + 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 c26f99eb8fa..dc0dffd4ecd 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 @@ -33,12 +33,11 @@ describe('ItemEditBitstreamBundleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 70f4b632178..0223542ca19 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 @@ -5,11 +5,26 @@ import { ResponsiveColumnSizes } from '../../../../shared/responsive-table-sizes import { ResponsiveTableSizes } from '../../../../shared/responsive-table-sizes/responsive-table-sizes'; import { getItemPageRoute } from '../../../item-page-routing-paths'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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'; @Component({ selector: 'ds-item-edit-bitstream-bundle', styleUrls: ['../item-bitstreams.component.scss'], templateUrl: './item-edit-bitstream-bundle.component.html', + imports: [ + PaginatedDragAndDropBitstreamListComponent, + TranslateModule, + RouterLink, + ItemEditBitstreamDragHandleComponent + ], + 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 7317eb93be0..fd3cd3d21b1 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 @@ -115,18 +115,17 @@ describe('PaginatedDragAndDropBitstreamListComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [PaginatedDragAndDropBitstreamListComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), PaginatedDragAndDropBitstreamListComponent, VarDirective], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: BundleDataService, useValue: bundleService }, { provide: ObjectValuesPipe, useValue: objectValuesPipe }, { provide: RequestService, useValue: requestService }, { provide: PaginationService, useValue: paginationService } - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { 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 2c81a4e2cb9..b8ee2b94776 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 @@ -12,11 +12,37 @@ import { ObjectValuesPipe } from '../../../../../shared/utils/object-values-pipe import { RequestService } from '../../../../../core/data/request.service'; import { PaginationService } from '../../../../../core/pagination/pagination.service'; 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'; @Component({ selector: 'ds-paginated-drag-and-drop-bitstream-list', styleUrls: ['../../item-bitstreams.component.scss'], templateUrl: './paginated-drag-and-drop-bitstream-list.component.html', + imports: [ + AsyncPipe, + NgIf, + PaginationComponent, + NgClass, + VarDirective, + CdkDropList, + NgForOf, + CdkDrag, + ItemEditBitstreamComponent, + ItemEditBitstreamDragHandleComponent, + CdkDragHandle, + ThemedLoadingComponent, + TranslateModule + ], + 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 e5cb9ba4034..6c7b2a380a6 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 @@ -1,9 +1,14 @@ import { Component, OnInit, ViewChild, ViewContainerRef } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-item-edit-bitstream-drag-handle', styleUrls: ['../item-bitstreams.component.scss'], templateUrl: './item-edit-bitstream-drag-handle.component.html', + imports: [ + TranslateModule + ], + 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 aafa5a4fe45..28ce707536f 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 @@ -72,18 +72,15 @@ describe('ItemEditBitstreamComponent', () => { ); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ - ItemEditBitstreamComponent, - VarDirective, - BrowserOnlyMockPipe, - ], - providers: [ + imports: [TranslateModule.forRoot(), ItemEditBitstreamComponent, + VarDirective], + declarations: [BrowserOnlyMockPipe], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService } - ], schemas: [ + ], 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 fcb5c706ac7..aec01cfa57a 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 @@ -10,11 +10,24 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { FieldUpdate } from '../../../../core/data/object-updates/field-update.model'; import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { getBitstreamDownloadRoute } from '../../../../app-routing-paths'; +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 } from '@angular/common'; @Component({ selector: 'ds-item-edit-bitstream', styleUrls: ['../item-bitstreams.component.scss'], templateUrl: './item-edit-bitstream.component.html', + imports: [ + RouterLink, + TranslateModule, + BrowserOnlyPipe, + NgbTooltipModule, + AsyncPipe + ], + 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 f9962643f8f..a74503992af 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 @@ -117,9 +117,8 @@ describe('ItemCollectionMapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 }, @@ -131,8 +130,8 @@ describe('ItemCollectionMapperComponent', () => { { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { 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 d94abfaa9f8..3433b243136 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 @@ -19,7 +19,7 @@ import { import { ActivatedRoute, Router } from '@angular/router'; import { filter, map, startWith, switchMap, take } from 'rxjs/operators'; import { ItemDataService } from '../../../core/data/item-data.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { DSpaceObjectType } from '../../../core/shared/dspace-object-type.model'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; @@ -28,6 +28,10 @@ import { SearchConfigurationService } from '../../../core/shared/search/search-c import { SearchService } from '../../../core/shared/search/search.service'; import { NoContent } from '../../../core/shared/NoContent.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 { ThemedSearchFormComponent } from '../../../shared/search-form/themed-search-form.component'; +import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-item-collection-mapper', @@ -37,7 +41,16 @@ import { getItemPageRoute } from '../../item-page-routing-paths'; animations: [ fadeIn, fadeInOut - ] + ], + imports: [ + NgbNavModule, + CollectionSelectComponent, + ThemedSearchFormComponent, + AsyncPipe, + TranslateModule, + NgIf + ], + 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 c104b4400b4..e96e14651d0 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 @@ -35,14 +35,13 @@ describe('ItemCurateComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ItemCurateComponent], - providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: DSONameService, useValue: dsoNameService} - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), ItemCurateComponent], + providers: [ + { provide: ActivatedRoute, useValue: routeStub }, + { provide: DSONameService, useValue: dsoNameService } + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).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 fa1e0287faf..67c80fc25e7 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 @@ -6,6 +6,9 @@ import { ActivatedRoute } from '@angular/router'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { hasValue } from '../../../shared/empty.util'; import { 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'; /** * Component for managing a collection's curation tasks @@ -13,6 +16,13 @@ import { Item } from '../../../core/shared/item.model'; @Component({ selector: 'ds-item-curate', templateUrl: './item-curate.component.html', + imports: [ + CurationFormComponent, + NgIf, + TranslateModule, + AsyncPipe + ], + 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 2a9f7fae525..f1ee0b9cf33 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 @@ -146,9 +146,8 @@ describe('ItemDeleteComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 }, @@ -158,10 +157,10 @@ describe('ItemDeleteComponent', () => { { provide: EntityTypeDataService, useValue: entityTypeService }, { provide: RelationshipTypeDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, - ], schemas: [ + ], schemas: [ CUSTOM_ELEMENTS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { 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 9012ebe7d75..27d9cbeb939 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 @@ -24,10 +24,10 @@ import { hasValue, isNotEmpty } from '../../../shared/empty.util'; import { Item } from '../../../core/shared/item.model'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { ViewMode } from '../../../core/shared/view-mode.model'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; @@ -36,10 +36,27 @@ import { followLink } from '../../../shared/utils/follow-link-config.model'; import { getItemEditRoute } from '../../item-page-routing-paths'; import { RemoteData } from '../../../core/data/remote-data'; import { NoContent } from '../../../core/shared/NoContent.model'; +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', - templateUrl: '../item-delete/item-delete.component.html' + templateUrl: '../item-delete/item-delete.component.html', + imports: [ + TranslateModule, + ListableObjectComponentLoaderComponent, + NgIf, + ModifyItemOverviewComponent, + AsyncPipe, + VarDirective, + NgForOf, + RouterLink + ], + 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 43ac47e37b0..5ce28d9d058 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 @@ -92,19 +92,18 @@ describe('ItemMoveComponent', () => { itemDataService = mockItemDataService; TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 - ] - }).compileComponents(); + ] +}).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 0f9df588a11..b2c07ca00d3 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 @@ -3,9 +3,9 @@ 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 } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { getAllSucceededRemoteDataPayload, getFirstCompletedRemoteData, getFirstSucceededRemoteData, getRemoteDataPayload, } from '../../../core/shared/operators'; @@ -17,10 +17,24 @@ import { getItemEditRoute, getItemPageRoute } from '../../item-page-routing-path import { followLink } from '../../../shared/utils/follow-link-config.model'; import { RequestService } from '../../../core/data/request.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +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'; @Component({ selector: 'ds-item-move', - templateUrl: './item-move.component.html' + templateUrl: './item-move.component.html', + imports: [ + TranslateModule, + FormsModule, + RouterLink, + AsyncPipe, + AuthorizedCollectionSelectorComponent, + NgIf + ], + 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 7570119b3a7..d9da662e41a 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 @@ -13,9 +13,8 @@ describe('ItemOperationComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - declarations: [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 76d056df95f..69fabce6b52 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,9 +1,20 @@ 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'; @Component({ selector: 'ds-item-operation', - templateUrl: './item-operation.component.html' + templateUrl: './item-operation.component.html', + imports: [ + TranslateModule, + RouterLink, + NgbTooltipModule, + NgIf + ], + 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 323255e3d7b..0786d97e0fc 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 @@ -57,17 +57,16 @@ describe('ItemPrivateComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 937eaad1c45..c23b5797ff3 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,7 +1,7 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { RemoteData } from '../../../core/data/remote-data'; @@ -9,10 +9,17 @@ import { Item } from '../../../core/shared/item.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; @Component({ selector: 'ds-item-private', - templateUrl: '../simple-item-action/abstract-simple-item-action.component.html' + templateUrl: '../simple-item-action/abstract-simple-item-action.component.html', + standalone: true, + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + RouterLink + ], }) /** * Component responsible for rendering the make item private page 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 1f741fcc59b..456b90578cf 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 @@ -54,17 +54,16 @@ describe('ItemPublicComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 97e7b765eb5..2c72056a0d6 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { RemoteData } from '../../../core/data/remote-data'; @@ -8,10 +8,17 @@ import { Item } from '../../../core/shared/item.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; @Component({ selector: 'ds-item-public', - templateUrl: '../simple-item-action/abstract-simple-item-action.component.html' + templateUrl: '../simple-item-action/abstract-simple-item-action.component.html', + standalone: true, + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + RouterLink + ], }) /** * Component responsible for rendering the make item public page 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 af521146426..ecd4aae58c8 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 @@ -64,18 +64,17 @@ describe('ItemRegisterDoiComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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: 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 54878c60261..d1b5548219e 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { RemoteData } from '../../../core/data/remote-data'; @@ -14,10 +14,21 @@ import { Observable } from 'rxjs'; import { getItemPageRoute } from '../../item-page-routing-paths'; import { IdentifierDataService } from '../../../core/data/identifier-data.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'; @Component({ selector: 'ds-item-register-doi', - templateUrl: './item-register-doi-component.html' + templateUrl: './item-register-doi-component.html', + imports: [ + ModifyItemOverviewComponent, + RouterLink, + TranslateModule, + AsyncPipe, + NgIf, + NgForOf + ], + 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 594e7b806a7..eea4b7bafb7 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 @@ -56,17 +56,16 @@ describe('ItemReinstateComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 951585d1568..57f7c4551bd 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { RemoteData } from '../../../core/data/remote-data'; @@ -8,10 +8,17 @@ import { Item } from '../../../core/shared/item.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; @Component({ selector: 'ds-item-reinstate', - templateUrl: '../simple-item-action/abstract-simple-item-action.component.html' + templateUrl: '../simple-item-action/abstract-simple-item-action.component.html', + standalone: true, + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + RouterLink + ], }) /** * Component responsible for rendering the Item Reinstate page 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 4cd663f0fbc..bce66160f18 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 @@ -209,9 +209,8 @@ describe('EditRelationshipListComponent', () => { }; TestBed.configureTestingModule({ - imports: [SharedModule, TranslateModule.forRoot()], - declarations: [EditRelationshipListComponent], - providers: [ + imports: [SharedModule, TranslateModule.forRoot(), EditRelationshipListComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: RelationshipDataService, useValue: relationshipService }, { provide: SelectableListService, useValue: selectableListService }, @@ -225,10 +224,10 @@ describe('EditRelationshipListComponent', () => { { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], schemas: [ + ], 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 b8542f5806f..321d6d79103 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 @@ -41,11 +41,30 @@ import { FieldUpdates } from '../../../../core/data/object-updates/field-updates import { FieldChangeType } from '../../../../core/data/object-updates/field-change-type.model'; import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interface'; 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, NgIf } from '@angular/common'; +import { ObjectValuesPipe } from '../../../../shared/utils/object-values-pipe'; +import { VarDirective } from '../../../../shared/utils/var.directive'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; @Component({ selector: 'ds-edit-relationship-list', styleUrls: ['./edit-relationship-list.component.scss'], templateUrl: './edit-relationship-list.component.html', + imports: [ + EditRelationshipComponent, + PaginationComponent, + AsyncPipe, + ObjectValuesPipe, + VarDirective, + NgIf, + TranslateModule, + NgClass, + ThemedLoadingComponent + ], + 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 a3062abf7ed..ffff73b6210 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 @@ -117,20 +117,19 @@ describe('EditRelationshipComponent', () => { spyOn(objectUpdatesService, 'isSelectedVirtualMetadata').and.callFake((a, b, uuid) => observableOf(itemSelection[uuid])); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [EditRelationshipComponent], - providers: [ + imports: [TranslateModule.forRoot(), EditRelationshipComponent], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { - provide: NgbModal, useValue: { - open: () => {/*comment*/ - } - }, + provide: NgbModal, useValue: { + open: () => { + } + }, }, - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { 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 742cc7181c8..38f72ac4e73 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 @@ -13,12 +13,26 @@ 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'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'ds-edit-relationship', styleUrls: ['./edit-relationship.component.scss'], templateUrl: './edit-relationship.component.html', + imports: [ + ListableObjectComponentLoaderComponent, + AsyncPipe, + NgIf, + TranslateModule, + VirtualMetadataComponent + ], + 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 aa711c8ea31..f843b92df1d 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 @@ -210,9 +210,8 @@ describe('ItemRelationshipsComponent', () => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [SharedModule, TranslateModule.forRoot()], - declarations: [ItemRelationshipsComponent], - providers: [ + imports: [SharedModule, TranslateModule.forRoot(), ItemRelationshipsComponent], + providers: [ { provide: ThemeService, useValue: getMockThemeService() }, { provide: ItemDataService, useValue: itemService }, { provide: ObjectUpdatesService, useValue: objectUpdatesService }, @@ -225,10 +224,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 8f7c43e79ff..90f87add7d1 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 @@ -12,7 +12,7 @@ import { ItemDataService } from '../../../core/data/item-data.service'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { ActivatedRoute, Router } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { RelationshipDataService } from '../../../core/data/relationship-data.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ObjectCacheService } from '../../../core/cache/object-cache.service'; @@ -30,11 +30,25 @@ import { FieldChangeType } from '../../../core/data/object-updates/field-change- import { RelationshipTypeDataService } from '../../../core/data/relationship-type-data.service'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +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 { VarDirective } from '../../../shared/utils/var.directive'; @Component({ selector: 'ds-item-relationships', styleUrls: ['./item-relationships.component.scss'], templateUrl: './item-relationships.component.html', + imports: [ + ThemedLoadingComponent, + AsyncPipe, + TranslateModule, + NgIf, + EditRelationshipListComponent, + NgForOf, + VarDirective + ], + 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 a67de2f435a..c8e302bd149 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 @@ -64,16 +64,15 @@ describe('ItemStatusComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 }, { provide: IdentifierDataService, useValue: mockIdentifierDataService }, { provide: ConfigurationDataService, useValue: mockConfigurationDataService } - ], schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 828f8d74391..8501d4a6d30 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,7 +1,7 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { fadeIn, fadeInOut } from '../../../shared/animations/fade'; import { Item } from '../../../core/shared/item.model'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, RouterLink } from '@angular/router'; import { ItemOperation } from '../item-operation/itemOperation.model'; import { distinctUntilChanged, map, mergeMap, switchMap, toArray } from 'rxjs/operators'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; @@ -18,6 +18,9 @@ import { Identifier } from '../../../shared/object-list/identifier-data/identifi import { ConfigurationProperty } from '../../../core/shared/configuration-property.model'; import { ConfigurationDataService } from '../../../core/data/configuration-data.service'; 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'; @Component({ selector: 'ds-item-status', @@ -26,7 +29,17 @@ import { IdentifierData } from '../../../shared/object-list/identifier-data/iden animations: [ fadeIn, fadeInOut - ] + ], + imports: [ + TranslateModule, + NgForOf, + AsyncPipe, + NgIf, + RouterLink, + ItemOperationComponent, + NgClass + ], + 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 eac5a537021..7864777507c 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 @@ -3,9 +3,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', + 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 f4ed04c2c8c..326f2554c1b 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 @@ -28,13 +28,12 @@ describe('ItemVersionHistoryComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemVersionHistoryComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionHistoryComponent, VarDirective], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 3845c03578a..519e00a3b36 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 @@ -6,10 +6,20 @@ import { map } from 'rxjs/operators'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { ActivatedRoute } from '@angular/router'; 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'; @Component({ selector: 'ds-item-version-history', - templateUrl: './item-version-history.component.html' + templateUrl: './item-version-history.component.html', + imports: [ + ItemVersionsComponent, + VarDirective, + NgIf, + AsyncPipe + ], + 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 3397742f5b0..11c9323c075 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 @@ -54,17 +54,16 @@ describe('ItemWithdrawComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule,], - declarations: [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 cbd710ba1cc..2b68b7dd097 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,7 +1,7 @@ import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { RemoteData } from '../../../core/data/remote-data'; @@ -9,10 +9,17 @@ import { Item } from '../../../core/shared/item.model'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; @Component({ selector: 'ds-item-withdraw', - templateUrl: '../simple-item-action/abstract-simple-item-action.component.html' + templateUrl: '../simple-item-action/abstract-simple-item-action.component.html', + standalone: true, + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + RouterLink + ], }) /** * Component responsible for rendering the Item Withdraw page 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 748231be1c7..a6c58c68e5d 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 @@ -24,9 +24,8 @@ const mockItem = Object.assign(new Item(), { describe('ModifyItemOverviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 974bc8d37fc..4b7101760a2 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,10 +1,14 @@ import {Component, Input, OnInit} from '@angular/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' + 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 9a19837665c..dc2b0d62bac 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 @@ -27,8 +27,10 @@ import { getItemEditRoute } from '../../item-page-routing-paths'; * AbstractSimpleItemActionComponent component */ @Component({ - selector: 'ds-simple-action', - templateUrl: './abstract-simple-item-action.component.html' + selector: 'ds-simple-action', + templateUrl: './abstract-simple-item-action.component.html', + standalone: true, + imports: [CommonModule, FormsModule, NgbModule] }) export class MySimpleItemActionComponent extends AbstractSimpleItemActionComponent { @@ -83,17 +85,16 @@ describe('AbstractSimpleItemActionComponent', () => { notificationsServiceStub = new NotificationsServiceStub(); TestBed.configureTestingModule({ - imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [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 f4028354de6..b3207fffee5 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,8 +1,8 @@ import { Component, OnInit, Predicate } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ItemDataService } from '../../../core/data/item-data.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Item } from '../../../core/shared/item.model'; import { RemoteData } from '../../../core/data/remote-data'; import { Observable } from 'rxjs'; @@ -10,6 +10,7 @@ import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { first, map } from 'rxjs/operators'; import { findSuccessfulAccordingTo } from '../edit-item-operators'; import { getItemEditRoute, getItemPageRoute } from '../../item-page-routing-paths'; +import { ModifyItemOverviewComponent } from '../modify-item-overview/modify-item-overview.component'; /** * Component to render and handle simple item edit actions such as withdrawal and reinstatement. @@ -17,7 +18,13 @@ import { getItemEditRoute, getItemPageRoute } from '../../item-page-routing-path */ @Component({ selector: 'ds-simple-action', - templateUrl: './abstract-simple-item-action.component.html' + templateUrl: './abstract-simple-item-action.component.html', + imports: [ + ModifyItemOverviewComponent, + TranslateModule, + RouterLink + ], + 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 9391df4755c..c3a4b07be5d 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 @@ -44,15 +44,14 @@ describe('VirtualMetadataComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [VirtualMetadataComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), VirtualMetadataComponent, VarDirective], + providers: [ { provide: ObjectUpdatesService, useValue: objectUpdatesService }, { provide: APP_CONFIG, useValue: environment } - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); fixture = TestBed.createComponent(VirtualMetadataComponent); comp = fixture.componentInstance; 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 6f8991dc732..2c85997dfa1 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 @@ -4,10 +4,25 @@ import {Item} from '../../../core/shared/item.model'; import {MetadataValue} from '../../../core/shared/metadata.models'; import {ObjectUpdatesService} from '../../../core/data/object-updates/object-updates.service'; import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; +import { AsyncPipe, NgClass, NgForOf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +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', - templateUrl: './virtual-metadata.component.html' + templateUrl: './virtual-metadata.component.html', + imports: [ + NgClass, + TranslateModule, + NgForOf, + VarDirective, + AsyncPipe, + ListableObjectComponentLoaderComponent + ], + 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 8ea52193085..8e926d7e749 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 @@ -45,16 +45,14 @@ describe('CollectionsComponent', () => { mockCollection4 = createMockCollection('c4'); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ CollectionsComponent ], - providers: [ + imports: [TranslateModule.forRoot(), CollectionsComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, - { provide: RemoteDataBuildService, useValue: getMockRemoteDataBuildService()}, + { provide: RemoteDataBuildService, useValue: getMockRemoteDataBuildService() }, { provide: CollectionDataService, useValue: collectionDataService }, - ], - - 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 78d7c985a3d..729d20a9705 100644 --- a/src/app/item-page/field-components/collections/collections.component.ts +++ b/src/app/item-page/field-components/collections/collections.component.ts @@ -15,6 +15,10 @@ import { } from '../../../core/shared/operators'; import { FindListOptions } from '../../../core/data/find-list-options.model'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +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 @@ -23,7 +27,16 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-item-page-collections', - templateUrl: './collections.component.html' + templateUrl: './collections.component.html', + imports: [ + MetadataFieldWrapperComponent, + TranslateModule, + NgForOf, + AsyncPipe, + RouterLink, + NgIf + ], + 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 f869ab8aaf8..90b90d84c4d 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 @@ -29,18 +29,17 @@ const mockLinkText = 'fake link text'; describe('MetadataUriValuesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), MetadataUriValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, - ], - declarations: [MetadataUriValuesComponent], - 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 e070eccf2d5..82ee16a627b 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 @@ -2,6 +2,9 @@ import { Component, Input } from '@angular/core'; import { MetadataValuesComponent } from '../metadata-values/metadata-values.component'; 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'; /** * This component renders the configured 'values' into the ds-metadata-field-wrapper component as a link. @@ -13,7 +16,14 @@ import { MetadataValue } from '../../../core/shared/metadata.models'; @Component({ selector: 'ds-metadata-uri-values', styleUrls: ['./metadata-uri-values.component.scss'], - templateUrl: './metadata-uri-values.component.html' + templateUrl: './metadata-uri-values.component.html', + imports: [ + MetadataFieldWrapperComponent, + TranslateModule, + NgForOf, + NgIf + ], + 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 23f80982077..6a04de78e85 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 @@ -30,18 +30,17 @@ const mockLabel = 'fake.message'; describe('MetadataValuesComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - }, - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + }, + }), MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, - ], - declarations: [MetadataValuesComponent], - 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 cbbae9006da..255b21c6bd9 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 @@ -4,15 +4,22 @@ import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; import { BrowseDefinition } from '../../../core/shared/browse-definition.model'; import { hasValue } from '../../../shared/empty.util'; 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 { NgFor, NgTemplateOutlet, NgIf, AsyncPipe } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; /** * This component renders the configured 'values' into the ds-metadata-field-wrapper component. * It puts the given 'separator' between each two values. */ @Component({ - selector: 'ds-metadata-values', - styleUrls: ['./metadata-values.component.scss'], - templateUrl: './metadata-values.component.html' + 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 f8a8a83f294..98f62cf759b 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 @@ -61,22 +61,20 @@ describe('FullFileSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), BrowserAnimationsModule], - declarations: [FullFileSectionComponent, VarDirective, FileSizePipe, MetadataFieldWrapperComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), BrowserAnimationsModule, FullFileSectionComponent, VarDirective, FileSizePipe, MetadataFieldWrapperComponent], + providers: [ { provide: BitstreamDataService, useValue: bitstreamDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: PaginationService, useValue: paginationService }, { provide: APP_CONFIG, useValue: environment }, - ], - - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(waitForAsync(() => { 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 d34edeb0257..f1f111a6d10 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 @@ -11,11 +11,22 @@ import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { switchMap, tap } from 'rxjs/operators'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { hasValue, isEmpty } from '../../../../shared/empty.util'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { AppConfig, APP_CONFIG } from 'src/config/app-config.interface'; +import { PaginationComponent } from '../../../../shared/pagination/pagination.component'; +import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +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'; /** * This component renders the file section of the item @@ -25,7 +36,20 @@ import { AppConfig, APP_CONFIG } from 'src/config/app-config.interface'; @Component({ selector: 'ds-item-page-full-file-section', styleUrls: ['./full-file-section.component.scss'], - templateUrl: './full-file-section.component.html' + templateUrl: './full-file-section.component.html', + imports: [ + PaginationComponent, + NgIf, + TranslateModule, + AsyncPipe, + VarDirective, + ThemedThumbnailComponent, + NgForOf, + ThemedFileDownloadLinkComponent, + FileSizePipe, + MetadataFieldWrapperComponent + ], + 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 015eec285cc..c3421cbcda4 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 @@ -7,9 +7,10 @@ import { Item } from '../../../../core/shared/item.model'; * Themed wrapper for {@link FullFileSectionComponent} */ @Component({ - selector: 'ds-themed-item-page-full-file-section', - styleUrls: [], - templateUrl: './../../../../shared/theme-support/themed.component.html', + 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 9fc078c2cd7..46ca9d5a9d1 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 @@ -106,14 +106,13 @@ describe('FullItemPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), RouterTestingModule.withRoutes([]), BrowserAnimationsModule], - declarations: [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 }, @@ -123,9 +122,9 @@ describe('FullItemPageComponent', () => { { provide: SignpostingDataService, useValue: signpostingDataService }, { provide: LinkHeadService, useValue: linkHeadService }, { provide: PLATFORM_ID, useValue: 'server' } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(FullItemPageComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(FullItemPageComponent, { set: { 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 31dd2c5fc28..3d5a0d59407 100644 --- a/src/app/item-page/full/full-item-page.component.ts +++ b/src/app/item-page/full/full-item-page.component.ts @@ -1,6 +1,6 @@ import { filter, map } from 'rxjs/operators'; import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, Data, Router } from '@angular/router'; +import { ActivatedRoute, Data, Router, RouterLink } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; @@ -14,11 +14,25 @@ import { Item } from '../../core/shared/item.model'; import { fadeInOut } from '../../shared/animations/fade'; import { hasValue } from '../../shared/empty.util'; import { AuthService } from '../../core/auth/auth.service'; -import { Location } from '@angular/common'; +import { AsyncPipe, KeyValuePipe, Location, NgForOf, NgIf } from '@angular/common'; import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service'; import { ServerResponseService } from '../../core/services/server-response.service'; import { SignpostingDataService } from '../../core/data/signposting-data.service'; import { LinkHeadService } from '../../core/services/link-head.service'; +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 { ViewTrackerComponent } from '../../statistics/angulartics/dspace/view-tracker.component'; +import { ThemedItemAlertsComponent } from '../alerts/themed-item-alerts.component'; +import { VarDirective } from '../../shared/utils/var.directive'; /** * This component renders a full item page. @@ -30,7 +44,27 @@ import { LinkHeadService } from '../../core/services/link-head.service'; styleUrls: ['./full-item-page.component.scss'], templateUrl: './full-item-page.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - animations: [fadeInOut] + animations: [fadeInOut], + imports: [ + ErrorComponent, + ThemedLoadingComponent, + TranslateModule, + ThemedFullFileSectionComponent, + CollectionsComponent, + ItemVersionsComponent, + NgIf, + NgForOf, + AsyncPipe, + KeyValuePipe, + RouterLink, + ThemedItemPageTitleFieldComponent, + DsoEditMenuComponent, + ItemVersionsNoticeComponent, + ViewTrackerComponent, + ThemedItemAlertsComponent, + VarDirective + ], + 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 a3b19e6f93d..3c82e62cddf 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 @@ -6,9 +6,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', + 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.module.ts b/src/app/item-page/item-page.module.ts index a8d41d15352..79a994f7666 100644 --- a/src/app/item-page/item-page.module.ts +++ b/src/app/item-page/item-page.module.ts @@ -106,29 +106,26 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule.withEntryComponents(), - ItemPageRoutingModule, - EditItemPageModule, - ItemVersionsModule, - ItemSharedModule, - StatisticsModule.forRoot(), - JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents(), - NgxGalleryModule, - NgbAccordionModule, - ResultsBackButtonModule, - UploadModule, - DsoPageModule, - ], - declarations: [ - ...DECLARATIONS, - - ], - exports: [ - ...DECLARATIONS, - ] + imports: [ + CommonModule, + SharedModule.withEntryComponents(), + ItemPageRoutingModule, + EditItemPageModule, + ItemVersionsModule, + ItemSharedModule, + StatisticsModule.forRoot(), + JournalEntitiesModule.withEntryComponents(), + ResearchEntitiesModule.withEntryComponents(), + NgxGalleryModule, + NgbAccordionModule, + ResultsBackButtonModule, + UploadModule, + DsoPageModule, + ...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 9c2bbba6194..10ea5f41717 100644 --- a/src/app/item-page/item-shared.module.ts +++ b/src/app/item-page/item-shared.module.ts @@ -35,24 +35,22 @@ const COMPONENTS = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS - ], - imports: [ - CommonModule, - SearchModule, - SharedModule, - TranslateModule - ], - exports: [ - ...COMPONENTS - ], - providers: [ - { - provide: DYNAMIC_FORM_CONTROL_MAP_FN, - useValue: dsDynamicFormControlMapFn - }, - ...ENTRY_COMPONENTS, - ] + imports: [ + CommonModule, + SearchModule, + SharedModule, + TranslateModule, + ...COMPONENTS + ], + exports: [ + ...COMPONENTS + ], + providers: [ + { + provide: DYNAMIC_FORM_CONTROL_MAP_FN, + useValue: dsDynamicFormControlMapFn + }, + ...ENTRY_COMPONENTS, + ] }) export class ItemSharedModule { } 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 98d0ac08a6c..b4bc2c2db46 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 @@ -57,13 +57,12 @@ describe('MediaViewerImageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports:[], - declarations: [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 2ad43f6883c..d52ad43dbb3 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,9 +1,9 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core'; -import { NgxGalleryImage, NgxGalleryOptions } from '@kolkov/ngx-gallery'; +import { NgxGalleryAnimation, NgxGalleryImage, NgxGalleryModule, NgxGalleryOptions } from '@kolkov/ngx-gallery'; import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; -import { NgxGalleryAnimation } from '@kolkov/ngx-gallery'; import { Observable } from 'rxjs'; import { AuthService } from '../../../core/auth/auth.service'; +import { AsyncPipe } from '@angular/common'; /** * This componenet render an image gallery for the image viewer @@ -12,6 +12,11 @@ import { AuthService } from '../../../core/auth/auth.service'; selector: 'ds-media-viewer-image', templateUrl: './media-viewer-image.component.html', styleUrls: ['./media-viewer-image.component.scss'], + imports: [ + NgxGalleryModule, + AsyncPipe + ], + 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 85ac779817d..43eeb1cb0e8 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 @@ -7,9 +7,10 @@ import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model'; * Themed wrapper for {@link MediaViewerImageComponent}. */ @Component({ - selector: 'ds-themed-media-viewer-image', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', + 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 92aa229b01c..b3730b2833c 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 @@ -19,23 +19,21 @@ describe('MediaViewerVideoComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), BrowserAnimationsModule, - ], - declarations: [ 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 52cd3cac34e..b29fee7e990 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 @@ -4,6 +4,9 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { languageHelper } from './language-helper'; import { CaptionInfo } from './caption-info'; 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'; /** * This component renders a video viewer and playlist for the media viewer @@ -12,6 +15,13 @@ import { Bitstream } from 'src/app/core/shared/bitstream.model'; selector: 'ds-media-viewer-video', templateUrl: './media-viewer-video.component.html', styleUrls: ['./media-viewer-video.component.scss'], + imports: [ + NgForOf, + NgbDropdownModule, + TranslateModule, + NgIf + ], + 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 8ae45b2dd3f..eb0d1740da9 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 @@ -8,9 +8,10 @@ import { Bitstream } from '../../../core/shared/bitstream.model'; * Themed wrapper for {@link MediaViewerVideoComponent}. */ @Component({ - selector: 'ds-themed-media-viewer-video', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', + 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 0c170ac8cf2..a405c171314 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 @@ -62,27 +62,24 @@ describe('MediaViewerComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), BrowserAnimationsModule, - ], - declarations: [ MediaViewerComponent, VarDirective, FileSizePipe, - MetadataFieldWrapperComponent, - ], - providers: [ + MetadataFieldWrapperComponent + ], + providers: [ { provide: BitstreamDataService, useValue: bitstreamDataService }, - ], - - 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 242e50646e3..ebae23074cd 100644 --- a/src/app/item-page/media-viewer/media-viewer.component.ts +++ b/src/app/item-page/media-viewer/media-viewer.component.ts @@ -14,6 +14,13 @@ import { followLink } from '../../shared/utils/follow-link-config.model'; import { MediaViewerConfig } from '../../../config/media-viewer-config.interface'; import { environment } from '../../../environments/environment'; 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 { VarDirective } from '../../shared/utils/var.directive'; /** * This component renders the media viewers @@ -22,6 +29,17 @@ import { Subscription } from 'rxjs/internal/Subscription'; selector: 'ds-media-viewer', templateUrl: './media-viewer.component.html', styleUrls: ['./media-viewer.component.scss'], + imports: [ + ThemedMediaViewerImageComponent, + ThumbnailComponent, + AsyncPipe, + NgIf, + ThemedMediaViewerVideoComponent, + TranslateModule, + ThemedLoadingComponent, + VarDirective + ], + 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 6acf9486163..56272969935 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 @@ -8,9 +8,10 @@ import { MediaViewerConfig } from '../../../config/media-viewer-config.interface * Themed wrapper for {@link MediaViewerComponent}. */ @Component({ - selector: 'ds-themed-media-viewer', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 2727391dffd..f39189296ec 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 @@ -38,20 +38,19 @@ describe('MiradorViewerComponent with search', () => { beforeEach(waitForAsync(() => { viewerService.showEmbeddedViewer.and.returnValue(true); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService } @@ -101,20 +100,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 - } - })], - declarations: [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, { + { provide: HostWindowService, useValue: mockHostWindowService } + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService } @@ -161,20 +159,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 - } - })], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MiradorViewerComponent, { set: { providers: [ { provide: MiradorViewerService, useValue: viewerService } @@ -214,18 +211,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 - } - })], - declarations: [MiradorViewerComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), MiradorViewerComponent], + providers: [ { provide: BitstreamDataService, useValue: {} } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MiradorViewerComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 fee80462721..c7252f32019 100644 --- a/src/app/item-page/mirador-viewer/mirador-viewer.component.ts +++ b/src/app/item-page/mirador-viewer/mirador-viewer.component.ts @@ -5,17 +5,24 @@ import { environment } from '../../../environments/environment'; import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { Observable, of } from 'rxjs'; import { map, take } from 'rxjs/operators'; -import { isPlatformBrowser } from '@angular/common'; +import { AsyncPipe, isPlatformBrowser, NgIf } from '@angular/common'; import { MiradorViewerService } from './mirador-viewer.service'; import { HostWindowService, WidthCategory } from '../../shared/host-window.service'; import { BundleDataService } from '../../core/data/bundle-data.service'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-mirador-viewer', styleUrls: ['./mirador-viewer.component.scss'], templateUrl: './mirador-viewer.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ MiradorViewerService ] + providers: [MiradorViewerService], + imports: [ + TranslateModule, + AsyncPipe, + NgIf + ], + 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 e96e5996fbc..0efa7a42f9e 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 @@ -123,24 +123,24 @@ describe('OrcidAuthComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - RouterTestingModule.withRoutes([]) - ], - declarations: [OrcidAuthComponent], - providers: [ + RouterTestingModule.withRoutes([]), + OrcidAuthComponent + ], + providers: [ { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: OrcidAuthService, useValue: orcidAuthService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrcidAuthComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(OrcidAuthComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); diff --git a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts index ea970e7d315..b2d874a7cd4 100644 --- a/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts +++ b/src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Inject, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { NativeWindowRef, NativeWindowService } from '../../../core/services/window.service'; @@ -10,11 +10,21 @@ import { RemoteData } from '../../../core/data/remote-data'; import { ResearcherProfile } from '../../../core/profile/model/researcher-profile.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { OrcidAuthService } from '../../../core/orcid/orcid-auth.service'; +import { AsyncPipe, NgForOf, NgIf } from "@angular/common"; +import { AlertComponent } from "../../../shared/alert/alert.component"; @Component({ selector: 'ds-orcid-auth', templateUrl: './orcid-auth.component.html', - styleUrls: ['./orcid-auth.component.scss'] + styleUrls: ['./orcid-auth.component.scss'], + imports: [ + NgForOf, + TranslateModule, + AsyncPipe, + NgIf, + AlertComponent + ], + standalone: true }) export class OrcidAuthComponent implements OnInit, OnChanges { diff --git a/src/app/item-page/orcid-page/orcid-page.component.html b/src/app/item-page/orcid-page/orcid-page.component.html index 33c3125d676..1eac8b43691 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.html +++ b/src/app/item-page/orcid-page/orcid-page.component.html @@ -10,7 +10,7 @@
- {{'person.page.orcid.link.error.message' | translate}} + {{'person.page.orcid.link.error.message' | translate}}
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 1ed237943ea..0db026d7f98 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 @@ -98,26 +98,25 @@ describe('OrcidPageComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - RouterTestingModule.withRoutes([]) - ], - declarations: [OrcidPageComponent], - providers: [ + RouterTestingModule.withRoutes([]), + OrcidPageComponent + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: OrcidAuthService, useValue: orcidAuthService }, { provide: AuthService, useValue: authService }, { 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 f3dbb569d9d..da08c022022 100644 --- a/src/app/item-page/orcid-page/orcid-page.component.ts +++ b/src/app/item-page/orcid-page/orcid-page.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, ParamMap, Router } from '@angular/router'; -import { isPlatformBrowser } from '@angular/common'; +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'; @@ -15,6 +15,13 @@ import { redirectOn4xx } from '../../core/shared/authorized.operators'; import { ItemDataService } from '../../core/data/item-data.service'; import { isNotEmpty } from '../../shared/empty.util'; 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'; /** * A component that represents the orcid settings page @@ -22,9 +29,21 @@ import { ResearcherProfile } from '../../core/profile/model/researcher-profile.m @Component({ selector: 'ds-orcid-page', templateUrl: './orcid-page.component.html', - styleUrls: ['./orcid-page.component.scss'] + styleUrls: ['./orcid-page.component.scss'], + imports: [ + CommonModule, + LoadingComponent, + AlertComponent, + OrcidAuthComponent, + OrcidSyncSettingsComponent, + OrcidQueueComponent, + TranslateModule, + RouterLink + ], + standalone: true }) export class OrcidPageComponent implements OnInit { + protected readonly AlertType = AlertType; /** * A boolean representing if the connection operation with orcid profile is in progress @@ -150,4 +169,5 @@ export class OrcidPageComponent implements OnInit { const redirectUrl = this.router.url.split('?')[0]; this.router.navigate([redirectUrl]); } + } 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 d0f52531d44..57266633894 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 @@ -108,25 +108,25 @@ describe('OrcidQueueComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - RouterTestingModule.withRoutes([]) - ], - declarations: [OrcidQueueComponent], - providers: [ + RouterTestingModule.withRoutes([]), + 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] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 3e88826952e..756fdeb962c 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,6 +1,6 @@ import { Component, Input, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, switchMap, tap } from 'rxjs/operators'; @@ -18,11 +18,25 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio import { AlertType } from '../../../shared/alert/alert-type'; import { Item } from '../../../core/shared/item.model'; import { OrcidAuthService } from '../../../core/orcid/orcid-auth.service'; +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 { PaginationComponent } from '../../../shared/pagination/pagination.component'; @Component({ selector: 'ds-orcid-queue', templateUrl: './orcid-queue.component.html', - styleUrls: ['./orcid-queue.component.scss'] + styleUrls: ['./orcid-queue.component.scss'], + imports: [ + CommonModule, + NgbTooltipModule, + TranslateModule, + LoadingComponent, + AlertComponent, + PaginationComponent, + ], + standalone: true }) export class OrcidQueueComponent implements OnInit, OnDestroy { diff --git a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html index ee9a15268a5..19044e5a70f 100644 --- a/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html +++ b/src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.html @@ -8,7 +8,7 @@

{{'person.orcid.sync.setting' | translate}}

- + {{ 'person.page.orcid.synchronization-mode-message' | translate}}
@@ -32,7 +32,7 @@

{{'person.orcid.sync.setting' | translate}}

- + {{ 'person.page.orcid.synchronization-mode-publication-message' | translate}}
@@ -55,7 +55,7 @@

{{'person.orcid.sync.setting' | translate}}

- + {{ 'person.page.orcid.synchronization-mode-funding-message' | translate}}
@@ -77,7 +77,7 @@

{{'person.orcid.sync.setting' | translate}}

- + {{ 'person.page.orcid.synchronization-mode-profile-message' | translate}}
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 f2fa9d2440b..e3e33de1071 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 @@ -134,25 +134,25 @@ describe('OrcidSyncSettingsComponent test suite', () => { }); void TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, NgbAccordionModule, ReactiveFormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - RouterTestingModule.withRoutes([]) - ], - declarations: [OrcidSyncSettingsComponent], - providers: [ + RouterTestingModule.withRoutes([]), + OrcidSyncSettingsComponent + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: ResearcherProfileDataService, useValue: researcherProfileService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(OrcidSyncSettingsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0bcbc295ac0..96654ee423b 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,7 +1,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { FormsModule, UntypedFormGroup } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Operation } from 'fast-json-patch'; import { of } from 'rxjs'; import { switchMap } from 'rxjs/operators'; @@ -12,13 +12,24 @@ import { Item } from '../../../core/shared/item.model'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { ResearcherProfile } from '../../../core/profile/model/researcher-profile.model'; +import { AlertComponent } from '../../../shared/alert/alert.component'; +import { AlertType } from '../../../shared/alert/alert-type'; +import { NgForOf } from '@angular/common'; @Component({ selector: 'ds-orcid-sync-setting', templateUrl: './orcid-sync-settings.component.html', - styleUrls: ['./orcid-sync-settings.component.scss'] + styleUrls: ['./orcid-sync-settings.component.scss'], + imports: [ + AlertComponent, + FormsModule, + TranslateModule, + NgForOf + ], + standalone: true }) export class OrcidSyncSettingsComponent implements OnInit { + protected readonly AlertType = AlertType; /** * The item for which showing the orcid settings 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 e788e6e5753..8c459ee8613 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 @@ -3,8 +3,9 @@ import { Subscription } from 'rxjs'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; @Component({ - selector: 'ds-abstract-incremental-list', - template: ``, + 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 8acf405b55f..240d3a9539e 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 @@ -58,21 +58,19 @@ describe('FileSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), BrowserAnimationsModule], - declarations: [FileSectionComponent, VarDirective, FileSizePipe, MetadataFieldWrapperComponent], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), BrowserAnimationsModule, FileSectionComponent, VarDirective, FileSizePipe, MetadataFieldWrapperComponent], + providers: [ { provide: BitstreamDataService, useValue: bitstreamDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: APP_CONFIG, useValue: environment } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 3c41731c5f4..1f1d1b6cd2f 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 @@ -8,10 +8,20 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { hasValue } from '../../../../shared/empty.util'; import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { NotificationsService } from '../../../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; -import { AppConfig, APP_CONFIG } 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 { + ThemedFileDownloadLinkComponent +} from '../../../../shared/file-download-link/themed-file-download-link.component'; +import { + MetadataFieldWrapperComponent +} from '../../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; +import { ThemedLoadingComponent } from '../../../../shared/loading/themed-loading.component'; +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 @@ -19,7 +29,17 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; */ @Component({ selector: 'ds-item-page-file-section', - templateUrl: './file-section.component.html' + templateUrl: './file-section.component.html', + imports: [ + CommonModule, + ThemedFileDownloadLinkComponent, + MetadataFieldWrapperComponent, + ThemedLoadingComponent, + TranslateModule, + FileSizePipe, + VarDirective, + ], + 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 ba5a9e87c0d..80d2ba8ba77 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 @@ -6,6 +6,7 @@ import {Item} from '../../../../core/shared/item.model'; @Component({ selector: 'ds-themed-item-page-file-section', templateUrl: '../../../../shared/theme-support/themed.component.html', + 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 4fb88894401..035c7d13853 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 @@ -16,22 +16,22 @@ let fixture: ComponentFixture; describe('ItemPageAbstractFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), SharedModule, - ], - providers: [ + ItemPageAbstractFieldComponent + ], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [ItemPageAbstractFieldComponent], - 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 f29bef31a76..7f9842790e8 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 @@ -2,10 +2,17 @@ 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'; @Component({ - selector: 'ds-item-page-abstract-field', - templateUrl: '../item-page-field.component.html' + selector: 'ds-item-page-abstract-field', + templateUrl: '../item-page-field.component.html', + standalone: true, + imports: [ + MetadataValuesComponent, + AsyncPipe + ], }) /** * This component is used for displaying the abstract (dc.description.abstract) of an item 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 855a9951426..818dc5811ea 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 @@ -19,19 +19,18 @@ const mockValue = 'test value'; describe('ItemPageAuthorFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), ItemPageAuthorFieldComponent, MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [ItemPageAuthorFieldComponent, MetadataValuesComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemPageAuthorFieldComponent, { + ], + 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 2da0dc154b5..aad5297f8a3 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 @@ -2,10 +2,17 @@ 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'; @Component({ selector: 'ds-item-page-author-field', - templateUrl: '../item-page-field.component.html' + templateUrl: '../item-page-field.component.html', + standalone: true, + imports: [ + MetadataValuesComponent, + AsyncPipe + ], }) /** * This component is used for displaying the author (dc.contributor.author, dc.creator and 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 be124dab829..d9db5502156 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 @@ -19,19 +19,18 @@ const mockValue = 'test value'; describe('ItemPageDateFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), ItemPageDateFieldComponent, MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [ItemPageDateFieldComponent, MetadataValuesComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemPageDateFieldComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemPageDateFieldComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); 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 5a7d56b7dab..d712f409e1f 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 @@ -2,10 +2,17 @@ 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'; @Component({ - selector: 'ds-item-page-date-field', - templateUrl: '../item-page-field.component.html' + selector: 'ds-item-page-date-field', + templateUrl: '../item-page-field.component.html', + standalone: true, + imports: [ + MetadataValuesComponent, + AsyncPipe + ], }) /** * This component is used for displaying the issue date (dc.date.issued) metadata of an item 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 fdf5ac1bb54..fc1f28197e9 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 @@ -21,19 +21,18 @@ const mockFields = [mockField]; describe('GenericItemPageFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), GenericItemPageFieldComponent, MetadataValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [GenericItemPageFieldComponent, MetadataValuesComponent], - 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 53d2f6aa20d..53011978d25 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 @@ -2,10 +2,14 @@ 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'; @Component({ - selector: 'ds-generic-item-page-field', - templateUrl: '../item-page-field.component.html' + 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/item-page-field.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts index 15b7a9df212..e2706be0bd5 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 @@ -39,23 +39,23 @@ describe('ItemPageFieldComponent', () => { const buildTestEnvironment = async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule.withRoutes([]), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), SharedModule, - ], - providers: [ + ItemPageFieldComponent, MetadataValuesComponent + ], + providers: [ { provide: APP_CONFIG, useValue: appConfig }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [ItemPageFieldComponent, MetadataValuesComponent], - 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 fc526dabcc5..bc6d5497107 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 @@ -5,6 +5,8 @@ import { Observable } from 'rxjs'; import { BrowseDefinition } from '../../../../core/shared/browse-definition.model'; import { BrowseDefinitionDataService } from '../../../../core/browse/browse-definition-data.service'; import { getRemoteDataPayload } from '../../../../core/shared/operators'; +import { MetadataValuesComponent } from '../../../field-components/metadata-values/metadata-values.component'; +import { AsyncPipe } from '@angular/common'; /** * This component can be used to represent metadata on a simple item page. @@ -13,7 +15,12 @@ import { getRemoteDataPayload } from '../../../../core/shared/operators'; */ @Component({ - templateUrl: './item-page-field.component.html' + templateUrl: './item-page-field.component.html', + imports: [ + MetadataValuesComponent, + AsyncPipe + ], + 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 316e08e564d..c4a10398bfc 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 @@ -15,15 +15,14 @@ const mockValue = 'test value'; describe('ItemPageTitleFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [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 a8d9e8ad8e3..8011570e082 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 @@ -2,10 +2,14 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-item-page-title-field', - templateUrl: './item-page-title-field.component.html' + 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 7007b8fed3f..cd730463100 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 @@ -7,9 +7,10 @@ import { Item } from '../../../../../core/shared/item.model'; * Themed wrapper for {@link ItemPageTitleFieldComponent} */ @Component({ - selector: 'ds-themed-item-page-title-field', - styleUrls: [], - templateUrl: '../../../../../shared/theme-support/themed.component.html', + 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 cc55b76e3e6..e9f370e56e1 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 @@ -20,19 +20,18 @@ const mockLabel = 'test label'; describe('ItemPageUriFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - providers: [ + imports: [TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), ItemPageUriFieldComponent, MetadataUriValuesComponent], + providers: [ { provide: APP_CONFIG, useValue: environment }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - declarations: [ItemPageUriFieldComponent, MetadataUriValuesComponent], - 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 b70cbbd5e88..ff6ea96ed65 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 @@ -2,10 +2,17 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../../../../core/shared/item.model'; 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' + templateUrl: './item-page-uri-field.component.html', + imports: [ + MetadataUriValuesComponent + ], + 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 b3202108f43..90ea41c2ba1 100644 --- a/src/app/item-page/simple/item-page.component.spec.ts +++ b/src/app/item-page/simple/item-page.component.spec.ts @@ -95,14 +95,13 @@ describe('ItemPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), BrowserAnimationsModule], - declarations: [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 }, @@ -113,10 +112,9 @@ describe('ItemPageComponent', () => { { provide: SignpostingDataService, useValue: signpostingDataService }, { provide: LinkHeadService, useValue: linkHeadService }, { provide: PLATFORM_ID, useValue: 'server' }, - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemPageComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemPageComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); diff --git a/src/app/item-page/simple/item-page.component.ts b/src/app/item-page/simple/item-page.component.ts index b9be6bebfb6..a981d6dd045 100644 --- a/src/app/item-page/simple/item-page.component.ts +++ b/src/app/item-page/simple/item-page.component.ts @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { isPlatformServer } from '@angular/common'; +import { AsyncPipe, isPlatformServer, NgIf } from '@angular/common'; import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; @@ -21,6 +21,17 @@ import { SignpostingDataService } from '../../core/data/signposting-data.service import { SignpostingLink } from '../../core/data/signposting-links.model'; import { isNotEmpty } from '../../shared/empty.util'; import { LinkDefinition, LinkHeadService } from '../../core/services/link-head.service'; +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'; /** * This component renders a simple item page. @@ -32,7 +43,21 @@ import { LinkDefinition, LinkHeadService } from '../../core/services/link-head.s styleUrls: ['./item-page.component.scss'], templateUrl: './item-page.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - animations: [fadeInOut] + animations: [fadeInOut], + standalone: true, + imports: [ + VarDirective, + ThemedItemAlertsComponent, + ItemVersionsNoticeComponent, + ViewTrackerComponent, + ListableObjectComponentLoaderComponent, + ItemVersionsComponent, + ErrorComponent, + ThemedLoadingComponent, + TranslateModule, + AsyncPipe, + NgIf + ] }) 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 211ec102bc4..ecf80633e9d 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 @@ -62,17 +62,17 @@ describe('PublicationComponent', () => { } }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), RouterTestingModule, - ], - declarations: [PublicationComponent, GenericItemPageFieldComponent, TruncatePipe], - providers: [ + PublicationComponent, GenericItemPageFieldComponent, TruncatePipe + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: {} }, @@ -93,10 +93,9 @@ describe('PublicationComponent', () => { { provide: SearchService, useValue: {} }, { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PublicationComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PublicationComponent, { set: {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 bd0d3711831..0c2c10540db 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,7 +1,39 @@ import { ChangeDetectionStrategy, 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 { + listableObjectComponent +} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ItemComponent } from '../shared/item.component'; +import { + ThemedResultsBackButtonComponent +} from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { + ThemedItemPageTitleFieldComponent +} from '../../field-components/specific-field/title/themed-item-page-field.component'; +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 { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; +import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; +import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; +import { + ThemedMetadataRepresentationListComponent +} from '../../metadata-representation-list/themed-metadata-representation-list.component'; +import { + GenericItemPageFieldComponent +} from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { RelatedItemsComponent } from '../../related-items/related-items-component'; +import { + ItemPageAbstractFieldComponent +} from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; +import { CollectionsComponent } from '../../../field-components/collections/collections.component'; +import { RouterLink } from '@angular/router'; +import { CommonModule } from '@angular/common'; /** * Component that represents a publication Item page @@ -13,6 +45,27 @@ import { ItemComponent } from '../shared/item.component'; styleUrls: ['./publication.component.scss'], templateUrl: './publication.component.html', changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + CommonModule, + ThemedResultsBackButtonComponent, + MiradorViewerComponent, + ThemedItemPageTitleFieldComponent, + DsoEditMenuComponent, + MetadataFieldWrapperComponent, + ThemedThumbnailComponent, + ThemedMediaViewerComponent, + ThemedFileSectionComponent, + ItemPageDateFieldComponent, + ThemedMetadataRepresentationListComponent, + GenericItemPageFieldComponent, + RelatedItemsComponent, + ItemPageAbstractFieldComponent, + TranslateModule, + ItemPageUriFieldComponent, + CollectionsComponent, + RouterLink + ] }) 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 5bf08fc0047..8b2f104eeed 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 @@ -100,43 +100,42 @@ export function getItemPageFieldsTest(mockItem: Item, component) { }); TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot({ - loader: { + imports: [ + TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: TranslateLoaderMock - } - }), - RouterTestingModule, - ], - declarations: [component, GenericItemPageFieldComponent, TruncatePipe], - providers: [ - { provide: ItemDataService, useValue: {} }, - { provide: TruncatableService, useValue: {} }, - { provide: RelationshipDataService, useValue: {} }, - { 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: VersionHistoryDataService, useValue: {} }, - { provide: VersionDataService, useValue: {} }, - { provide: NotificationsService, useValue: {} }, - { provide: DefaultChangeAnalyzer, useValue: {} }, - { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - { provide: WorkspaceitemDataService, useValue: {} }, - { provide: SearchService, useValue: {} }, - { provide: RouteService, useValue: mockRouteService }, - { provide: AuthorizationDataService, useValue: authorizationService }, - { provide: ResearcherProfileDataService, useValue: {} }, - { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(component, { + } + }), + RouterTestingModule, + component, GenericItemPageFieldComponent, TruncatePipe + ], + providers: [ + { provide: ItemDataService, useValue: {} }, + { provide: TruncatableService, useValue: {} }, + { provide: RelationshipDataService, useValue: {} }, + { 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: VersionHistoryDataService, useValue: {} }, + { provide: VersionDataService, useValue: {} }, + { provide: NotificationsService, useValue: {} }, + { provide: DefaultChangeAnalyzer, useValue: {} }, + { provide: BitstreamDataService, useValue: mockBitstreamDataService }, + { provide: WorkspaceitemDataService, useValue: {} }, + { provide: SearchService, useValue: {} }, + { provide: RouteService, useValue: mockRouteService }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: ResearcherProfileDataService, useValue: {} }, + { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(component, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -420,41 +419,41 @@ describe('ItemComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot({ + imports: [ + TranslateModule.forRoot({ loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock + provide: TranslateLoader, + useClass: TranslateLoaderMock } - }), - RouterTestingModule, - ], - declarations: [ItemComponent, GenericItemPageFieldComponent, TruncatePipe ], - providers: [ - { provide: ItemDataService, useValue: {} }, - { provide: TruncatableService, useValue: {} }, - { provide: RelationshipDataService, useValue: {} }, - { 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: VersionHistoryDataService, useValue: {} }, - { provide: VersionDataService, useValue: {} }, - { provide: NotificationsService, useValue: {} }, - { provide: DefaultChangeAnalyzer, useValue: {} }, - { provide: BitstreamDataService, useValue: {} }, - { provide: WorkspaceitemDataService, useValue: {} }, - { provide: SearchService, useValue: {} }, - { provide: RouteService, useValue: mockRouteService }, - { provide: AuthorizationDataService, useValue: {} }, - { provide: ResearcherProfileDataService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemComponent, { + }), + RouterTestingModule, + ItemComponent, GenericItemPageFieldComponent, TruncatePipe + ], + providers: [ + { provide: ItemDataService, useValue: {} }, + { provide: TruncatableService, useValue: {} }, + { provide: RelationshipDataService, useValue: {} }, + { 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: VersionHistoryDataService, useValue: {} }, + { provide: VersionDataService, useValue: {} }, + { provide: NotificationsService, useValue: {} }, + { provide: DefaultChangeAnalyzer, useValue: {} }, + { provide: BitstreamDataService, useValue: {} }, + { provide: WorkspaceitemDataService, useValue: {} }, + { provide: SearchService, useValue: {} }, + { provide: RouteService, useValue: mockRouteService }, + { provide: AuthorizationDataService, useValue: {} }, + { provide: ResearcherProfileDataService, useValue: {} }, + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemComponent, { set: {changeDetection: ChangeDetectionStrategy.Default} }); })); 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 93e6a0b3465..543b92c35e9 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 @@ -9,8 +9,9 @@ import { filter, map, take } from 'rxjs/operators'; import { Router } from '@angular/router'; @Component({ - selector: 'ds-item', - template: '' + 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 4b7da40abe2..bc1ae677869 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 @@ -63,17 +63,17 @@ describe('UntypedItemComponent', () => { } }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), RouterTestingModule, - ], - declarations: [UntypedItemComponent, GenericItemPageFieldComponent, TruncatePipe ], - providers: [ + UntypedItemComponent, GenericItemPageFieldComponent, TruncatePipe + ], + providers: [ { provide: ItemDataService, useValue: {} }, { provide: TruncatableService, useValue: {} }, { provide: RelationshipDataService, useValue: {} }, @@ -96,9 +96,9 @@ describe('UntypedItemComponent', () => { { provide: ItemVersionsSharedService, useValue: {} }, { provide: RouteService, useValue: mockRouteService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(UntypedItemComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(UntypedItemComponent, { set: {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 ead62008dee..5da5734c7c0 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,8 +1,39 @@ import { ChangeDetectionStrategy, 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 { + listableObjectComponent +} from '../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { ItemComponent } from '../shared/item.component'; +import { + ThemedItemPageTitleFieldComponent +} from '../../field-components/specific-field/title/themed-item-page-field.component'; +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 { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-viewer.component'; +import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; +import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; +import { + ThemedMetadataRepresentationListComponent +} from '../../metadata-representation-list/themed-metadata-representation-list.component'; +import { + GenericItemPageFieldComponent +} from '../../field-components/specific-field/generic/generic-item-page-field.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; +import { + ThemedResultsBackButtonComponent +} from '../../../../shared/results-back-button/themed-results-back-button.component'; +import { CollectionsComponent } from '../../../field-components/collections/collections.component'; +import { RouterLink } from '@angular/router'; +import { ItemPageUriFieldComponent } from '../../field-components/specific-field/uri/item-page-uri-field.component'; +import { CommonModule } from '@angular/common'; +import { + ItemPageAbstractFieldComponent +} from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; /** * Component that represents a publication Item page @@ -14,6 +45,26 @@ import { ItemComponent } from '../shared/item.component'; styleUrls: ['./untyped-item.component.scss'], templateUrl: './untyped-item.component.html', changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + CommonModule, + ThemedItemPageTitleFieldComponent, + DsoEditMenuComponent, + MetadataFieldWrapperComponent, + ThemedThumbnailComponent, + ThemedMediaViewerComponent, + ThemedFileSectionComponent, + ItemPageDateFieldComponent, + ThemedMetadataRepresentationListComponent, + GenericItemPageFieldComponent, + TranslateModule, + MiradorViewerComponent, + ThemedResultsBackButtonComponent, + CollectionsComponent, + RouterLink, + ItemPageUriFieldComponent, + ItemPageAbstractFieldComponent + ] }) 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 180eaaa2be6..bc9b4bfbbd5 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 @@ -103,14 +103,13 @@ describe('MetadataRepresentationListComponent', () => { }; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [MetadataRepresentationListComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), MetadataRepresentationListComponent, VarDirective], + providers: [ { provide: RelationshipDataService, useValue: relationshipService }, { provide: BrowseDefinitionDataService, useValue: BrowseDefinitionDataServiceStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MetadataRepresentationListComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MetadataRepresentationListComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).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 59a5377f772..cf06f59d0f0 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 @@ -15,10 +15,18 @@ import { } from '../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; 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 { NgFor, NgIf, AsyncPipe } from '@angular/common'; +import { MetadataFieldWrapperComponent } from '../../../shared/metadata-field-wrapper/metadata-field-wrapper.component'; @Component({ - selector: 'ds-metadata-representation-list', - templateUrl: './metadata-representation-list.component.html' + 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 a290b82dd9d..8f1fd9e900e 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 @@ -4,9 +4,10 @@ import { Component, Input } from '@angular/core'; import { Item } from '../../../core/shared/item.model'; @Component({ - selector: 'ds-themed-metadata-representation-list', - styleUrls: [], - templateUrl: '../../../shared/theme-support/themed.component.html', + 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/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 a9fd11b9eec..142e1b9988b 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 @@ -19,10 +19,9 @@ describe('RelatedEntitiesSearchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [RelatedEntitiesSearchComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, RelatedEntitiesSearchComponent], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 a3f76c12d77..f5faf6b9857 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 @@ -2,10 +2,13 @@ import { Component, Input, OnInit } from '@angular/core'; import { Item } from '../../../../core/shared/item.model'; 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' + 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 f7b9fb68e82..22348b85621 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 @@ -29,19 +29,18 @@ describe('TabbedRelatedEntitiesSearchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, NgbModule], - declarations: [TabbedRelatedEntitiesSearchComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, NgbModule, TabbedRelatedEntitiesSearchComponent, VarDirective], + providers: [ { - provide: ActivatedRoute, - useValue: { - queryParams: observableOf({ tab: mockRelationType }) - }, + provide: ActivatedRoute, + useValue: { + queryParams: observableOf({ tab: mockRelationType }) + }, }, { provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 116c8c2d79f..515e89f706c 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 @@ -3,10 +3,17 @@ import { Item } from '../../../../core/shared/item.model'; import { ActivatedRoute, Router } from '@angular/router'; 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 { NgIf, NgFor, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-tabbed-related-entities-search', - templateUrl: './tabbed-related-entities-search.component.html' + 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 2746670abe2..9b704de9ff4 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 @@ -9,12 +9,19 @@ import { AbstractIncrementalListComponent } from '../abstract-incremental-list/a import { FindListOptions } from '../../../core/data/find-list-options.model'; import { setPlaceHolderAttributes } from '../../../shared/utils/object-list-utils'; import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; -import { isPlatformBrowser } from '@angular/common'; +import { isPlatformBrowser, NgClass, NgFor, NgIf, AsyncPipe } from '@angular/common'; +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'; @Component({ - selector: 'ds-related-items', - styleUrls: ['./related-items.component.scss'], - templateUrl: './related-items.component.html' + 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 4307c1aaa22..50b57a780ce 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 @@ -55,14 +55,13 @@ describe('RelatedItemsComponent', () => { ); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [RelatedItemsComponent, VarDirective], - providers: [ + imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], + providers: [ { provide: RelationshipDataService, useValue: relationshipService }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(RelatedItemsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(RelatedItemsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -128,14 +127,13 @@ describe('RelatedItemsComponent', () => { ); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [RelatedItemsComponent, VarDirective], - providers: [ - {provide: RelationshipDataService, useValue: relationshipService}, - {provide: APP_CONFIG, useValue: enviromentNoThumbs} - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(RelatedItemsComponent, { + imports: [TranslateModule.forRoot(), RelatedItemsComponent, VarDirective], + providers: [ + { provide: RelationshipDataService, useValue: relationshipService }, + { provide: APP_CONFIG, useValue: enviromentNoThumbs } + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(RelatedItemsComponent, { set: {changeDetection: ChangeDetectionStrategy.Default} }).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 5bb26fafc95..e28de90a201 100644 --- a/src/app/item-page/simple/themed-item-page.component.ts +++ b/src/app/item-page/simple/themed-item-page.component.ts @@ -6,9 +6,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', + 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 b1dd8bc1611..c38de272a25 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 @@ -25,7 +25,10 @@ const mockVersion: Version = Object.assign(new Version(), { version: 1, }); -@Component({ template: '' }) +@Component({ + template: '', + standalone: true +}) class DummyComponent { } @@ -44,14 +47,13 @@ describe('VersionPageComponent', () => { setRedirectUrl: {} }); TestBed.configureTestingModule({ - declarations: [VersionPageComponent, DummyComponent], - imports: [RouterTestingModule.withRoutes([{ path: 'items/item-uuid', component: DummyComponent, pathMatch: 'full' }])], - 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 7f250343512..ae11f8adf0b 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 @@ -13,9 +13,10 @@ import { getPageNotFoundRoute } from '../../../app-routing-paths'; import { redirectOn4xx } from '../../../core/shared/authorized.operators'; @Component({ - selector: 'ds-version-page', - templateUrl: './version-page.component.html', - styleUrls: ['./version-page.component.scss'] + 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 8a0d4a58d98..6319949be2a 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 @@ -11,12 +11,11 @@ describe('ItemVersionsDeleteModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ItemVersionsDeleteModalComponent], - imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]) ], - 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 3aa1bbd49f3..fc64da2f2b9 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 @@ -1,10 +1,13 @@ import { Component, EventEmitter, Output } from '@angular/core'; 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'] + 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 657e8c0e75e..eb1abbbc943 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 @@ -11,12 +11,11 @@ describe('ItemVersionsSummaryModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ItemVersionsSummaryModalComponent ], - imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]) ], - 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 8f2c7bd62e5..4ac459cb94d 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 @@ -2,11 +2,17 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; 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'] + 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 e46f1585d7b..dc929d6d808 100644 --- a/src/app/item-page/versions/item-versions.component.spec.ts +++ b/src/app/item-page/versions/item-versions.component.spec.ts @@ -136,24 +136,23 @@ describe('ItemVersionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemVersionsComponent, VarDirective], - imports: [TranslateModule.forRoot(), CommonModule, FormsModule, ReactiveFormsModule, BrowserModule, ItemSharedModule], - 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}, + imports: [TranslateModule.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: Router, useValue: routerSpy }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); versionHistoryService = TestBed.inject(VersionHistoryDataService); authenticationService = TestBed.inject(AuthService); diff --git a/src/app/item-page/versions/item-versions.component.ts b/src/app/item-page/versions/item-versions.component.ts index e7ee9d5ea29..8d34f03d9f4 100644 --- a/src/app/item-page/versions/item-versions.component.ts +++ b/src/app/item-page/versions/item-versions.component.ts @@ -32,15 +32,15 @@ import { getItemPageRoute, getItemVersionRoute } from '../item-page-routing-paths'; -import { UntypedFormBuilder } from '@angular/forms'; +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 } from '@ngx-translate/core'; +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 } from '@angular/router'; +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'; @@ -48,11 +48,17 @@ import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model' import { WorkspaceitemDataService } from '../../core/submission/workspaceitem-data.service'; import { WorkflowItemDataService } from '../../core/submission/workflowitem-data.service'; import { ConfigurationDataService } from '../../core/data/configuration-data.service'; +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'; @Component({ - selector: 'ds-item-versions', - templateUrl: './item-versions.component.html', - styleUrls: ['./item-versions.component.scss'] + 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 577844488d2..a6a70a4fc6a 100644 --- a/src/app/item-page/versions/item-versions.module.ts +++ b/src/app/item-page/versions/item-versions.module.ts @@ -17,15 +17,13 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - SharedModule, - ], - declarations: [ - ...DECLARATIONS, - ], - exports: [ - ...DECLARATIONS, - ], + imports: [ + SharedModule, + ...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 fb29e54a217..787244a47cf 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 @@ -59,13 +59,12 @@ describe('ItemVersionsNoticeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemVersionsNoticeComponent], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ItemVersionsNoticeComponent], + providers: [ { provide: VersionHistoryDataService, useValue: versionHistoryServiceSpy } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0e5e45806b7..9f34c15752f 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 @@ -14,10 +14,15 @@ import { map, startWith, switchMap } from 'rxjs/operators'; import { VersionHistoryDataService } from '../../../core/data/version-history-data.service'; import { AlertType } from '../../../shared/alert/alert-type'; 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' + 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.component.spec.ts b/src/app/login-page/login-page.component.spec.ts index baaa3430ac9..c02a5d30326 100644 --- a/src/app/login-page/login-page.component.spec.ts +++ b/src/app/login-page/login-page.component.spec.ts @@ -25,16 +25,16 @@ describe('LoginPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [LoginPageComponent], - providers: [ + imports: [ + TranslateModule.forRoot(), + LoginPageComponent + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Store, useValue: store } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/login-page/login-page.component.ts b/src/app/login-page/login-page.component.ts index f618f5329e6..656ff2cd793 100644 --- a/src/app/login-page/login-page.component.ts +++ b/src/app/login-page/login-page.component.ts @@ -15,14 +15,18 @@ import { import { hasValue, isNotEmpty } from '../shared/empty.util'; import { AuthTokenInfo } from '../core/auth/models/auth-token-info.model'; import { isAuthenticated } from '../core/auth/selectors'; +import { TranslateModule } from '@ngx-translate/core'; +import { LogInComponent } from '../shared/log-in/log-in.component'; /** * This component represents the login page */ @Component({ - selector: 'ds-login-page', - styleUrls: ['./login-page.component.scss'], - templateUrl: './login-page.component.html' + selector: 'ds-login-page', + styleUrls: ['./login-page.component.scss'], + templateUrl: './login-page.component.html', + standalone: true, + imports: [LogInComponent, TranslateModule] }) export class LoginPageComponent implements OnDestroy, OnInit { diff --git a/src/app/login-page/login-page.module.ts b/src/app/login-page/login-page.module.ts index 4facc82df18..58f4ee6108a 100644 --- a/src/app/login-page/login-page.module.ts +++ b/src/app/login-page/login-page.module.ts @@ -6,15 +6,13 @@ import { LoginPageRoutingModule } from './login-page-routing.module'; import { ThemedLoginPageComponent } from './themed-login-page.component'; @NgModule({ - imports: [ - LoginPageRoutingModule, - CommonModule, - SharedModule, - ], - declarations: [ - LoginPageComponent, - ThemedLoginPageComponent - ] + imports: [ + LoginPageRoutingModule, + CommonModule, + SharedModule, + LoginPageComponent, + ThemedLoginPageComponent + ] }) export class LoginPageModule { diff --git a/src/app/login-page/themed-login-page.component.ts b/src/app/login-page/themed-login-page.component.ts index e314b4a3f7b..04badb1cf2d 100644 --- a/src/app/login-page/themed-login-page.component.ts +++ b/src/app/login-page/themed-login-page.component.ts @@ -6,9 +6,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' + 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.component.spec.ts b/src/app/logout-page/logout-page.component.spec.ts index 327e64b7569..1121f44ac1e 100644 --- a/src/app/logout-page/logout-page.component.spec.ts +++ b/src/app/logout-page/logout-page.component.spec.ts @@ -10,12 +10,12 @@ describe('LogoutPageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [LogoutPageComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + TranslateModule.forRoot(), + LogoutPageComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/logout-page/logout-page.component.ts b/src/app/logout-page/logout-page.component.ts index 4fa4b9900a2..bdf7159345c 100644 --- a/src/app/logout-page/logout-page.component.ts +++ b/src/app/logout-page/logout-page.component.ts @@ -1,9 +1,13 @@ 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' + 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/logout-page.module.ts b/src/app/logout-page/logout-page.module.ts index 59a5459e7f0..289b06fa5cc 100644 --- a/src/app/logout-page/logout-page.module.ts +++ b/src/app/logout-page/logout-page.module.ts @@ -6,15 +6,13 @@ import { LogoutPageRoutingModule } from './logout-page-routing.module'; import { ThemedLogoutPageComponent } from './themed-logout-page.component'; @NgModule({ - imports: [ - LogoutPageRoutingModule, - CommonModule, - SharedModule, - ], - declarations: [ - LogoutPageComponent, - ThemedLogoutPageComponent - ] + imports: [ + LogoutPageRoutingModule, + CommonModule, + SharedModule, + LogoutPageComponent, + ThemedLogoutPageComponent + ] }) export class LogoutPageModule { diff --git a/src/app/logout-page/themed-logout-page.component.ts b/src/app/logout-page/themed-logout-page.component.ts index 8d4adfd243c..85f7e43618a 100644 --- a/src/app/logout-page/themed-logout-page.component.ts +++ b/src/app/logout-page/themed-logout-page.component.ts @@ -6,9 +6,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' + 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.module.ts b/src/app/lookup-by-id/lookup-by-id.module.ts index 8a09d369e88..bcc5f016771 100644 --- a/src/app/lookup-by-id/lookup-by-id.module.ts +++ b/src/app/lookup-by-id/lookup-by-id.module.ts @@ -7,18 +7,16 @@ import { DsoRedirectService } from '../core/data/dso-redirect.service'; import { ThemedObjectNotFoundComponent } from './objectnotfound/themed-objectnotfound.component'; @NgModule({ - imports: [ - LookupRoutingModule, - CommonModule, - SharedModule, - ], - declarations: [ - ObjectNotFoundComponent, - ThemedObjectNotFoundComponent - ], - providers: [ - DsoRedirectService, - ] + imports: [ + LookupRoutingModule, + CommonModule, + SharedModule, + ObjectNotFoundComponent, + ThemedObjectNotFoundComponent + ], + 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 f0139e92514..b506e952768 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts @@ -23,14 +23,14 @@ describe('ObjectNotFoundComponent', () => { describe('uuid request', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], providers: [ - {provide: ActivatedRoute, useValue: activatedRouteStub} - ], - declarations: [ObjectNotFoundComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + TranslateModule.forRoot(), + ObjectNotFoundComponent + ], providers: [ + { provide: ActivatedRoute, useValue: activatedRouteStub } + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { @@ -53,14 +53,14 @@ describe('ObjectNotFoundComponent', () => { describe( 'legacy handle request', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], providers: [ - {provide: ActivatedRoute, useValue: activatedRouteStubHandle} - ], - declarations: [ObjectNotFoundComponent], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + TranslateModule.forRoot(), + ObjectNotFoundComponent + ], providers: [ + { provide: ActivatedRoute, useValue: activatedRouteStubHandle } + ], + 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 bbab90f39dd..803a5d8cf34 100644 --- a/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts @@ -1,15 +1,18 @@ import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core'; -import { ActivatedRoute } 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 + 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 e2338d5f071..e562173deac 100644 --- a/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts +++ b/src/app/lookup-by-id/objectnotfound/themed-objectnotfound.component.ts @@ -6,9 +6,10 @@ import { ObjectNotFoundComponent } from './objectnotfound.component'; * Themed wrapper for ObjectNotFoundComponent */ @Component({ - selector: 'ds-themed-objnotfound', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 838d5a53c5b..04916392f8f 100644 --- a/src/app/menu.resolver.spec.ts +++ b/src/app/menu.resolver.spec.ts @@ -54,22 +54,21 @@ describe('MenuResolver', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule], - declarations: [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: NgbModal, useValue: { - open: () => {/*comment*/ + provide: NgbModal, useValue: { + open: () => { + } } - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }); + ], + 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 af043b447bf..27c6bae5a3d 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 @@ -105,24 +105,24 @@ describe('CollectionSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ CollectionSelectorComponent, CollectionDropdownComponent ], - providers: [ - {provide: CollectionDataService, useValue: collectionDataServiceMock}, - {provide: ElementRef, useClass: MockElementRef}, - {provide: NgbActiveModal, useValue: modal}, - {provide: ActivatedRoute, useValue: {}}, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + CollectionSelectorComponent, CollectionDropdownComponent + ], + providers: [ + { provide: CollectionDataService, useValue: collectionDataServiceMock }, + { provide: ElementRef, useClass: MockElementRef }, + { provide: NgbActiveModal, useValue: modal }, + { provide: ActivatedRoute, useValue: {} }, ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); 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 855dc9c36d7..0ec037cf750 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 @@ -3,6 +3,10 @@ import { Component } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; 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'; /** * This component displays the dialog that shows the list of selectable collections @@ -11,7 +15,12 @@ import { CollectionListEntry } from '../../shared/collection-dropdown/collection @Component({ selector: 'ds-collection-selector', templateUrl: './collection-selector.component.html', - styleUrls: ['./collection-selector.component.scss'] + styleUrls: ['./collection-selector.component.scss'], + imports: [ + ThemedCollectionDropdownComponent, + TranslateModule + ], + standalone: true }) export class CollectionSelectorComponent { 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 86d99fb8414..99553580fd4 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 @@ -78,22 +78,20 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { describe('With only one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - ], - declarations: [ - MyDSpaceNewExternalDropdownComponent, - TestComponent, - BrowserOnlyMockPipe - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, - { provide: Router, useValue: new RouterStub() }, - MyDSpaceNewExternalDropdownComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + CommonModule, + TranslateModule.forRoot(), + MyDSpaceNewExternalDropdownComponent, + TestComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, + { provide: Router, useValue: new RouterStub() }, + MyDSpaceNewExternalDropdownComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); const html = ``; @@ -130,22 +128,20 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { describe('With more than one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - ], - declarations: [ - MyDSpaceNewExternalDropdownComponent, - TestComponent, - BrowserOnlyMockPipe, - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - { provide: Router, useValue: new RouterStub() }, - MyDSpaceNewExternalDropdownComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + CommonModule, + TranslateModule.forRoot(), + MyDSpaceNewExternalDropdownComponent, + TestComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, + { provide: Router, useValue: new RouterStub() }, + MyDSpaceNewExternalDropdownComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); const html = ``; @@ -182,8 +178,10 @@ describe('MyDSpaceNewExternalDropdownComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 53beb746a1b..e6492e451f0 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 @@ -10,6 +10,11 @@ import { hasValue } from '../../../shared/empty.util'; import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +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'; /** * This component represents the 'Import metadata from external source' dropdown menu @@ -17,7 +22,16 @@ import { FindListOptions } from '../../../core/data/find-list-options.model'; @Component({ selector: 'ds-my-dspace-new-external-dropdown', styleUrls: ['./my-dspace-new-external-dropdown.component.scss'], - templateUrl: './my-dspace-new-external-dropdown.component.html' + templateUrl: './my-dspace-new-external-dropdown.component.html', + imports: [ + EntityDropdownComponent, + NgbDropdownModule, + AsyncPipe, + TranslateModule, + BrowserOnlyPipe, + NgIf + ], + 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 1ad8e6c0c36..c32e01f7ffe 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 @@ -82,22 +82,20 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { describe('With only one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - ], - declarations: [ - MyDSpaceNewSubmissionDropdownComponent, - TestComponent, - BrowserOnlyMockPipe, - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, - { provide: NgbModal, useValue: modalStub }, - MyDSpaceNewSubmissionDropdownComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + CommonModule, + TranslateModule.forRoot(), + MyDSpaceNewSubmissionDropdownComponent, + TestComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEmptyEntityTypeService() }, + { provide: NgbModal, useValue: modalStub }, + MyDSpaceNewSubmissionDropdownComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); const html = ``; @@ -134,22 +132,20 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { describe('With more than one Entity', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - CommonModule, - TranslateModule.forRoot(), - ], - declarations: [ - MyDSpaceNewSubmissionDropdownComponent, - TestComponent, - BrowserOnlyMockPipe, - ], - providers: [ - { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - { provide: NgbModal, useValue: modalStub }, - MyDSpaceNewSubmissionDropdownComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [ + CommonModule, + TranslateModule.forRoot(), + MyDSpaceNewSubmissionDropdownComponent, + TestComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ + { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, + { provide: NgbModal, useValue: modalStub }, + MyDSpaceNewSubmissionDropdownComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); const html = ``; @@ -187,8 +183,10 @@ describe('MyDSpaceNewSubmissionDropdownComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 133086c08b8..ebe8181da39 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 @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { Observable, of as observableOf, Subscription } from 'rxjs'; import { map, mergeMap, take } from 'rxjs/operators'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { EntityTypeDataService } from '../../../core/data/entity-type-data.service'; import { ItemType } from '../../../core/shared/item-relationships/item-type.model'; @@ -11,6 +11,10 @@ import { CreateItemParentSelectorComponent } from '../../../shared/dso-selector/ import { RemoteData } from '../../../core/data/remote-data'; import { PaginatedList } from '../../../core/data/paginated-list.model'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +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'; /** * This component represents the new submission dropdown @@ -18,7 +22,16 @@ import { FindListOptions } from '../../../core/data/find-list-options.model'; @Component({ selector: 'ds-my-dspace-new-submission-dropdown', styleUrls: ['./my-dspace-new-submission-dropdown.component.scss'], - templateUrl: './my-dspace-new-submission-dropdown.component.html' + templateUrl: './my-dspace-new-submission-dropdown.component.html', + imports: [ + EntityDropdownComponent, + NgbDropdownModule, + AsyncPipe, + TranslateModule, + BrowserOnlyPipe, + NgIf + ], + 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 ed61fab1d62..03d42839806 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 @@ -37,21 +37,19 @@ describe('MyDSpaceNewSubmissionComponent test', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), NgbModule, - RouterTestingModule - ], - declarations: [ + RouterTestingModule, MyDSpaceNewSubmissionComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: HALEndpointService, useValue: new HALEndpointServiceStub('workspaceitems') }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -64,9 +62,9 @@ describe('MyDSpaceNewSubmissionComponent test', () => { { provide: CookieService, useValue: new CookieServiceMock() }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, { provide: EntityTypeDataService, useValue: getMockEntityTypeService() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); describe('', () => { @@ -117,8 +115,11 @@ describe('MyDSpaceNewSubmissionComponent test', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 0694fc63bfe..6abe7b39c5f 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 @@ -16,6 +16,13 @@ import { CollectionSelectorComponent } from '../collection-selector/collection-s import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; import { UploaderError } from '../../shared/upload/uploader/uploader-error.model'; import { Router } from '@angular/router'; +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'; /** * This component represents the whole mydspace page header @@ -23,7 +30,14 @@ import { Router } from '@angular/router'; @Component({ selector: 'ds-my-dspace-new-submission', styleUrls: ['./my-dspace-new-submission.component.scss'], - templateUrl: './my-dspace-new-submission.component.html' + templateUrl: './my-dspace-new-submission.component.html', + imports: [ + MyDSpaceNewExternalDropdownComponent, + MyDSpaceNewSubmissionDropdownComponent, + UploaderComponent, + NgIf + ], + standalone: true }) export class MyDSpaceNewSubmissionComponent implements OnDestroy, OnInit { /** 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 34bf20d4621..ba9fcc012f1 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 @@ -42,14 +42,13 @@ describe('MyDSpacePageComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule], - declarations: [MyDSpacePageComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule, MyDSpacePageComponent], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { provide: MyDSpaceConfigurationService, useValue: myDSpaceConfigurationServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MyDSpacePageComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MyDSpacePageComponent, { set: { providers: [ { 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 c5176ef29e6..c6af2d246c7 100644 --- a/src/app/my-dspace-page/my-dspace-page.component.ts +++ b/src/app/my-dspace-page/my-dspace-page.component.ts @@ -11,6 +11,10 @@ import { ViewMode } from '../core/shared/view-mode.model'; import { MyDSpaceRequest } from '../core/data/request.models'; import { Context } from '../core/shared/context.model'; import { RoleType } from '../core/roles/role-types'; +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 { RoleDirective } from '../shared/roles/role.directive'; export const MYDSPACE_ROUTE = '/mydspace'; export const SEARCH_CONFIG_SERVICE: InjectionToken = new InjectionToken('searchConfigurationService'); @@ -28,7 +32,15 @@ export const SEARCH_CONFIG_SERVICE: InjectionToken = provide: SEARCH_CONFIG_SERVICE, useClass: MyDSpaceConfigurationService } - ] + ], + imports: [ + ThemedSearchComponent, + MyDSpaceNewSubmissionComponent, + AsyncPipe, + RoleDirective, + NgIf + ], + 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 6ad50af96a5..8049ec92662 100644 --- a/src/app/my-dspace-page/my-dspace-page.module.ts +++ b/src/app/my-dspace-page/my-dspace-page.module.ts @@ -26,20 +26,20 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - SearchModule, - MyDspacePageRoutingModule, - MyDspaceSearchModule.withEntryComponents(), - UploadModule, - ], - declarations: DECLARATIONS, - providers: [ - MyDSpaceGuard, - MyDSpaceConfigurationService - ], - exports: DECLARATIONS, + imports: [ + CommonModule, + SharedModule, + SearchModule, + MyDspacePageRoutingModule, + MyDspaceSearchModule.withEntryComponents(), + UploadModule, + ...DECLARATIONS + ], + providers: [ + MyDSpaceGuard, + MyDSpaceConfigurationService + ], + exports: DECLARATIONS }) /** diff --git a/src/app/my-dspace-page/my-dspace-search.module.ts b/src/app/my-dspace-page/my-dspace-search.module.ts index 71d1343a30d..115e0a4a533 100644 --- a/src/app/my-dspace-page/my-dspace-search.module.ts +++ b/src/app/my-dspace-page/my-dspace-search.module.ts @@ -54,17 +54,15 @@ const DECLARATIONS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - MyDspacePageRoutingModule, - MyDSpaceActionsModule, - ResearchEntitiesModule.withEntryComponents(), - JournalEntitiesModule.withEntryComponents(), - ], - declarations: [ - ...DECLARATIONS, - ] + imports: [ + CommonModule, + SharedModule, + MyDspacePageRoutingModule, + MyDSpaceActionsModule, + ResearchEntitiesModule.withEntryComponents(), + JournalEntitiesModule.withEntryComponents(), + ...DECLARATIONS + ] }) /** 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 55ebc51c8d6..e28396d7e68 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 @@ -6,9 +6,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' + 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 488c9ab2518..6f2b46c2505 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 @@ -19,14 +19,13 @@ describe('ExpandableNavbarSectionComponent', () => { describe('on larger screens', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ExpandableNavbarSectionComponent, TestComponent, VarDirective], - providers: [ - { provide: 'sectionDataProvider', useValue: {} }, - { provide: MenuService, useValue: menuService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(800) } - ] - }).overrideComponent(ExpandableNavbarSectionComponent, { + imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], + providers: [ + { provide: 'sectionDataProvider', useValue: {} }, + { provide: MenuService, useValue: menuService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(800) } + ] +}).overrideComponent(ExpandableNavbarSectionComponent, { set: { entryComponents: [TestComponent] } @@ -168,14 +167,13 @@ describe('ExpandableNavbarSectionComponent', () => { describe('on smaller, mobile screens', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ExpandableNavbarSectionComponent, TestComponent, VarDirective], - providers: [ - { provide: 'sectionDataProvider', useValue: {} }, - { provide: MenuService, useValue: menuService }, - { provide: HostWindowService, useValue: new HostWindowServiceStub(300) } - ] - }).overrideComponent(ExpandableNavbarSectionComponent, { + imports: [NoopAnimationsModule, ExpandableNavbarSectionComponent, TestComponent, VarDirective], + providers: [ + { provide: 'sectionDataProvider', useValue: {} }, + { provide: MenuService, useValue: menuService }, + { provide: HostWindowService, useValue: new HostWindowServiceStub(300) } + ] +}).overrideComponent(ExpandableNavbarSectionComponent, { set: { entryComponents: [TestComponent] } @@ -242,8 +240,9 @@ describe('ExpandableNavbarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 5bc69bcbb4e..241e1796251 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 @@ -6,15 +6,20 @@ import { first } from 'rxjs/operators'; import { HostWindowService } from '../../shared/host-window.service'; import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator'; 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'; /** * 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] + 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] }) @rendersSectionForMenu(MenuID.PUBLIC, true) 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 e33dca41049..395163517c4 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 @@ -8,10 +8,11 @@ import { MenuID } from '../../shared/menu/menu-id.model'; * Themed wrapper for ExpandableNavbarSectionComponent */ @Component({ - /* eslint-disable @angular-eslint/component-selector */ - selector: 'li[ds-themed-expandable-navbar-section]', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + /* eslint-disable @angular-eslint/component-selector */ + selector: 'li[ds-themed-expandable-navbar-section]', + styleUrls: [], + templateUrl: '../../shared/theme-support/themed.component.html', + standalone: true }) @rendersSectionForMenu(MenuID.PUBLIC, true) export class ThemedExpandableNavbarSectionComponent extends ThemedComponent { 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 122bf486360..9e1e3566d90 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.spec.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.spec.ts @@ -16,14 +16,13 @@ describe('NavbarSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [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] } @@ -47,8 +46,9 @@ describe('NavbarSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 9f75a96f6e7..24e3e8e3a0a 100644 --- a/src/app/navbar/navbar-section/navbar-section.component.ts +++ b/src/app/navbar/navbar-section/navbar-section.component.ts @@ -3,15 +3,18 @@ import { MenuSectionComponent } from '../../shared/menu/menu-section/menu-sectio import { MenuService } from '../../shared/menu/menu.service'; import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator'; import { MenuID } from '../../shared/menu/menu-id.model'; +import { NgComponentOutlet, AsyncPipe } from '@angular/common'; /** * Represents a non-expandable section in the navbar */ @Component({ - /* eslint-disable @angular-eslint/component-selector */ - selector: 'li[ds-navbar-section]', - templateUrl: './navbar-section.component.html', - styleUrls: ['./navbar-section.component.scss'] + /* eslint-disable @angular-eslint/component-selector */ + selector: 'li[ds-navbar-section]', + templateUrl: './navbar-section.component.html', + styleUrls: ['./navbar-section.component.scss'], + standalone: true, + imports: [NgComponentOutlet, AsyncPipe] }) @rendersSectionForMenu(MenuID.PUBLIC, false) 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 983eace0557..5cfd6dddef9 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/navbar/navbar.component.spec.ts @@ -113,14 +113,15 @@ describe('NavbarComponent', () => { }; TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), NoopAnimationsModule, ReactiveFormsModule, - RouterTestingModule], - declarations: [NavbarComponent], - providers: [ + RouterTestingModule, + NavbarComponent + ], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, { provide: MenuService, useValue: menuService }, @@ -129,9 +130,9 @@ describe('NavbarComponent', () => { { provide: BrowseService, useValue: { getBrowseDefinitions: createSuccessfulRemoteDataObject$(buildPaginatedList(undefined, browseDefinitions)) } }, { provide: AuthorizationDataService, useValue: authorizationService }, provideMockStore({ initialState }), - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 0cfad9e431b..abd844b0396 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -12,15 +12,21 @@ import { Observable } from 'rxjs'; import { select, Store } from '@ngrx/store'; import { AppState } from '../app.reducer'; import { isAuthenticated } from '../core/auth/selectors'; +import { TranslateModule } from '@ngx-translate/core'; +import { UserMenuComponent } from '../shared/auth-nav-menu/user-menu/user-menu.component'; +import { NgClass, NgIf, NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; /** * Component representing the public navbar */ @Component({ - selector: 'ds-navbar', - styleUrls: ['./navbar.component.scss'], - templateUrl: './navbar.component.html', - animations: [slideMobileNav] + selector: 'ds-navbar', + styleUrls: ['./navbar.component.scss'], + templateUrl: './navbar.component.html', + animations: [slideMobileNav], + standalone: true, + imports: [NgbDropdownModule, NgClass, NgIf, UserMenuComponent, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule] }) export class NavbarComponent extends MenuComponent { /** diff --git a/src/app/navbar/navbar.module.ts b/src/app/navbar/navbar.module.ts index de3244099d7..58b7c1a0089 100644 --- a/src/app/navbar/navbar.module.ts +++ b/src/app/navbar/navbar.module.ts @@ -26,25 +26,23 @@ const ENTRY_COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - MenuModule, - FormsModule, - EffectsModule.forFeature(effects), - CoreModule.forRoot() - ], - declarations: [ - ...ENTRY_COMPONENTS, - NavbarComponent, - ThemedNavbarComponent, - ], - providers: [], - exports: [ - ThemedNavbarComponent, - NavbarSectionComponent, - ThemedExpandableNavbarSectionComponent - ] + imports: [ + CommonModule, + SharedModule, + MenuModule, + FormsModule, + EffectsModule.forFeature(effects), + CoreModule.forRoot(), + ...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 43efdc181e1..5298eec1d4e 100644 --- a/src/app/navbar/themed-navbar.component.ts +++ b/src/app/navbar/themed-navbar.component.ts @@ -6,9 +6,10 @@ import { NavbarComponent } from './navbar.component'; * Themed wrapper for NavbarComponent */ @Component({ - selector: 'ds-themed-navbar', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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/page-error/page-error.component.spec.ts b/src/app/page-error/page-error.component.spec.ts index 0f876f31960..c5580b8176e 100644 --- a/src/app/page-error/page-error.component.spec.ts +++ b/src/app/page-error/page-error.component.spec.ts @@ -18,19 +18,19 @@ describe('PageErrorComponent', () => { }); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ PageErrorComponent ], - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 dea1b684074..371dadd0c14 100644 --- a/src/app/page-error/page-error.component.ts +++ b/src/app/page-error/page-error.component.ts @@ -1,14 +1,17 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +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 + 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 3bfc6bf1a17..41799eea0c4 100644 --- a/src/app/page-error/themed-page-error.component.ts +++ b/src/app/page-error/themed-page-error.component.ts @@ -6,9 +6,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', + 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 7ecb0a7609e..c65fdcd70f0 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,14 +1,17 @@ import { ChangeDetectionStrategy, Component } from '@angular/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 + 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 a5f9101b697..d0deff1ad6a 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 @@ -6,9 +6,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', + 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 b11de582694..ba3bff931d8 100644 --- a/src/app/pagenotfound/pagenotfound.component.ts +++ b/src/app/pagenotfound/pagenotfound.component.ts @@ -1,15 +1,19 @@ import { ServerResponseService } from '../core/services/server-response.service'; import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core'; import { AuthService } from '../core/auth/auth.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; /** * This component representing the `PageNotFound` DSpace page. */ @Component({ - selector: 'ds-pagenotfound', - styleUrls: ['./pagenotfound.component.scss'], - templateUrl: './pagenotfound.component.html', - changeDetection: ChangeDetectionStrategy.Default + 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 3d284b1d6d5..4509ebe2525 100644 --- a/src/app/pagenotfound/themed-pagenotfound.component.ts +++ b/src/app/pagenotfound/themed-pagenotfound.component.ts @@ -6,9 +6,10 @@ import { PageNotFoundComponent } from './pagenotfound.component'; * Themed wrapper for PageNotFoundComponent */ @Component({ - selector: 'ds-themed-pagenotfound', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 57b596b8b60..e249a36ebf0 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 @@ -16,12 +16,10 @@ describe('ProcessDetailFieldComponent', () => { title = 'fake.title.message'; TestBed.configureTestingModule({ - declarations: [ProcessDetailFieldComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - 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 f8015b67885..c9388c37067 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,8 +1,11 @@ import { Component, Input } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-process-detail-field', - templateUrl: './process-detail-field.component.html', + 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 9a0d89a8827..c82eda747af 100644 --- a/src/app/process-page/detail/process-detail.component.spec.ts +++ b/src/app/process-page/detail/process-detail.component.spec.ts @@ -142,12 +142,11 @@ describe('ProcessDetailComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProcessDetailComponent, ProcessDetailFieldComponent, VarDirective, FileSizePipe], - imports: [TranslateModule.forRoot()], - providers: [ + imports: [TranslateModule.forRoot(), ProcessDetailComponent, ProcessDetailFieldComponent, VarDirective, FileSizePipe], + providers: [ { - provide: ActivatedRoute, - useValue: { data: observableOf({ process: createSuccessfulRemoteDataObject(process) }), snapshot: { params: { id: 1 } } }, + provide: ActivatedRoute, + useValue: { data: observableOf({ process: createSuccessfulRemoteDataObject(process) }), snapshot: { params: { id: 1 } } }, }, { provide: ProcessDataService, useValue: processService }, { provide: BitstreamDataService, useValue: bitstreamDataService }, @@ -157,9 +156,9 @@ describe('ProcessDetailComponent', () => { { provide: NgbModal, useValue: modalService }, { provide: NotificationsService, useValue: notificationsService }, { provide: Router, useValue: router }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/detail/process-detail.component.ts b/src/app/process-page/detail/process-detail.component.ts index be0b6ad0f64..af376c36df7 100644 --- a/src/app/process-page/detail/process-detail.component.ts +++ b/src/app/process-page/detail/process-detail.component.ts @@ -1,6 +1,6 @@ import { HttpClient } from '@angular/common/http'; import { Component, Inject, NgZone, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject, interval, Observable, shareReplay, Subscription } from 'rxjs'; import { finalize, map, switchMap, take, tap } from 'rxjs/operators'; import { AuthService } from '../../core/auth/auth.service'; @@ -25,13 +25,20 @@ import { redirectOn4xx } from '../../core/shared/authorized.operators'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { getProcessListRoute } from '../process-page-routing.paths'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { followLink } from '../../shared/utils/follow-link-config.model'; -import { isPlatformBrowser } from '@angular/common'; +import { isPlatformBrowser, NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common'; +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'; @Component({ - selector: 'ds-process-detail', - templateUrl: './process-detail.component.html', + 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 10bc8294d33..08ec04ba888 100644 --- a/src/app/process-page/form/process-form.component.spec.ts +++ b/src/app/process-page/form/process-form.component.spec.ts @@ -51,23 +51,24 @@ describe('ProcessFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ProcessFormComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ProcessFormComponent + ], + providers: [ { provide: ScriptDataService, useValue: scriptService }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeBySubstring', 'removeByHrefSubstring']) }, { provide: Router, useValue: jasmine.createSpyObj('router', ['navigateByUrl']) }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); diff --git a/src/app/process-page/form/process-form.component.ts b/src/app/process-page/form/process-form.component.ts index 70eb3160a8e..bea17653978 100644 --- a/src/app/process-page/form/process-form.component.ts +++ b/src/app/process-page/form/process-form.component.ts @@ -3,24 +3,30 @@ import { Script } from '../scripts/script.model'; import { Process } from '../processes/process.model'; import { ProcessParameter } from '../processes/process-parameter.model'; import { ScriptDataService } from '../../core/data/processes/script-data.service'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { ScriptParameter } from '../scripts/script-parameter.model'; import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { RequestService } from '../../core/data/request.service'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { RemoteData } from '../../core/data/remote-data'; import { getProcessListRoute } from '../process-page-routing.paths'; import { isEmpty } from '../../shared/empty.util'; +import { NgIf, NgFor } from '@angular/common'; +import { ScriptHelpComponent } from './script-help/script-help.component'; +import { ProcessParametersComponent } from './process-parameters/process-parameters.component'; +import { ScriptsSelectComponent } from './scripts-select/scripts-select.component'; /** * Component to create a new script */ @Component({ - selector: 'ds-process-form', - templateUrl: './process-form.component.html', - styleUrls: ['./process-form.component.scss'], + 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 56fece56b40..7d4cc11b127 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 @@ -33,10 +33,9 @@ describe('ParameterSelectComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [FormsModule], - declarations: [ParameterSelectComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [FormsModule, ParameterSelectComponent], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); 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 e016d3442fc..2242ea5ab59 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,21 +1,25 @@ import { Component, EventEmitter, Input, Optional, Output } from '@angular/core'; import { ProcessParameter } from '../../../processes/process-parameter.model'; import { ScriptParameter } from '../../../scripts/script-parameter.model'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { controlContainerFactory } from '../../process-form.component'; +import { ParameterValueInputComponent } from '../parameter-value-input/parameter-value-input.component'; +import { NgFor, NgIf } from '@angular/common'; /** * 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]] - }] + 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] }) 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 38f119ad5bb..e4f9414c839 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 @@ -8,8 +8,8 @@ describe('BooleanValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [BooleanValueInputComponent] - }) + imports: [BooleanValueInputComponent] +}) .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 3f0a82b07a7..c869196f8ad 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,12 +7,13 @@ import { controlContainerFactory } from '../../../process-form.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'], - viewProviders: [ { provide: ControlContainer, - useFactory: controlContainerFactory, - deps: [[new Optional(), NgForm]] } ] + selector: 'ds-boolean-value-input', + templateUrl: './boolean-value-input.component.html', + styleUrls: ['./boolean-value-input.component.scss'], + 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 2264a0f3314..d2f49bc3532 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 @@ -12,16 +12,17 @@ describe('DateValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [DateValueInputComponent] - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 ce1414e8ad9..26fbb6c63b9 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,18 +1,22 @@ import { Component, Input, Optional } from '@angular/core'; import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { controlContainerFactory } from '../../../process-form.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; /** * 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]] } ] + 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 07aad6ce4e0..2fa6e8b9341 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 @@ -15,18 +15,18 @@ describe('FileValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [FileValueInputComponent, FileValueAccessorDirective, FileValidator], - schemas: [NO_ERRORS_SCHEMA] - - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 796a5de58e0..53da935d33a 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,18 +1,24 @@ import { Component, Optional } from '@angular/core'; import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { controlContainerFactory } from '../../../process-form.component'; +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'; /** * 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]] } ] + 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 a28e7798c17..ade94ec0f5c 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 @@ -35,15 +35,14 @@ describe('ParameterValueInputComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), ParameterValueInputComponent, BooleanValueInputComponent, StringValueInputComponent, @@ -51,9 +50,9 @@ describe('ParameterValueInputComponent', () => { DateValueInputComponent, FileValueAccessorDirective, FileValidator - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 ec29ee5e1e8..700b17adbde 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 @@ -3,17 +3,24 @@ import { ScriptParameterType } from '../../../scripts/script-parameter-type.mode import { ScriptParameter } from '../../../scripts/script-parameter.model'; import { ControlContainer, NgForm } from '@angular/forms'; import { controlContainerFactory } from '../../process-form.component'; +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'; /** * 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]] } ] + 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 6b7de9460dc..a3f5bc1cf4e 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 @@ -12,18 +12,18 @@ describe('StringValueInputComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [StringValueInputComponent], - providers: [ - ] - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 0424faec21e..919af1420cb 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,18 +1,22 @@ import { Component, Optional, Input } from '@angular/core'; import { ValueInputComponent } from '../value-input.component'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { controlContainerFactory } from '../../../process-form.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; /** * 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]] } ] + 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 b44479c14a4..2189e27304a 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 @@ -30,17 +30,18 @@ describe('ProcessParametersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ProcessParametersComponent, ParameterSelectComponent], - schemas: [NO_ERRORS_SCHEMA] - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 85b59f76447..16d27d88516 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 @@ -5,19 +5,24 @@ import { hasValue } from '../../../shared/empty.util'; import { ControlContainer, NgForm } from '@angular/forms'; import { ScriptParameter } from '../../scripts/script-parameter.model'; import { controlContainerFactory } from '../process-form.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { ParameterSelectComponent } from './parameter-select/parameter-select.component'; +import { NgIf, NgFor } from '@angular/common'; /** * 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]] - }] + 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 abfe8f9da1b..757e68d4892 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 @@ -29,17 +29,18 @@ describe('ScriptHelpComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ ScriptHelpComponent ], - schemas: [NO_ERRORS_SCHEMA] - }) + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ScriptHelpComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); 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 7e230a4a425..50749d61268 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,14 +1,18 @@ import { Component, Input } from '@angular/core'; import { Script } from '../../scripts/script.model'; import { ScriptParameterType } from '../../scripts/script-parameter-type.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgFor, NgTemplateOutlet, NgSwitch, NgSwitchCase } 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'] + 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 72dc4c93488..f5567ff2b24 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 @@ -34,22 +34,23 @@ describe('ScriptsSelectComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ScriptsSelectComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ScriptsSelectComponent + ], + providers: [ { provide: ScriptDataService, useValue: scriptService }, { provide: Router, useClass: RouterStub }, { provide: ActivatedRoute, useValue: new ActivatedRouteStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 4c7fe3bdf74..11afe917dea 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 @@ -7,8 +7,10 @@ import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../../core import { PaginatedList } from '../../../core/data/paginated-list.model'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { hasNoValue, hasValue } from '../../../shared/empty.util'; -import { ControlContainer, NgForm } from '@angular/forms'; +import { ControlContainer, NgForm, FormsModule } from '@angular/forms'; import { controlContainerFactory } from '../process-form.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, NgFor, AsyncPipe } from '@angular/common'; const SCRIPT_QUERY_PARAMETER = 'script'; @@ -16,12 +18,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]] } ] + 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 48f0f097a93..948d643c106 100644 --- a/src/app/process-page/new/new-process.component.spec.ts +++ b/src/app/process-page/new/new-process.component.spec.ts @@ -50,25 +50,26 @@ describe('NewProcessComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [NewProcessComponent, VarDirective], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + NewProcessComponent, VarDirective + ], + providers: [ { provide: ScriptDataService, useValue: scriptService }, { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: RequestService, useValue: {} }, { provide: ActivatedRoute, useValue: { snapshot: { queryParams: {} } } }, { provide: LinkService, useValue: {} }, { provide: ProcessDataService, useValue: {} }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); diff --git a/src/app/process-page/new/new-process.component.ts b/src/app/process-page/new/new-process.component.ts index f97ce1bc6b2..df96cef44ff 100644 --- a/src/app/process-page/new/new-process.component.ts +++ b/src/app/process-page/new/new-process.component.ts @@ -8,14 +8,19 @@ import { map, switchMap } from 'rxjs/operators'; import { LinkService } from '../../core/cache/builders/link.service'; import { followLink } from '../../shared/utils/follow-link-config.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'], + 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 94071c0e595..dd61cae071b 100644 --- a/src/app/process-page/overview/process-overview.component.spec.ts +++ b/src/app/process-page/overview/process-overview.component.spec.ts @@ -111,17 +111,16 @@ describe('ProcessOverviewComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProcessOverviewComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProcessOverviewComponent, VarDirective], + providers: [ { provide: ProcessDataService, useValue: processService }, { provide: EPersonDataService, useValue: ePersonService }, { provide: PaginationService, useValue: paginationService }, { provide: ProcessBulkDeleteService, useValue: processBulkDeleteService }, { provide: NgbModal, useValue: modalService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/process-page/overview/process-overview.component.ts b/src/app/process-page/overview/process-overview.component.ts index 7fa3b12dacc..feb3f78f697 100644 --- a/src/app/process-page/overview/process-overview.component.ts +++ b/src/app/process-page/overview/process-overview.component.ts @@ -15,10 +15,17 @@ import { ProcessBulkDeleteService } from './process-bulk-delete.service'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { hasValue } from '../../shared/empty.util'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +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 { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common'; @Component({ - selector: 'ds-process-overview', - templateUrl: './process-overview.component.html', + selector: 'ds-process-overview', + templateUrl: './process-overview.component.html', + standalone: true, + imports: [NgIf, RouterLink, PaginationComponent, NgFor, VarDirective, AsyncPipe, DatePipe, TranslateModule] }) /** * Component displaying a list of all processes in a paginated table diff --git a/src/app/process-page/process-page-shared.module.ts b/src/app/process-page/process-page-shared.module.ts index e666283e03b..70eb8d0ecf6 100644 --- a/src/app/process-page/process-page-shared.module.ts +++ b/src/app/process-page/process-page-shared.module.ts @@ -18,29 +18,27 @@ import { ProcessBreadcrumbResolver } from './process-breadcrumb.resolver'; import { ProcessFormComponent } from './form/process-form.component'; @NgModule({ - imports: [ - SharedModule, - ], - declarations: [ - NewProcessComponent, - ScriptsSelectComponent, - ScriptHelpComponent, - ParameterSelectComponent, - ProcessParametersComponent, - StringValueInputComponent, - ParameterValueInputComponent, - FileValueInputComponent, - BooleanValueInputComponent, - DateValueInputComponent, - ProcessOverviewComponent, - ProcessDetailComponent, - ProcessDetailFieldComponent, - ProcessFormComponent - ], - providers: [ - ProcessBreadcrumbResolver, - ProcessBreadcrumbsService - ] + imports: [ + SharedModule, + NewProcessComponent, + ScriptsSelectComponent, + ScriptHelpComponent, + ParameterSelectComponent, + ProcessParametersComponent, + StringValueInputComponent, + ParameterValueInputComponent, + FileValueInputComponent, + BooleanValueInputComponent, + DateValueInputComponent, + ProcessOverviewComponent, + ProcessDetailComponent, + ProcessDetailFieldComponent, + ProcessFormComponent + ], + providers: [ + ProcessBreadcrumbResolver, + ProcessBreadcrumbsService + ] }) export class ProcessPageSharedModule { 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 28433228185..35ff322bbea 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 @@ -105,16 +105,15 @@ describe('ProfileClaimItemModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 ca8efcafc7a..5a6fc04e212 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 @@ -16,13 +16,25 @@ import { CollectionElementLinkType } from '../../shared/object-collection/collec import { SearchObjects } from '../../shared/search/models/search-objects.model'; import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.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 */ @Component({ selector: 'ds-profile-claim-item-modal', - templateUrl: './profile-claim-item-modal.component.html' + templateUrl: './profile-claim-item-modal.component.html', + imports: [ + ListableObjectComponentLoaderComponent, + AsyncPipe, + TranslateModule, + NgForOf + ], + 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 1dc1db26cc3..a9b3be3d8ad 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 @@ -64,16 +64,15 @@ describe('ProfilePageMetadataFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProfilePageMetadataFormComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageMetadataFormComponent, VarDirective], + providers: [ { provide: EPersonDataService, useValue: epersonService }, { provide: TranslateService, useValue: translate }, { provide: NotificationsService, useValue: notificationsService }, FormBuilderService - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 c4e164a7e8b..eb16f235998 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 @@ -16,10 +16,17 @@ import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../core/sh import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; import { NotificationsService } from '../../shared/notifications/notifications.service'; import { environment } from '../../../environments/environment'; +import { FormComponent } from '../../shared/form/form.component'; +import { NgIf } from '@angular/common'; @Component({ selector: 'ds-profile-page-metadata-form', - templateUrl: './profile-page-metadata-form.component.html' + templateUrl: './profile-page-metadata-form.component.html', + imports: [ + FormComponent, + NgIf + ], + 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 9bb0d0a6e2f..67779e514ea 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 @@ -71,17 +71,16 @@ describe('ProfilePageResearcherFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProfilePageResearcherFormComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 d63360fbf4b..31a61aafca0 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 @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { map, mergeMap, switchMap, take, tap } from 'rxjs/operators'; @@ -19,10 +19,21 @@ import { isNotEmpty } from '../../shared/empty.util'; import { followLink } from '../../shared/utils/follow-link-config.model'; import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component'; import { NoContent } from '../../core/shared/NoContent.model'; +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', templateUrl: './profile-page-researcher-form.component.html', + imports: [ + NgIf, + AsyncPipe, + TranslateModule, + UiSwitchModule, + VarDirective + ], + standalone: true }) /** * Component for a user to create/delete or change their researcher profile. 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 866b9629861..b8b5d306d9e 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 @@ -31,15 +31,14 @@ describe('ProfilePageSecurityFormComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProfilePageSecurityFormComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ - {provide: EPersonDataService, useValue: epersonService}, - {provide: NotificationsService, useValue: notificationsService}, + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ProfilePageSecurityFormComponent, VarDirective], + providers: [ + { provide: EPersonDataService, useValue: epersonService }, + { provide: NotificationsService, useValue: notificationsService }, FormBuilderService - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 04292ea96ea..981b8c48b85 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,6 +1,6 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { UntypedFormGroup } from '@angular/forms'; import { hasValue, isEmpty } from '../../shared/empty.util'; import { EPersonDataService } from '../../core/eperson/eperson-data.service'; @@ -8,10 +8,18 @@ import { NotificationsService } from '../../shared/notifications/notifications.s import { map } from 'rxjs/operators'; import { Subscription } from 'rxjs'; import { debounceTimeWorkaround as debounceTime } from '../../core/shared/operators'; +import { FormComponent } from '../../shared/form/form.component'; +import { AlertComponent } from '../../shared/alert/alert.component'; @Component({ selector: 'ds-profile-page-security-form', - templateUrl: './profile-page-security-form.component.html' + templateUrl: './profile-page-security-form.component.html', + imports: [ + FormComponent, + AlertComponent, + TranslateModule + ], + 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 709ed56790a..99c8c136dcb 100644 --- a/src/app/profile-page/profile-page.component.spec.ts +++ b/src/app/profile-page/profile-page.component.spec.ts @@ -89,22 +89,22 @@ describe('ProfilePageComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ProfilePageComponent, VarDirective], - imports: [ + imports: [ StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - providers: [ + RouterTestingModule.withRoutes([]), + 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] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/profile-page/profile-page.component.ts b/src/app/profile-page/profile-page.component.ts index d49bdedb838..9a9e32d2c70 100644 --- a/src/app/profile-page/profile-page.component.ts +++ b/src/app/profile-page/profile-page.component.ts @@ -3,7 +3,7 @@ import { BehaviorSubject, Observable } from 'rxjs'; import { EPerson } from '../core/eperson/models/eperson.model'; import { ProfilePageMetadataFormComponent } from './profile-page-metadata-form/profile-page-metadata-form.component'; import { NotificationsService } from '../shared/notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { Group } from '../core/eperson/models/group.model'; import { RemoteData } from '../core/data/remote-data'; import { PaginatedList } from '../core/data/paginated-list.model'; @@ -19,11 +19,28 @@ import { FeatureID } from '../core/data/feature-authorization/feature-id'; import { ConfigurationDataService } from '../core/data/configuration-data.service'; import { ConfigurationProperty } from '../core/shared/configuration-property.model'; import { DSONameService } from '../core/breadcrumbs/dso-name.service'; +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'; @Component({ selector: 'ds-profile-page', styleUrls: ['./profile-page.component.scss'], - templateUrl: './profile-page.component.html' + templateUrl: './profile-page.component.html', + imports: [ + ProfilePageMetadataFormComponent, + ProfilePageSecurityFormComponent, + AsyncPipe, + TranslateModule, + ProfilePageResearcherFormComponent, + VarDirective, + NgIf, + NgForOf + ], + standalone: true }) /** * Component for a user to edit their profile information diff --git a/src/app/profile-page/profile-page.module.ts b/src/app/profile-page/profile-page.module.ts index 0e2902de33c..4f61a3a4d14 100644 --- a/src/app/profile-page/profile-page.module.ts +++ b/src/app/profile-page/profile-page.module.ts @@ -15,28 +15,26 @@ import { ProfileClaimItemModalComponent } from './profile-claim-item-modal/profi @NgModule({ - imports: [ - ProfilePageRoutingModule, - CommonModule, - SharedModule, - FormModule, - UiSwitchModule - ], - exports: [ - ProfilePageComponent, - ThemedProfilePageComponent, - ProfilePageMetadataFormComponent, - ProfilePageSecurityFormComponent, - ProfilePageResearcherFormComponent - ], - declarations: [ - ProfilePageComponent, - ThemedProfilePageComponent, - ProfileClaimItemModalComponent, - ProfilePageMetadataFormComponent, - ProfilePageSecurityFormComponent, - ProfilePageResearcherFormComponent - ] + imports: [ + ProfilePageRoutingModule, + CommonModule, + SharedModule, + FormModule, + UiSwitchModule, + ProfilePageComponent, + ThemedProfilePageComponent, + ProfileClaimItemModalComponent, + ProfilePageMetadataFormComponent, + ProfilePageSecurityFormComponent, + ProfilePageResearcherFormComponent + ], + exports: [ + ProfilePageComponent, + ThemedProfilePageComponent, + ProfilePageMetadataFormComponent, + ProfilePageSecurityFormComponent, + ProfilePageResearcherFormComponent + ] }) export class ProfilePageModule { diff --git a/src/app/profile-page/themed-profile-page.component.ts b/src/app/profile-page/themed-profile-page.component.ts index 2348d416cf7..478484b209c 100644 --- a/src/app/profile-page/themed-profile-page.component.ts +++ b/src/app/profile-page/themed-profile-page.component.ts @@ -6,9 +6,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' + 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/register-email-form/register-email-form.component.spec.ts b/src/app/register-email-form/register-email-form.component.spec.ts index 9e852d94913..d0809123ffb 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 @@ -61,19 +61,18 @@ describe('RegisterEmailFormComponent', () => { jasmine.getEnv().allowRespy(true); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule], - declarations: [RegisterEmailFormComponent], - providers: [ - {provide: Router, useValue: router}, - {provide: EpersonRegistrationService, useValue: epersonRegistrationService}, - {provide: ConfigurationDataService, useValue: configurationDataService}, - {provide: UntypedFormBuilder, useValue: new UntypedFormBuilder()}, - {provide: NotificationsService, useValue: notificationsService}, - {provide: CookieService, useValue: new CookieServiceMock()}, - {provide: GoogleRecaptchaService, useValue: googleRecaptchaService}, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailFormComponent], + providers: [ + { provide: Router, useValue: router }, + { provide: EpersonRegistrationService, useValue: epersonRegistrationService }, + { provide: ConfigurationDataService, useValue: configurationDataService }, + { provide: UntypedFormBuilder, useValue: new UntypedFormBuilder() }, + { provide: NotificationsService, useValue: notificationsService }, + { provide: CookieService, useValue: new CookieServiceMock() }, + { provide: GoogleRecaptchaService, useValue: googleRecaptchaService }, + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).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 df7e9bea5ef..ac05d323bff 100644 --- a/src/app/register-email-form/register-email-form.component.ts +++ b/src/app/register-email-form/register-email-form.component.ts @@ -1,9 +1,9 @@ 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 {TranslateService} from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import {Router} from '@angular/router'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators, ValidatorFn } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators, ValidatorFn, FormsModule, ReactiveFormsModule } from '@angular/forms'; import {Registration} from '../core/shared/registration.model'; import {RemoteData} from '../core/data/remote-data'; import {ConfigurationDataService} from '../core/data/configuration-data.service'; @@ -17,13 +17,18 @@ import {AlertType} from '../shared/alert/alert-type'; import {KlaroService} from '../shared/cookies/klaro.service'; import {CookieService} from '../core/services/cookie.service'; import { Subscription } from 'rxjs'; +import { GoogleRecaptchaComponent } from '../shared/google-recaptcha/google-recaptcha.component'; +import { AlertComponent } from '../shared/alert/alert.component'; +import { NgIf, AsyncPipe } from '@angular/common'; export const TYPE_REQUEST_FORGOT = 'forgot'; export const TYPE_REQUEST_REGISTER = 'register'; @Component({ - selector: 'ds-register-email-form', - templateUrl: './register-email-form.component.html' + 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 a7657594137..ce3724f3c16 100644 --- a/src/app/register-email-form/register-email-form.module.ts +++ b/src/app/register-email-form/register-email-form.module.ts @@ -4,17 +4,15 @@ import { SharedModule } from '../shared/shared.module'; import { RegisterEmailFormComponent } from './register-email-form.component'; @NgModule({ - imports: [ - CommonModule, - SharedModule - ], - declarations: [ - RegisterEmailFormComponent, - ], - providers: [], - exports: [ - RegisterEmailFormComponent, - ] + imports: [ + CommonModule, + SharedModule, + RegisterEmailFormComponent + ], + providers: [], + exports: [ + RegisterEmailFormComponent, + ] }) /** 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 d5a1fea8b2f..1e64dbef575 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 @@ -128,19 +128,18 @@ describe('CreateProfileComponent', () => { }); TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule], - declarations: [CreateProfileComponent], - 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}, - {provide: EndUserAgreementService, useValue: endUserAgreementService}, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), ReactiveFormsModule, CreateProfileComponent], + 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 }, + { provide: EndUserAgreementService, useValue: endUserAgreementService }, + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(CreateProfileComponent); 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 eaaa983a43d..9080666f5dc 100644 --- a/src/app/register-page/create-profile/create-profile.component.ts +++ b/src/app/register-page/create-profile/create-profile.component.ts @@ -3,8 +3,14 @@ import { ActivatedRoute, Router } from '@angular/router'; import { map } from 'rxjs/operators'; import { Registration } from '../../core/shared/registration.model'; import { Observable } from 'rxjs'; -import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +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'; import { LangConfig } from '../../../config/lang-config.interface'; @@ -20,6 +26,10 @@ import { } 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'; /** * Component that renders the create profile page to be used by a user registering through a token @@ -27,7 +37,16 @@ import { CoreState } from '../../core/core-state.model'; @Component({ selector: 'ds-create-profile', styleUrls: ['./create-profile.component.scss'], - templateUrl: './create-profile.component.html' + templateUrl: './create-profile.component.html', + imports: [ + ProfilePageSecurityFormComponent, + TranslateModule, + NgIf, + AsyncPipe, + ReactiveFormsModule, + NgForOf + ], + 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 cc968bfbe21..1966155f60b 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 @@ -6,9 +6,10 @@ import { ThemedComponent } from '../../shared/theme-support/themed.component'; * Themed wrapper for CreateProfileComponent */ @Component({ - selector: 'ds-themed-create-profile', - styleUrls: [], - templateUrl: './../../shared/theme-support/themed.component.html' + 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 17ef8101ae5..234951a6cc0 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 @@ -12,10 +12,9 @@ describe('RegisterEmailComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule], - declarations: [RegisterEmailComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + imports: [CommonModule, TranslateModule.forRoot(), ReactiveFormsModule, RegisterEmailComponent], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(RegisterEmailComponent); 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 228e8c56a06..2cb7a09cc67 100644 --- a/src/app/register-page/register-email/register-email.component.ts +++ b/src/app/register-page/register-email/register-email.component.ts @@ -1,10 +1,17 @@ import { Component } from '@angular/core'; -import { TYPE_REQUEST_REGISTER } from '../../register-email-form/register-email-form.component'; +import { + RegisterEmailFormComponent, + TYPE_REQUEST_REGISTER +} from '../../register-email-form/register-email-form.component'; @Component({ selector: 'ds-register-email', styleUrls: ['./register-email.component.scss'], - templateUrl: './register-email.component.html' + templateUrl: './register-email.component.html', + imports: [ + RegisterEmailFormComponent + ], + 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 6da6899d999..e56e2eba2c9 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 @@ -6,9 +6,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', + 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.module.ts b/src/app/register-page/register-page.module.ts index 6afb8154eae..ce29c7f8aec 100644 --- a/src/app/register-page/register-page.module.ts +++ b/src/app/register-page/register-page.module.ts @@ -10,20 +10,18 @@ import { ThemedCreateProfileComponent } from './create-profile/themed-create-pro import { ThemedRegisterEmailComponent } from './register-email/themed-register-email.component'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - RegisterPageRoutingModule, - RegisterEmailFormModule, - ProfilePageModule, - ], - declarations: [ - RegisterEmailComponent, - ThemedRegisterEmailComponent, - CreateProfileComponent, - ThemedCreateProfileComponent - ], - providers: [] + imports: [ + CommonModule, + SharedModule, + RegisterPageRoutingModule, + RegisterEmailFormModule, + ProfilePageModule, + RegisterEmailComponent, + ThemedRegisterEmailComponent, + CreateProfileComponent, + ThemedCreateProfileComponent + ], + providers: [] }) /** 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 ef5f83e46be..9bcd49499a4 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 @@ -99,9 +99,8 @@ describe('DenyRequestCopyComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); return TestBed.configureTestingModule({ - declarations: [DenyRequestCopyComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DenyRequestCopyComponent, VarDirective], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: AuthService, useValue: authService }, @@ -109,9 +108,9 @@ describe('DenyRequestCopyComponent', () => { { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: ItemRequestDataService, useValue: itemRequestService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 098c7a1efd7..5fbd01cceca 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 @@ -8,7 +8,7 @@ import { } from '../../core/shared/operators'; import { RemoteData } from '../../core/data/remote-data'; import { AuthService } from '../../core/auth/auth.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { combineLatest as observableCombineLatest } from 'rxjs'; import { ItemDataService } from '../../core/data/item-data.service'; import { EPerson } from '../../core/eperson/models/eperson.model'; @@ -19,11 +19,17 @@ import { ItemRequestDataService } from '../../core/data/item-request-data.servic 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 { VarDirective } from '../../shared/utils/var.directive'; @Component({ - selector: 'ds-deny-request-copy', - styleUrls: ['./deny-request-copy.component.scss'], - templateUrl: './deny-request-copy.component.html' + 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 1539d496225..b4d799b561c 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,9 +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', + 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 3857c0d91b3..8f6cf3b72cd 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 @@ -17,13 +17,12 @@ describe('EmailRequestCopyComponent', () => { location = jasmine.createSpyObj('location', ['back']); TestBed.configureTestingModule({ - declarations: [EmailRequestCopyComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), EmailRequestCopyComponent, VarDirective], + providers: [ { provide: Location, useValue: location }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 ab2c8b45265..aa2a2bcc7b3 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,11 +1,15 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { RequestCopyEmail } from './request-copy-email.model'; -import { Location } from '@angular/common'; +import { Location, NgClass, NgIf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; @Component({ - selector: 'ds-email-request-copy', - styleUrls: ['./email-request-copy.component.scss'], - templateUrl: './email-request-copy.component.html' + 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 d010e430605..546cc9eb07a 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 @@ -8,9 +8,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', + 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 5c37a86f24f..e3be11611c4 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 @@ -73,16 +73,15 @@ describe('GrantDenyRequestCopyComponent', () => { }); TestBed.configureTestingModule({ - declarations: [GrantDenyRequestCopyComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - 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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 b130c23abed..a6d3b3c27cb 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,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { map, switchMap } from 'rxjs/operators'; import { ItemRequest } from '../../core/shared/item-request.model'; import { Observable } from 'rxjs'; @@ -15,11 +15,17 @@ import { ItemDataService } from '../../core/data/item-data.service'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { getItemPageRoute } from '../../item-page/item-page-routing-paths'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; +import { TranslateModule } from '@ngx-translate/core'; +import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../../shared/utils/var.directive'; @Component({ - selector: 'ds-grant-deny-request-copy', - styleUrls: ['./grant-deny-request-copy.component.scss'], - templateUrl: './grant-deny-request-copy.component.html' + 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 32fef125eaf..ac31a459b0f 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 @@ -99,9 +99,8 @@ describe('GrantRequestCopyComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['success', 'error']); return TestBed.configureTestingModule({ - declarations: [GrantRequestCopyComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), GrantRequestCopyComponent, VarDirective], + providers: [ { provide: Router, useValue: router }, { provide: ActivatedRoute, useValue: route }, { provide: AuthService, useValue: authService }, @@ -109,9 +108,9 @@ describe('GrantRequestCopyComponent', () => { { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: ItemRequestDataService, useValue: itemRequestService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 baf078df76a..003a27dd361 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 @@ -8,16 +8,23 @@ import { } from '../../core/shared/operators'; import { RemoteData } from '../../core/data/remote-data'; import { AuthService } from '../../core/auth/auth.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { ItemRequestDataService } from '../../core/data/item-request-data.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 { FormsModule } from '@angular/forms'; +import { ThemedEmailRequestCopyComponent } from '../email-request-copy/themed-email-request-copy.component'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../../shared/utils/var.directive'; @Component({ - selector: 'ds-grant-request-copy', - styleUrls: ['./grant-request-copy.component.scss'], - templateUrl: './grant-request-copy.component.html' + 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 625dcef57a1..77b2d044f69 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 @@ -6,9 +6,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', + 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.module.ts b/src/app/request-copy/request-copy.module.ts index 90d741a8791..bfc57d7c44f 100644 --- a/src/app/request-copy/request-copy.module.ts +++ b/src/app/request-copy/request-copy.module.ts @@ -11,24 +11,22 @@ import { GrantRequestCopyComponent } from './grant-request-copy/grant-request-co import { ThemedGrantRequestCopyComponent } from './grant-request-copy/themed-grant-request-copy.component'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - RequestCopyRoutingModule - ], - declarations: [ - GrantDenyRequestCopyComponent, - DenyRequestCopyComponent, - ThemedDenyRequestCopyComponent, - EmailRequestCopyComponent, - ThemedEmailRequestCopyComponent, - GrantRequestCopyComponent, - ThemedGrantRequestCopyComponent, - ], - exports: [ - ThemedEmailRequestCopyComponent, - ], - providers: [] + imports: [ + CommonModule, + SharedModule, + RequestCopyRoutingModule, + GrantDenyRequestCopyComponent, + DenyRequestCopyComponent, + ThemedDenyRequestCopyComponent, + EmailRequestCopyComponent, + ThemedEmailRequestCopyComponent, + GrantRequestCopyComponent, + ThemedGrantRequestCopyComponent + ], + exports: [ + ThemedEmailRequestCopyComponent, + ], + providers: [] }) /** diff --git a/src/app/root.module.ts b/src/app/root.module.ts index a8af0ef5b5f..3d5fb651d2c 100644 --- a/src/app/root.module.ts +++ b/src/app/root.module.ts @@ -89,19 +89,17 @@ const EXPORTS = [ ]; @NgModule({ - imports: [ - ...IMPORTS - ], - providers: [ - ...PROVIDERS - ], - declarations: [ - ...DECLARATIONS, - ], - exports: [ - ...EXPORTS, - ...DECLARATIONS, - ] + imports: [ + ...IMPORTS, + ...DECLARATIONS + ], + providers: [ + ...PROVIDERS + ], + 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 ab148b8ebd3..60fdf8f6a91 100644 --- a/src/app/root/root.component.spec.ts +++ b/src/app/root/root.component.spec.ts @@ -34,19 +34,19 @@ describe('RootComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NoopAnimationsModule, StoreModule.forRoot(authReducer, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [RootComponent], // declare the test component - providers: [ + RootComponent + ], + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: MetadataService, useValue: new MetadataServiceMock() }, { provide: Angulartics2DSpace, useValue: new AngularticsProviderMock() }, @@ -60,9 +60,9 @@ describe('RootComponent', () => { provideMockStore({ core: { auth: { loading: false } } } as any), RootComponent, RouteService - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); }); beforeEach(() => { diff --git a/src/app/root/root.component.ts b/src/app/root/root.component.ts index 3c2d65fc1f5..a2d2d72e477 100644 --- a/src/app/root/root.component.ts +++ b/src/app/root/root.component.ts @@ -1,6 +1,6 @@ import { map, startWith } from 'rxjs/operators'; import { Component, Inject, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterOutlet } from '@angular/router'; import { combineLatest as combineLatestObservable, Observable, of } from 'rxjs'; import { Store } from '@ngrx/store'; @@ -20,12 +20,22 @@ import { slideSidebarPadding } from '../shared/animations/slide'; import { MenuID } from '../shared/menu/menu-id.model'; import { getPageInternalServerErrorRoute } from '../app-routing-paths'; import { hasValueOperator } from '../shared/empty.util'; +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 { NgIf, AsyncPipe } from '@angular/common'; +import { ThemedBreadcrumbsComponent } from '../breadcrumbs/themed-breadcrumbs.component'; +import { ThemedHeaderNavbarWrapperComponent } from '../header-nav-wrapper/themed-header-navbar-wrapper.component'; +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], + selector: 'ds-root', + templateUrl: './root.component.html', + styleUrls: ['./root.component.scss'], + animations: [slideSidebarPadding], + standalone: true, + imports: [ThemedAdminSidebarComponent, SystemWideAlertBannerComponent, ThemedHeaderNavbarWrapperComponent, ThemedBreadcrumbsComponent, NgIf, ThemedLoadingComponent, RouterOutlet, ThemedFooterComponent, NotificationsBoardComponent, AsyncPipe] }) export class RootComponent implements OnInit { sidebarVisible: Observable; diff --git a/src/app/root/themed-root.component.ts b/src/app/root/themed-root.component.ts index 5dfa1edf315..31c044aa8dd 100644 --- a/src/app/root/themed-root.component.ts +++ b/src/app/root/themed-root.component.ts @@ -3,9 +3,10 @@ import { RootComponent } from './root.component'; import { Component, Input } from '@angular/core'; @Component({ - selector: 'ds-themed-root', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 b67f5f0eb45..67ad7bc1861 100644 --- a/src/app/search-navbar/search-navbar.component.spec.ts +++ b/src/app/search-navbar/search-navbar.component.spec.ts @@ -34,25 +34,24 @@ describe('SearchNavbarComponent', () => { paginationService = new PaginationServiceStub(); TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, BrowserAnimationsModule, RouterTestingModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [ - SearchNavbarComponent, - BrowserOnlyMockPipe, - ], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + SearchNavbarComponent + ], + declarations: [BrowserOnlyMockPipe], + 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 98e64f6e10f..02a49bafd59 100644 --- a/src/app/search-navbar/search-navbar.component.ts +++ b/src/app/search-navbar/search-navbar.component.ts @@ -1,17 +1,22 @@ import { Component, ElementRef, ViewChild } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; +import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Router } from '@angular/router'; 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] + 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 a90e782194e..a65c56597ef 100644 --- a/src/app/search-navbar/themed-search-navbar.component.ts +++ b/src/app/search-navbar/themed-search-navbar.component.ts @@ -3,9 +3,10 @@ import { SearchNavbarComponent } from './search-navbar.component'; import { Component } from '@angular/core'; @Component({ - selector: 'ds-themed-search-navbar', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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.ts b/src/app/search-page/configuration-search-page.component.ts index 768149de6a8..0dd050aac5e 100644 --- a/src/app/search-page/configuration-search-page.component.ts +++ b/src/app/search-page/configuration-search-page.component.ts @@ -8,22 +8,32 @@ import { SearchConfigurationService } from '../core/shared/search/search-configu import { RouteService } from '../core/services/route.service'; import { SearchService } from '../core/shared/search/search.service'; import { Router } from '@angular/router'; +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'; /** * 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 - } - ] + 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.component.ts b/src/app/search-page/search-page.component.ts index 38647b779bc..2b8ac636405 100644 --- a/src/app/search-page/search-page.component.ts +++ b/src/app/search-page/search-page.component.ts @@ -1,16 +1,19 @@ import { Component } from '@angular/core'; import { SEARCH_CONFIG_SERVICE } from '../my-dspace-page/my-dspace-page.component'; import { SearchConfigurationService } from '../core/shared/search/search-configuration.service'; +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 - } - ] + 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 cc76d0427d8..df5d8fbeb90 100644 --- a/src/app/search-page/search-page.module.ts +++ b/src/app/search-page/search-page.module.ts @@ -19,23 +19,23 @@ const components = [ ]; @NgModule({ - imports: [ - CommonModule, - SearchModule, - SharedModule.withEntryComponents(), - CoreModule.forRoot(), - StatisticsModule.forRoot(), - JournalEntitiesModule.withEntryComponents(), - ResearchEntitiesModule.withEntryComponents() - ], - declarations: components, - providers: [ - SidebarService, - SearchFilterService, - ConfigurationSearchPageGuard, - SearchConfigurationService - ], - exports: components + imports: [ + CommonModule, + SearchModule, + SharedModule.withEntryComponents(), + CoreModule.forRoot(), + StatisticsModule.forRoot(), + JournalEntitiesModule.withEntryComponents(), + ResearchEntitiesModule.withEntryComponents(), + ...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 e367ee52387..45125c2e7f4 100644 --- a/src/app/search-page/themed-configuration-search-page.component.ts +++ b/src/app/search-page/themed-configuration-search-page.component.ts @@ -8,9 +8,10 @@ import { Context } from '../core/shared/context.model'; * Themed wrapper for ConfigurationSearchPageComponent */ @Component({ - selector: 'ds-themed-configuration-search-page', - styleUrls: [], - templateUrl: '../shared/theme-support/themed.component.html', + 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 12acd6174c3..afc2ec39436 100644 --- a/src/app/search-page/themed-search-page.component.ts +++ b/src/app/search-page/themed-search-page.component.ts @@ -6,9 +6,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', + 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/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 964eb30de24..aec8e8edcfb 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 @@ -16,9 +16,8 @@ describe('AccessControlArrayFormComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule ], - declarations: [ AccessControlArrayFormComponent, ToDatePipe ] - }) + imports: [CommonModule, FormsModule, SharedBrowseByModule, TranslateModule.forRoot(), NgbDatepickerModule, AccessControlArrayFormComponent, ToDatePipe] +}) .compileComponents(); }); 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 227de596ff2..3b00349685c 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,13 +1,19 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core'; -import {NgForm} from '@angular/forms'; +import { NgForm, FormsModule } from '@angular/forms'; 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' + 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 203d12a59d3..e2b23bb83c2 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 @@ -2,9 +2,10 @@ import {Pipe, PipeTransform} from '@angular/core'; import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap/datepicker/ngb-date-struct'; @Pipe({ - // eslint-disable-next-line @angular-eslint/pipe-prefix - name: 'toDate', - pure: false + // 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 4d02f7a52d8..3104f620e97 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 @@ -25,7 +25,16 @@ describe('AccessControlFormContainerComponent', () => { // Mock NgbModal - @Component({selector: 'ds-ngb-modal', template: ''}) + @Component({ + selector: 'ds-ngb-modal', template: '', + standalone: true, + imports: [CommonModule, + FormsModule, + SharedBrowseByModule, + AccessControlFormModule, + NgbDatepickerModule, + UiSwitchModule] +}) class MockNgbModalComponent { } @@ -52,23 +61,23 @@ describe('AccessControlFormContainerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AccessControlFormContainerComponent, MockNgbModalComponent], - imports: [ + imports: [ CommonModule, FormsModule, SharedBrowseByModule, AccessControlFormModule, TranslateModule.forRoot(), NgbDatepickerModule, - UiSwitchModule - ], - providers: [ - {provide: BulkAccessControlService, useValue: mockBulkAccessControlService}, - {provide: BulkAccessConfigDataService, useValue: mockBulkAccessConfigDataService}, - {provide: SelectableListService, useValue: mockSelectableListService}, - {provide: NgbModal, useValue: mockNgbModal}, - ], - }).compileComponents(); + UiSwitchModule, + AccessControlFormContainerComponent, MockNgbModalComponent + ], + providers: [ + { provide: BulkAccessControlService, useValue: mockBulkAccessControlService }, + { provide: BulkAccessConfigDataService, useValue: mockBulkAccessConfigDataService }, + { provide: SelectableListService, useValue: mockSelectableListService }, + { provide: NgbModal, useValue: mockNgbModal }, + ] +}).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 cddd1b1a29d..9e0421db904 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 @@ -19,12 +19,19 @@ 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' + 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/access-control-form.module.ts b/src/app/shared/access-control-form-container/access-control-form.module.ts index 3bbdb3ab5d7..c4b2745f9b4 100644 --- a/src/app/shared/access-control-form-container/access-control-form.module.ts +++ b/src/app/shared/access-control-form-container/access-control-form.module.ts @@ -14,19 +14,17 @@ import {NgbDatepickerModule} from '@ng-bootstrap/ng-bootstrap'; import {ToDatePipe} from './access-control-array-form/to-date.pipe'; @NgModule({ - imports: [ - CommonModule, - SharedModule, - TranslateModule, - UiSwitchModule, - NgbDatepickerModule - ], - declarations: [ - AccessControlFormContainerComponent, - AccessControlArrayFormComponent, - ItemAccessControlSelectBitstreamsModalComponent, - ToDatePipe - ], - exports: [ AccessControlFormContainerComponent, AccessControlArrayFormComponent ], + imports: [ + CommonModule, + SharedModule, + TranslateModule, + UiSwitchModule, + NgbDatepickerModule, + AccessControlFormContainerComponent, + AccessControlArrayFormComponent, + ItemAccessControlSelectBitstreamsModalComponent, + ToDatePipe + ], + exports: [AccessControlFormContainerComponent, AccessControlArrayFormComponent] }) export class AccessControlFormModule {} 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 f60d9a70e79..410596d0ba1 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 @@ -8,8 +8,8 @@ xdescribe('ItemAccessControlSelectBitstreamsModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ItemAccessControlSelectBitstreamsModalComponent ] - }) + imports: [ItemAccessControlSelectBitstreamsModalComponent] +}) .compileComponents(); }); 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 617803a0c48..cd9a23bd0f2 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 @@ -9,16 +9,20 @@ import { PaginationComponentOptions } from '../../pagination/pagination-componen import { Item } from '../../../core/shared/item.model'; import { BitstreamDataService } from '../../../core/data/bitstream-data.service'; import { PaginationService } from '../../../core/pagination/pagination.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { hasValue } from '../../empty.util'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; +import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; +import { NgIf, AsyncPipe } from '@angular/common'; 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' ] + 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 11411c7de02..b2514990574 100644 --- a/src/app/shared/alert/alert.component.spec.ts +++ b/src/app/shared/alert/alert.component.spec.ts @@ -18,22 +18,20 @@ describe('AlertComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, CommonModule, NoopAnimationsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), AlertComponent, TestComponent - ], - providers: [ + ], + providers: [ ChangeDetectorRef, AlertComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents().then(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents().then(); })); describe('', () => { @@ -103,8 +101,11 @@ describe('AlertComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [BrowserModule, + CommonModule] }) class TestComponent { diff --git a/src/app/shared/alert/alert.component.ts b/src/app/shared/alert/alert.component.ts index 07a8efbd7df..18c2e52f67d 100644 --- a/src/app/shared/alert/alert.component.ts +++ b/src/app/shared/alert/alert.component.ts @@ -3,20 +3,24 @@ import { trigger } from '@angular/animations'; 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, - ]) - ], - templateUrl: './alert.component.html', - styleUrls: ['./alert.component.scss'] + selector: 'ds-alert', + encapsulation: ViewEncapsulation.None, + animations: [ + trigger('enterLeave', [ + fadeOutLeave, fadeOutState, + ]) + ], + templateUrl: './alert.component.html', + styleUrls: ['./alert.component.scss'], + standalone: true, + imports: [NgIf, TranslateModule] }) export class AlertComponent { @@ -33,7 +37,7 @@ export class AlertComponent { /** * The alert type */ - @Input() type: AlertType; + @Input() type: AlertType | string; /** * An event fired when alert is dismissed. 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 58a1edfabde..587e1c9f52b 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 @@ -67,28 +67,26 @@ describe('AuthNavMenuComponent', () => { // refine the test module by declaring the test component TestBed.configureTestingModule({ - imports: [ - NoopAnimationsModule, - StoreModule.forRoot(authReducer, { + imports: [ + NoopAnimationsModule, + StoreModule.forRoot(authReducer, { runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false + strictStateImmutability: false, + strictActionImmutability: false } - }), - TranslateModule.forRoot() - ], - declarations: [ - AuthNavMenuComponent, - BrowserOnlyMockPipe - ], - providers: [ - { provide: HostWindowService, useValue: window }, - { provide: AuthService, useValue: authService } - ], - schemas: [ - CUSTOM_ELEMENTS_SCHEMA - ] - }) + }), + TranslateModule.forRoot(), + AuthNavMenuComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ + { provide: HostWindowService, useValue: window }, + { provide: AuthService, useValue: authService } + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) .compileComponents(); })); @@ -262,27 +260,25 @@ describe('AuthNavMenuComponent', () => { // refine the test module by declaring the test component TestBed.configureTestingModule({ - imports: [ - NoopAnimationsModule, - StoreModule.forRoot(authReducer, { + imports: [ + NoopAnimationsModule, + StoreModule.forRoot(authReducer, { runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false + strictStateImmutability: false, + strictActionImmutability: false } - }), - TranslateModule.forRoot() - ], - declarations: [ - AuthNavMenuComponent - ], - providers: [ - { provide: HostWindowService, useValue: window }, - { provide: AuthService, useValue: authService } - ], - schemas: [ - CUSTOM_ELEMENTS_SCHEMA - ] - }) + }), + TranslateModule.forRoot(), + AuthNavMenuComponent + ], + providers: [ + { provide: HostWindowService, useValue: window }, + { provide: AuthService, useValue: authService } + ], + schemas: [ + CUSTOM_ELEMENTS_SCHEMA + ] +}) .compileComponents(); })); 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 37a45e1b202..0faa32e235a 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 @@ -12,12 +12,21 @@ import { isNotUndefined } from '../empty.util'; import { isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors'; import { EPerson } from '../../core/eperson/models/eperson.model'; import { AuthService, LOGIN_ROUTE, LOGOUT_ROUTE } from '../../core/auth/auth.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'; @Component({ - selector: 'ds-auth-nav-menu', - templateUrl: './auth-nav-menu.component.html', - styleUrls: ['./auth-nav-menu.component.scss'], - animations: [fadeInOut, fadeOut] + 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, RouterLink, RouterLinkActive, UserMenuComponent, 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 14ea45d2367..3c61f2f970a 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 @@ -6,9 +6,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', + 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/user-menu.component.spec.ts b/src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts index 5576b942b30..164bfbc34f5 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 @@ -54,30 +54,28 @@ describe('UserMenuComponent', () => { beforeEach(waitForAsync(() => { serviceInit(); TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot(authReducer, { - runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false - } + runtimeChecks: { + strictStateImmutability: false, + strictActionImmutability: false + } }), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - providers: [ - { provide: AuthService, useValue: authService } - ], - declarations: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), UserMenuComponent - ], - schemas: [ + ], + providers: [ + { provide: AuthService, useValue: authService } + ], + 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 dcf12fb47be..6c7a99a6009 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 @@ -10,14 +10,21 @@ import { MYDSPACE_ROUTE } from '../../../my-dspace-page/my-dspace-page.component import { AuthService } from '../../../core/auth/auth.service'; import { getProfileModuleRoute, getSubscriptionsModuleRoute } from '../../../app-routing-paths'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { LogOutComponent } from '../../log-out/log-out.component'; +import { RouterLinkActive, RouterLink } from '@angular/router'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { NgIf, NgClass, AsyncPipe } from '@angular/common'; /** * This component represents the user nav menu. */ @Component({ - selector: 'ds-user-menu', - templateUrl: './user-menu.component.html', - styleUrls: ['./user-menu.component.scss'] + 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 9317a68007a..f4f684a3608 100644 --- a/src/app/shared/browse-by/browse-by.component.spec.ts +++ b/src/app/shared/browse-by/browse-by.component.spec.ts @@ -115,23 +115,23 @@ describe('BrowseByComponent', () => { beforeEach(waitForAsync(() => { themeService = getMockThemeService('dspace'); TestBed.configureTestingModule({ - imports: [ + imports: [ BrowseByRoutingModule, AccessControlRoutingModule, CommonModule, SharedModule, NgbModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), RouterTestingModule, - NoopAnimationsModule - ], - declarations: [BrowseByComponent], - providers: [ + NoopAnimationsModule, + BrowseByComponent + ], + providers: [ { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: LinkHeadService, useValue: linkHeadService }, @@ -139,12 +139,12 @@ describe('BrowseByComponent', () => { { provide: PaginationService, useValue: paginationService }, { provide: MockThemedBrowseEntryListElementComponent }, { provide: ThemeService, useValue: themeService }, - { provide: RouteService, useValue: routeServiceStub}, + { provide: RouteService, useValue: routeServiceStub }, { provide: SelectableListService, useValue: {} }, { provide: HostWindowService, useValue: new HostWindowServiceStub(800) }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0dc20033f85..ec1d9871a8d 100644 --- a/src/app/shared/browse-by/browse-by.component.ts +++ b/src/app/shared/browse-by/browse-by.component.ts @@ -12,16 +12,24 @@ import { ViewMode } from '../../core/shared/view-mode.model'; import { RouteService } from '../../core/services/route.service'; import { map } from 'rxjs/operators'; import { hasValue } from '../empty.util'; -import { TranslateService } from '@ngx-translate/core'; +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 { ThemedResultsBackButtonComponent } from '../results-back-button/themed-results-back-button.component'; +import { NgClass, NgComponentOutlet, NgIf, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../utils/var.directive'; @Component({ - selector: 'ds-browse-by', - styleUrls: ['./browse-by.component.scss'], - templateUrl: './browse-by.component.html', - animations: [ - fadeIn, - fadeInOut - ] + 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] }) /** * 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 ae42576e9b9..d3692b7fc64 100644 --- a/src/app/shared/browse-by/shared-browse-by.module.ts +++ b/src/app/shared/browse-by/shared-browse-by.module.ts @@ -7,19 +7,17 @@ import { BrowseByRoutingModule } from '../../browse-by/browse-by-routing.module' import { AccessControlRoutingModule } from '../../access-control/access-control-routing.module'; @NgModule({ - declarations: [ - BrowseByComponent, -], - imports: [ - ResultsBackButtonModule, - BrowseByRoutingModule, - AccessControlRoutingModule, - CommonModule, - SharedModule, - ], - exports: [ - BrowseByComponent, - SharedModule, - ] + imports: [ + ResultsBackButtonModule, + BrowseByRoutingModule, + AccessControlRoutingModule, + CommonModule, + SharedModule, + BrowseByComponent + ], + exports: [ + BrowseByComponent, + SharedModule, + ] }) export class SharedBrowseByModule { } 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 2dc1ee433cb..84114a03669 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts @@ -113,22 +113,22 @@ describe('CollectionDropdownComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [CollectionDropdownComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + CollectionDropdownComponent + ], + providers: [ { provide: CollectionDataService, useValue: collectionDataServiceMock }, { provide: ElementRef, useClass: MockElementRef }, ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 713b32fabe1..da40ac36ca9 100644 --- a/src/app/shared/collection-dropdown/collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/collection-dropdown.component.ts @@ -9,7 +9,7 @@ import { OnInit, Output } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; +import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BehaviorSubject, from as observableFrom, Observable, of as observableOf, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, mergeMap, reduce, startWith, switchMap, take } from 'rxjs/operators'; @@ -26,6 +26,10 @@ import { } from '../../core/shared/operators'; import { FindListOptions } from '../../core/data/find-list-options.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +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'; /** * An interface to represent a collection entry @@ -45,9 +49,11 @@ export interface CollectionListEntry { } @Component({ - selector: 'ds-collection-dropdown', - templateUrl: './collection-dropdown.component.html', - styleUrls: ['./collection-dropdown.component.scss'] + 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 3fb338186fd..d6c979f47a6 100644 --- a/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts +++ b/src/app/shared/collection-dropdown/themed-collection-dropdown.component.ts @@ -3,9 +3,10 @@ import { ThemedComponent } from '../theme-support/themed.component'; import { Component, Input, Output, EventEmitter } from '@angular/core'; @Component({ - selector: 'ds-themed-collection-dropdown', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 3f74f051182..2b7ef7b9a44 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 @@ -78,18 +78,17 @@ describe('ComColFormComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule], - declarations: [ComColFormComponent, VarDirective], - providers: [ + 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: ObjectCacheService, useValue: objectCacheStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); describe('when the dso doesn\'t contain an ID (newly created)', () => { 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 631a9f0b197..8de4a3f22a9 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,7 +1,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { DynamicFormControlModel, DynamicFormService, DynamicInputModel } from '@ng-dynamic-forms/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { FileUploader } from 'ng2-file-upload'; import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription } from 'rxjs'; import { AuthService } from '../../../../core/auth/auth.service'; @@ -22,6 +22,10 @@ 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'; /** * A form for creating and editing Communities or Collections @@ -29,7 +33,18 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; @Component({ selector: 'ds-comcol-form', styleUrls: ['./comcol-form.component.scss'], - templateUrl: './comcol-form.component.html' + templateUrl: './comcol-form.component.html', + imports: [ + FormComponent, + TranslateModule, + UploaderComponent, + AsyncPipe, + ComcolPageLogoComponent, + NgIf, + NgClass, + VarDirective + ], + standalone: true }) export class ComColFormComponent implements OnInit, OnDestroy { 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 9034bffe8e6..87bfc20526d 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 @@ -21,8 +21,9 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; * Component representing the create page for communities and collections */ @Component({ - selector: 'ds-create-comcol', - template: '' + 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.ts b/src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts index c56d0e02aea..e28be376cfc 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 @@ -16,8 +16,9 @@ import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; * Component representing the delete page for communities and collections */ @Component({ - selector: 'ds-delete-comcol', - template: '' + 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.ts b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts index d59030251dc..54338393c61 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 @@ -14,8 +14,9 @@ import { Community } from '../../../../../core/shared/community.model'; import { Collection } from '../../../../../core/shared/collection.model'; @Component({ - selector: 'ds-comcol-metadata', - template: '' + 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.html b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.html index 1e1f3d82093..bfc0fb5ddcd 100644 --- a/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.html +++ b/src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.html @@ -20,8 +20,7 @@
{{'comcol-role.edit.' + (comcolRole$ | async)?.name + '.anonymous-group' | translate}}
- + {{ dsoNameService.getName(group) }}
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 5ae22d754ee..09bdc766f94 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 @@ -13,8 +13,13 @@ import { getGroupEditRoute } from '../../../../../access-control/access-control- import { hasNoValue, hasValue } from '../../../../empty.util'; import { NoContent } from '../../../../../core/shared/NoContent.model'; import { NotificationsService } from '../../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +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 { VarDirective } from '../../../../utils/var.directive'; +import { RouterLink } from '@angular/router'; /** * Component for managing a community or collection role. @@ -22,7 +27,17 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service @Component({ selector: 'ds-comcol-role', styleUrls: ['./comcol-role.component.scss'], - templateUrl: './comcol-role.component.html' + templateUrl: './comcol-role.component.html', + imports: [ + ThemedLoadingComponent, + AlertComponent, + AsyncPipe, + TranslateModule, + NgIf, + RouterLink, + VarDirective + ], + standalone: true }) export class ComcolRoleComponent implements OnInit { 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 e4d6c9c8a74..6e9e463cb32 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 @@ -12,8 +12,9 @@ import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; * Component representing the edit page for communities and collections */ @Component({ - selector: 'ds-edit-comcol', - template: '' + 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 0527d283f06..b9aae42e5eb 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,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ActivatedRoute, Params, Router } from '@angular/router'; +import { ActivatedRoute, Params, Router, RouterLink, RouterLinkActive } from '@angular/router'; import { getCommunityPageRoute } from '../../../community-page/community-page-routing-paths'; import { getCollectionPageRoute } from '../../../collection-page/collection-page-routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @@ -9,6 +9,9 @@ import { PaginatedList } from '../../../core/data/paginated-list.model'; import { BrowseDefinition } from '../../../core/shared/browse-definition.model'; import { RemoteData } from '../../../core/data/remote-data'; import { BrowseService } from '../../../core/browse/browse.service'; +import { FormsModule } from '@angular/forms'; +import { AsyncPipe, NgForOf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; export interface ComColPageNavOption { id: string; @@ -24,7 +27,16 @@ export interface ComColPageNavOption { @Component({ selector: 'ds-comcol-page-browse-by', styleUrls: ['./comcol-page-browse-by.component.scss'], - templateUrl: './comcol-page-browse-by.component.html' + templateUrl: './comcol-page-browse-by.component.html', + imports: [ + FormsModule, + NgForOf, + RouterLink, + RouterLinkActive, + TranslateModule, + AsyncPipe + ], + standalone: true }) export class ComcolPageBrowseByComponent implements 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 08a13eddf8e..53aaaad4c4c 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 @@ -6,9 +6,10 @@ import { ThemedComponent } from '../../theme-support/themed.component'; * Themed wrapper for ComcolPageBrowseByComponent */ @Component({ - selector: 'ds-themed-comcol-page-browse-by', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', + 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 841b45dd39f..9e349cf841f 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,4 +1,5 @@ import { Component, Input } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; /** * This component renders any content inside of this component. @@ -9,7 +10,11 @@ import { Component, Input } from '@angular/core'; @Component({ selector: 'ds-comcol-page-content', styleUrls: ['./comcol-page-content.component.scss'], - templateUrl: './comcol-page-content.component.html' + templateUrl: './comcol-page-content.component.html', + imports: [ + TranslateModule + ], + 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 a06bf4a1e5c..b452ce15820 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 @@ -11,9 +11,8 @@ describe('ComcolPageHandleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 2ce49ebea2b..11949f465f6 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,4 +1,6 @@ import { Component, Injectable, Input } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; /** * This component builds a URL from the value of "handle" @@ -7,7 +9,9 @@ import { Component, Injectable, Input } from '@angular/core'; @Component({ selector: 'ds-comcol-page-handle', styleUrls: ['./comcol-page-handle.component.scss'], - templateUrl: './comcol-page-handle.component.html' + templateUrl: './comcol-page-handle.component.html', + imports: [NgIf, TranslateModule], + 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 e7a7caf7beb..51eb66c57e3 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 @@ -6,9 +6,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', + 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 cbf984a3499..977c9caea33 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,9 +1,10 @@ import { Component, Input } from '@angular/core'; @Component({ - selector: 'ds-comcol-page-header', - styleUrls: ['./comcol-page-header.component.scss'], - templateUrl: './comcol-page-header.component.html', + selector: 'ds-comcol-page-header', + styleUrls: ['./comcol-page-header.component.scss'], + templateUrl: './comcol-page-header.component.html', + 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 a9761bfd5f8..bc2246eaa87 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 @@ -3,9 +3,10 @@ import { Component, Input } from '@angular/core'; import { Bitstream } from '../../../core/shared/bitstream.model'; @Component({ - selector: 'ds-comcol-page-logo', - styleUrls: ['./comcol-page-logo.component.scss'], - templateUrl: './comcol-page-logo.component.html', + selector: 'ds-comcol-page-logo', + styleUrls: ['./comcol-page-logo.component.scss'], + templateUrl: './comcol-page-logo.component.html', + standalone: true }) export class ComcolPageLogoComponent { @Input() logo: Bitstream; diff --git a/src/app/shared/comcol/comcol.module.ts b/src/app/shared/comcol/comcol.module.ts index efbcedf2c67..7fdd98b4ac5 100644 --- a/src/app/shared/comcol/comcol.module.ts +++ b/src/app/shared/comcol/comcol.module.ts @@ -33,18 +33,16 @@ const COMPONENTS = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS - ], - imports: [ - CommonModule, - FormModule, - SharedModule, - UploadModule, - ], - exports: [ - ...COMPONENTS, - UploadModule, - ] + imports: [ + CommonModule, + FormModule, + SharedModule, + UploadModule, + ...COMPONENTS + ], + exports: [ + ...COMPONENTS, + UploadModule, + ] }) export class ComcolModule { } 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 d899dd8ef86..4b280e5efbe 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts @@ -14,13 +14,12 @@ describe('ConfirmationModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ConfirmationModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), ConfirmationModalComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); diff --git a/src/app/shared/confirmation-modal/confirmation-modal.component.ts b/src/app/shared/confirmation-modal/confirmation-modal.component.ts index 46eb4cedc5a..cb785918241 100644 --- a/src/app/shared/confirmation-modal/confirmation-modal.component.ts +++ b/src/app/shared/confirmation-modal/confirmation-modal.component.ts @@ -2,10 +2,14 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { DSpaceObject } from '../../core/shared/dspace-object.model'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-confirmation-modal', - templateUrl: 'confirmation-modal.component.html', + 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 081fb1050fe..16cad5ba4ed 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 @@ -11,7 +11,7 @@ import { PlacementDir } from './placement-dir.model'; import { By } from '@angular/platform-browser'; @Component({ - template: ` + template: ` template - ` + `, + standalone: true, + imports: [NgbTooltipModule] }) class TemplateComponent { @Input() content: string; @@ -72,13 +74,12 @@ describe('ContextHelpWrapperComponent', () => { ]); TestBed.configureTestingModule({ - imports: [ NgbTooltipModule ], - providers: [ + imports: [NgbTooltipModule, TemplateComponent, ContextHelpWrapperComponent], + providers: [ { provide: TranslateService, useValue: translateService }, { provide: ContextHelpService, useValue: contextHelpService }, - ], - declarations: [ TemplateComponent, ContextHelpWrapperComponent ] - }).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 e170d522b5c..f4267a65c31 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 @@ -5,9 +5,10 @@ import { Observable, Subscription, BehaviorSubject, combineLatest } from 'rxjs'; import { map, distinctUntilChanged, mergeMap } from 'rxjs/operators'; import { PlacementDir } from './placement-dir.model'; import { ContextHelpService } from '../context-help.service'; -import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { NgbTooltip, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { hasValueOperator } from '../empty.util'; import { ContextHelp } from '../context-help.model'; +import { NgFor, NgIf, NgClass, NgTemplateOutlet, AsyncPipe } from '@angular/common'; type ParsedContent = (string | {href: string, text: string})[]; @@ -16,9 +17,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'], + 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 326251da514..1b30f1889c2 100644 --- a/src/app/shared/context-help.directive.spec.ts +++ b/src/app/shared/context-help.directive.spec.ts @@ -9,7 +9,9 @@ import { ContextHelpService } from './context-help.service'; import { ContextHelp } from './context-help.model'; @Component({ - template: `
some text
` + template: `
some text
`, + standalone: true, + imports: [NgbTooltipModule] }) class TestComponent { @Input() content = ''; @@ -54,13 +56,12 @@ describe('ContextHelpDirective', () => { ]); TestBed.configureTestingModule({ - imports: [NgbTooltipModule], - providers: [ + imports: [NgbTooltipModule, TestComponent, ContextHelpWrapperComponent, ContextHelpDirective], + providers: [ { provide: TranslateService, useValue: translateService }, { provide: ContextHelpService, useValue: contextHelpService } - ], - declarations: [TestComponent, ContextHelpWrapperComponent, ContextHelpDirective] - }).compileComponents(); + ] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/context-help.directive.ts b/src/app/shared/context-help.directive.ts index 41d6daec21c..9babd0d622a 100644 --- a/src/app/shared/context-help.directive.ts +++ b/src/app/shared/context-help.directive.ts @@ -26,7 +26,8 @@ export interface ContextHelpDirectiveInput { * and so is the position of the tooltip itself (PlacementArray). */ @Directive({ - selector: '[dsContextHelp]', + selector: '[dsContextHelp]', + standalone: true }) export class ContextHelpDirective implements OnChanges, OnDestroy { /** 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 fadc8548736..bcfa593c286 100644 --- a/src/app/shared/ds-select/ds-select.component.spec.ts +++ b/src/app/shared/ds-select/ds-select.component.spec.ts @@ -8,13 +8,11 @@ describe('DsSelectComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ], - declarations: [ - 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 26d1560c019..6875a5f1744 100644 --- a/src/app/shared/ds-select/ds-select.component.ts +++ b/src/app/shared/ds-select/ds-select.component.ts @@ -1,12 +1,17 @@ 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'; /** * Component which represent a DSpace dropdown selector. */ @Component({ - selector: 'ds-select', - templateUrl: './ds-select.component.html', - styleUrls: ['./ds-select.component.scss'] + 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 abfe618174b..1d0aaf64641 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 @@ -116,25 +116,24 @@ describe('DSOEditMenuResolver', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule], - declarations: [AdminSidebarComponent], - providers: [ - {provide: DSpaceObjectDataService, useValue: dSpaceObjectDataService}, - {provide: MenuService, useValue: menuService}, - {provide: AuthorizationDataService, useValue: authorizationService}, - {provide: DsoVersioningModalService, useValue: dsoVersioningModalService}, - {provide: ResearcherProfileDataService, useValue: researcherProfileService}, - {provide: TranslateService, useValue: translate}, - {provide: NotificationsService, useValue: notificationsService}, + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent], + providers: [ + { provide: DSpaceObjectDataService, useValue: dSpaceObjectDataService }, + { provide: MenuService, useValue: menuService }, + { provide: AuthorizationDataService, useValue: authorizationService }, + { provide: DsoVersioningModalService, useValue: dsoVersioningModalService }, + { provide: ResearcherProfileDataService, useValue: researcherProfileService }, + { provide: TranslateService, useValue: translate }, + { provide: NotificationsService, useValue: notificationsService }, { - provide: NgbModal, useValue: { - open: () => {/*comment*/ + provide: NgbModal, useValue: { + open: () => { + } } - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }); + ], + 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 79ab35bd28c..b9e0165ca26 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 @@ -32,15 +32,14 @@ describe('DsoEditMenuExpandableSectionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [DsoEditMenuExpandableSectionComponent, TestComponent], - providers: [ - {provide: 'sectionDataProvider', useValue: dummySection}, - {provide: MenuService, useValue: menuService}, - {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - {provide: Router, useValue: new RouterStub()}, - ] - }).overrideComponent(DsoEditMenuExpandableSectionComponent, { + 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, { set: { entryComponents: [TestComponent] } @@ -68,8 +67,9 @@ describe('DsoEditMenuExpandableSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 8e4a7008afe..f5c1a42adef 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 @@ -8,15 +8,20 @@ import { MenuSection } from 'src/app/shared/menu/menu-section.model'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { hasValue } from '../../../empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgFor, NgIf, NgComponentOutlet, AsyncPipe } from '@angular/common'; +import { NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * Represents an expandable section in the dso edit menus */ @Component({ - /* tslint:disable:component-selector */ - selector: 'ds-dso-edit-menu-expandable-section', - templateUrl: './dso-edit-menu-expandable-section.component.html', - styleUrls: ['./dso-edit-menu-expandable-section.component.scss'], + /* tslint:disable:component-selector */ + 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] }) @rendersSectionForMenu(MenuID.DSO_EDIT, true) 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 f0815c54150..7de3b2a9aba 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 @@ -16,15 +16,14 @@ import { MenuItemType } from 'src/app/shared/menu/menu-item-type.model'; function initAsync(dummySectionText: { visible: boolean; icon: string; active: boolean; model: { disabled: boolean; text: string; type: MenuItemType }; id: string }, menuService: MenuServiceStub) { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [DsoEditMenuSectionComponent, TestComponent], - providers: [ - {provide: 'sectionDataProvider', useValue: dummySectionText}, - {provide: MenuService, useValue: menuService}, - {provide: CSSVariableService, useClass: CSSVariableServiceStub}, - {provide: Router, useValue: new RouterStub()}, - ] - }).overrideComponent(DsoEditMenuSectionComponent, { + imports: [TranslateModule.forRoot(), DsoEditMenuSectionComponent, TestComponent], + providers: [ + { provide: 'sectionDataProvider', useValue: dummySectionText }, + { provide: MenuService, useValue: menuService }, + { provide: CSSVariableService, useClass: CSSVariableServiceStub }, + { provide: Router, useValue: new RouterStub() }, + ] +}).overrideComponent(DsoEditMenuSectionComponent, { set: { entryComponents: [TestComponent] } @@ -166,8 +165,9 @@ describe('DsoEditMenuSectionComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 af3381ef716..b26208694fd 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 @@ -5,15 +5,21 @@ import { MenuService } from '../../../menu/menu.service'; import { isNotEmpty } from '../../../empty.util'; 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({ - /* tslint:disable:component-selector */ - selector: 'ds-dso-edit-menu-section', - templateUrl: './dso-edit-menu-section.component.html', - styleUrls: ['./dso-edit-menu-section.component.scss'] + /* tslint:disable:component-selector */ + 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] }) @rendersSectionForMenu(MenuID.DSO_EDIT, false) 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 5616e8ea109..44308b2a13d 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 @@ -46,18 +46,17 @@ describe('DsoEditMenuComponent', () => { }); spyOn(menuService, 'getMenuTopSections').and.returnValue(observableOf([section])); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule, DsoPageModule], - declarations: [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(); + { 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(); })); 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 ff4f9573146..584a8a93518 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 @@ -5,14 +5,17 @@ import { MenuService } from '../../menu/menu.service'; import { ActivatedRoute } from '@angular/router'; import { ThemeService } from '../../theme-support/theme.service'; import { MenuID } from '../../menu/menu-id.model'; +import { NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common'; /** * 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', + 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-subscription-button/dso-page-subscription-button.component.spec.ts b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts index 726854778dc..255e7b08af0 100644 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts +++ b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.spec.ts @@ -35,20 +35,20 @@ describe('DsoPageSubscriptionButtonComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModalModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ DsoPageSubscriptionButtonComponent ], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + DsoPageSubscriptionButtonComponent + ], + providers: [ { provide: AuthorizationDataService, useValue: authorizationService }, - ] - }) + ] +}) .compileComponents(); }); diff --git a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts index 54cd9e6bb0d..331183f7dff 100644 --- a/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts +++ b/src/app/shared/dso-page/dso-page-subscription-button/dso-page-subscription-button.component.ts @@ -1,17 +1,21 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable, of } from 'rxjs'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbModalRef, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; import { SubscriptionModalComponent } from '../../subscriptions/subscription-modal/subscription-modal.component'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-dso-page-subscription-button', - templateUrl: './dso-page-subscription-button.component.html', - styleUrls: ['./dso-page-subscription-button.component.scss'] + selector: 'ds-dso-page-subscription-button', + templateUrl: './dso-page-subscription-button.component.html', + styleUrls: ['./dso-page-subscription-button.component.scss'], + standalone: true, + imports: [NgIf, NgbTooltipModule, AsyncPipe, TranslateModule] }) /** * Display a button that opens the modal to manage subscriptions diff --git a/src/app/shared/dso-page/dso-page.module.ts b/src/app/shared/dso-page/dso-page.module.ts index d700b34e772..733c8c4a7b1 100644 --- a/src/app/shared/dso-page/dso-page.module.ts +++ b/src/app/shared/dso-page/dso-page.module.ts @@ -32,20 +32,18 @@ const PROVIDERS = [ ]; @NgModule({ - imports: [ - ...MODULES - ], - declarations: [ - ...COMPONENTS, - ...ENTRY_COMPONENTS, - ], - providers: [ - ...PROVIDERS, - ...ENTRY_COMPONENTS, - ], - exports: [ - ...COMPONENTS - ] + 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 b46df8ff36f..33cb4893dd5 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 @@ -31,15 +31,14 @@ describe('AuthorizedCollectionSelectorComponent', () => { }); notificationsService = jasmine.createSpyObj('notificationsService', ['error']); TestBed.configureTestingModule({ - declarations: [AuthorizedCollectionSelectorComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), AuthorizedCollectionSelectorComponent, VarDirective], + providers: [ { provide: SearchService, useValue: {} }, { provide: CollectionDataService, useValue: collectionService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 cc1f9822d67..14f4d28973e 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 @@ -13,15 +13,23 @@ import { followLink } from '../../../utils/follow-link-config.model'; import { RemoteData } from '../../../../core/data/remote-data'; import { hasValue } from '../../../empty.util'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +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'; @Component({ - selector: 'ds-authorized-collection-selector', - styleUrls: ['../dso-selector.component.scss'], - templateUrl: '../dso-selector.component.html' + 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 e2acd17bc05..663ec2d9c75 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 @@ -67,14 +67,13 @@ describe('DSOSelectorComponent', () => { notificationsService = jasmine.createSpyObj('notificationsService', ['error']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [DSOSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), DSOSelectorComponent], + providers: [ { provide: SearchService, useValue: searchService }, { provide: NotificationsService, useValue: notificationsService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 503e4c44129..1ef7f5612e3 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 @@ -9,7 +9,7 @@ import { QueryList, ViewChildren } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; +import { UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BehaviorSubject, @@ -34,7 +34,7 @@ import { SearchResult } from '../../search/models/search-result.model'; import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { RemoteData } from '../../../core/data/remote-data'; import { NotificationsService } from '../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { ListableNotificationObject @@ -44,11 +44,18 @@ import { NotificationType } from '../../notifications/models/notification-type'; 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'; @Component({ - selector: 'ds-dso-selector', - styleUrls: ['./dso-selector.component.scss'], - templateUrl: './dso-selector.component.html' + 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 a12f2587bea..95162f4cf48 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 @@ -30,28 +30,27 @@ describe('CreateCollectionParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 e0b7c1675b8..898590f3ced 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 @@ -10,14 +10,19 @@ import { } 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 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', + 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 d90cd0ac0df..6f1c5495729 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-create-collection-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 2d0a2a25de4..30ed7499475 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 @@ -29,28 +29,27 @@ describe('CreateCommunityParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 77458d98022..9fd015671fd 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 @@ -14,6 +14,8 @@ import { } 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 - @@ -23,9 +25,11 @@ import { environment } from '../../../../../environments/environment'; */ @Component({ - selector: 'ds-create-community-parent-selector', - styleUrls: ['./create-community-parent-selector.component.scss'], - templateUrl: './create-community-parent-selector.component.html', + 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 24bff972548..a64ef689793 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-create-community-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 90bd07c52bf..4629cf24564 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 @@ -28,28 +28,27 @@ describe('CreateItemParentSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 ed8a7b0780e..1fd5ca613c4 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 @@ -6,6 +6,9 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model'; 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'; /** * Component to wrap a list of existing collections inside a modal @@ -13,10 +16,12 @@ import { environment } from '../../../../../environments/environment'; */ @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' + 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 49209ea63b7..69fd6b347f1 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-create-item-parent-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 e2dbaaa0fff..0739110dd74 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 @@ -12,6 +12,7 @@ import { DSOSelectorComponent } from '../dso-selector/dso-selector.component'; import { MockComponent } from 'ng-mocks'; import { MetadataValue } from '../../../core/shared/metadata.models'; import { createSuccessfulRemoteDataObject } from '../../remote-data.utils'; +import { NgIf } from "@angular/common"; describe('DSOSelectorModalWrapperComponent', () => { let component: DSOSelectorModalWrapperComponent; @@ -32,25 +33,24 @@ describe('DSOSelectorModalWrapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); @@ -117,7 +117,13 @@ describe('DSOSelectorModalWrapperComponent', () => { @Component({ selector: 'ds-test-cmp', - templateUrl: './dso-selector-modal-wrapper.component.html' + templateUrl: './dso-selector-modal-wrapper.component.html', + imports: [ + DSOSelectorComponent, + NgIf, + TranslateModule + ], + 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 142f5dcc11a..2a7b67a0184 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 @@ -29,28 +29,27 @@ describe('EditCollectionSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [EditCollectionSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), EditCollectionSelectorComponent], + 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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 fd54cd44ed2..9bbc321e1af 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 @@ -10,6 +10,9 @@ import { 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 @@ -17,8 +20,10 @@ import { environment } from '../../../../../environments/environment'; */ @Component({ - selector: 'ds-edit-collection-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', + 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 999f466e752..83c142f5f41 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-edit-collection-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 355ff61e083..9dbb1c24b89 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 @@ -29,28 +29,27 @@ describe('EditCommunitySelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 cf2f97c6d36..b3408c9a68f 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 @@ -10,6 +10,9 @@ import { 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 @@ -17,8 +20,10 @@ import { environment } from '../../../../../environments/environment'; */ @Component({ - selector: 'ds-edit-community-selector', - templateUrl: '../dso-selector-modal-wrapper.component.html', + 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 e0678034446..2c32f04efee 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-edit-community-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 a2891fc66f1..f4c16ab3f61 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 @@ -24,28 +24,27 @@ describe('EditItemSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [EditItemSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), EditItemSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { - provide: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: itemRD, - }, - }, - } - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: itemRD, + }, + }, + } + }, }, { - provide: Router, useValue: router + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); 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 c1ae5839081..eea4e5aa475 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 @@ -6,6 +6,9 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { getItemEditRoute } from '../../../../item-page/item-page-routing-paths'; 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'; /** * Component to wrap a list of existing items inside a modal @@ -13,8 +16,10 @@ import { Item } from '../../../../core/shared/item.model'; */ @Component({ - selector: 'ds-edit-item-selector', - templateUrl: 'edit-item-selector.component.html', + 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 6d3b5691c19..381135b85b3 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 @@ -8,7 +8,8 @@ import {ThemedComponent} from 'src/app/shared/theme-support/themed.component'; @Component({ selector: 'ds-themed-edit-item-selector', styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 18ec6007ea0..d3b80768784 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 @@ -29,10 +29,8 @@ import { AuthorizationDataService } from '../../../../core/data/feature-authoriz provide: TranslateLoader, useClass: TranslateLoaderMock } - }), - ], + }), ConfirmationModalComponent], exports: [], - declarations: [ConfirmationModalComponent], providers: [] }) class ModelTestModule { @@ -86,31 +84,30 @@ describe('ExportBatchSelectorComponent', () => { isAuthorized: observableOf(true) }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule], - declarations: [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: ActivatedRoute, - useValue: { - root: { - snapshot: { - data: { - dso: itemRD, - }, - }, - } - }, + provide: ActivatedRoute, + useValue: { + root: { + snapshot: { + data: { + dso: itemRD, + }, + }, + } + }, }, { - provide: Router, useValue: router + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0645e09029d..e94eb475c59 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,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { Observable, of as observableOf } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { BATCH_EXPORT_SCRIPT_NAME, ScriptDataService } from '../../../../core/data/processes/script-data.service'; @@ -20,14 +20,18 @@ 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'; /** * 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', + 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 df3e4f095c3..da7b024f80f 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 @@ -30,10 +30,8 @@ import { AuthorizationDataService } from '../../../../core/data/feature-authoriz provide: TranslateLoader, useClass: TranslateLoaderMock } - }), - ], + }), ConfirmationModalComponent], exports: [], - declarations: [ConfirmationModalComponent], providers: [] }) class ModelTestModule { @@ -101,31 +99,30 @@ describe('ExportMetadataSelectorComponent', () => { isAuthorized: observableOf(true) }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ModelTestModule], - declarations: [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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 d4b4314a991..e9b9e479172 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,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { Observable, of as observableOf } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { METADATA_EXPORT_SCRIPT_NAME, ScriptDataService } from '../../../../core/data/processes/script-data.service'; @@ -21,14 +21,18 @@ 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'; /** * 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', + 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 6ed3bf28bee..858005eb314 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 @@ -32,13 +32,12 @@ describe('ImportBatchSelectorComponent', () => { const modalStub = jasmine.createSpyObj('modalStub', ['close']); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - declarations: [ImportBatchSelectorComponent], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), ImportBatchSelectorComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 4696e42e2d7..db17f7bb36b 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 @@ -6,14 +6,19 @@ import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { Observable, of } from 'rxjs'; +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 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', + 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 13e6dbc9c5d..b7773b6083a 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts @@ -10,7 +10,10 @@ import { By } from '@angular/platform-browser'; import { createPaginatedList } from '../testing/utils.test'; // eslint-disable-next-line @angular-eslint/pipe-prefix -@Pipe({ name: 'translate' }) +@Pipe({ + name: 'translate', + standalone: true +}) class MockTranslatePipe implements PipeTransform { transform(value: string): string { return value; @@ -72,14 +75,13 @@ describe('EntityDropdownComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [EntityDropdownComponent, MockTranslatePipe], - providers: [ + imports: [EntityDropdownComponent, MockTranslatePipe], + providers: [ { provide: EntityTypeDataService, useValue: entityTypeServiceMock }, ChangeDetectorRef - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); diff --git a/src/app/shared/entity-dropdown/entity-dropdown.component.ts b/src/app/shared/entity-dropdown/entity-dropdown.component.ts index e009463dcd7..d633b5c2108 100644 --- a/src/app/shared/entity-dropdown/entity-dropdown.component.ts +++ b/src/app/shared/entity-dropdown/entity-dropdown.component.ts @@ -18,11 +18,17 @@ import { EntityTypeDataService } from '../../core/data/entity-type-data.service' import { ItemType } from '../../core/shared/item-relationships/item-type.model'; import { getFirstSucceededRemoteWithNotEmptyData } from '../../core/shared/operators'; import { FindListOptions } from '../../core/data/find-list-options.model'; +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'] + 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 8c5fc881375..09fa2ea181e 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 @@ -67,15 +67,13 @@ describe('EpersonGroupListComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), EpersonGroupListComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: EPersonDataService, useValue: mockEpersonService }, { provide: GroupDataService, useValue: mockGroupService }, { provide: RequestService, useValue: getMockRequestService() }, @@ -83,11 +81,11 @@ describe('EpersonGroupListComponent test suite', () => { EpersonGroupListComponent, ChangeDetectorRef, Injector - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -270,8 +268,9 @@ describe('EpersonGroupListComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 7cad7a97830..c905ac94f28 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 @@ -20,6 +20,11 @@ import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { PaginationService } from '../../core/pagination/pagination.service'; import { FindListOptions } from '../../core/data/find-list-options.model'; import { getDataServiceFor } from '../../core/data/base/data-service.decorator'; +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 { NgIf, NgFor, AsyncPipe } from '@angular/common'; export interface SearchEvent { scope: string; @@ -27,12 +32,14 @@ export interface SearchEvent { } @Component({ - selector: 'ds-eperson-group-list', - styleUrls: ['./eperson-group-list.component.scss'], - templateUrl: './eperson-group-list.component.html', - animations: [ - fadeInOut - ] + 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 e88f08a1312..f4bd325ea14 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 @@ -17,23 +17,21 @@ describe('EpersonSearchBoxComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), EpersonSearchBoxComponent, TestComponent - ], - providers: [ + ], + providers: [ UntypedFormBuilder, EpersonSearchBoxComponent - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -107,8 +105,11 @@ describe('EpersonSearchBoxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 4689d29a8c8..a8ae221577a 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 @@ -1,17 +1,20 @@ import { Component, EventEmitter, Output } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; +import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { SearchEvent } from '../eperson-group-list.component'; import { isNotNull } from '../../empty.util'; +import { TranslateModule } from '@ngx-translate/core'; /** * A component used to show a search box for epersons. */ @Component({ - selector: 'ds-eperson-search-box', - templateUrl: './eperson-search-box.component.html', + 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 b4c663902d8..b7f3cdf866f 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 @@ -17,23 +17,21 @@ describe('GroupSearchBoxComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), GroupSearchBoxComponent, TestComponent - ], - providers: [ + ], + providers: [ UntypedFormBuilder, GroupSearchBoxComponent - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -106,8 +104,11 @@ describe('GroupSearchBoxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 154bee2d078..204c93d1b53 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,17 +1,20 @@ import { Component, EventEmitter, Output } from '@angular/core'; -import { UntypedFormBuilder } from '@angular/forms'; +import { UntypedFormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { SearchEvent } from '../eperson-group-list.component'; import { isNotNull } from '../../empty.util'; +import { TranslateModule } from '@ngx-translate/core'; /** * A component used to show a search box for groups. */ @Component({ - selector: 'ds-group-search-box', - templateUrl: './group-search-box.component.html', + 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 f8483ac7aa6..c6e0ed42b26 100644 --- a/src/app/shared/error/error.component.spec.ts +++ b/src/app/shared/error/error.component.spec.ts @@ -17,17 +17,17 @@ describe('ErrorComponent (inline template)', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [ErrorComponent], // declare the test component - providers: [TranslateService] - }).compileComponents(); // compile template and css + ErrorComponent + ], + providers: [TranslateService] +}).compileComponents(); // compile template and css })); beforeEach(() => { diff --git a/src/app/shared/error/error.component.ts b/src/app/shared/error/error.component.ts index 6572598c8b1..2a050b80f54 100644 --- a/src/app/shared/error/error.component.ts +++ b/src/app/shared/error/error.component.ts @@ -4,11 +4,14 @@ import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { AlertType } from '../alert/alert-type'; +import { AlertComponent } from '../alert/alert.component'; @Component({ - selector: 'ds-error', - styleUrls: ['./error.component.scss'], - templateUrl: './error.component.html' + 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 61e9ecb4aad..9f322e9fe7a 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 @@ -41,11 +41,12 @@ describe('FileDownloadLinkComponent', () => { function initTestbed() { TestBed.configureTestingModule({ - declarations: [FileDownloadLinkComponent, RouterLinkDirectiveStub], - providers: [ - {provide: AuthorizationDataService, useValue: authorizationService}, - ] - }) + imports: [FileDownloadLinkComponent], + declarations: [RouterLinkDirectiveStub], + providers: [ + { provide: AuthorizationDataService, useValue: authorizationService }, + ] +}) .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 a79a71b6340..7cbafacd66e 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 @@ -7,11 +7,15 @@ import { hasValue, isNotEmpty } from '../empty.util'; import { map } from 'rxjs/operators'; import { of as observableOf, combineLatest as observableCombineLatest, Observable } from 'rxjs'; import { Item } from '../../core/shared/item.model'; +import { NgClass, NgIf, NgTemplateOutlet, AsyncPipe } from '@angular/common'; +import { RouterLink } from '@angular/router'; @Component({ - selector: 'ds-file-download-link', - templateUrl: './file-download-link.component.html', - styleUrls: ['./file-download-link.component.scss'] + 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] }) /** * 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 4e619b8f28e..e77adabc41b 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 @@ -5,9 +5,10 @@ import { Bitstream } from '../../core/shared/bitstream.model'; import { Item } from '../../core/shared/item.model'; @Component({ - selector: 'ds-themed-file-download-link', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', + 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.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts index ff5a119b6fc..7f3a597b985 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 @@ -17,7 +17,7 @@ import { ViewChild, ViewContainerRef } from '@angular/core'; -import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule, UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, @@ -55,8 +55,11 @@ import { DynamicNGBootstrapTextAreaComponent, DynamicNGBootstrapTimePickerComponent } from '@ng-dynamic-forms/ui-ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; -import { ReorderableRelationship } from './existing-metadata-list-element/existing-metadata-list-element.component'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { + ExistingMetadataListElementComponent, + ReorderableRelationship +} from './existing-metadata-list-element/existing-metadata-list-element.component'; import { DYNAMIC_FORM_CONTROL_TYPE_ONEBOX } from './models/onebox/dynamic-onebox.model'; import { DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model'; @@ -84,7 +87,7 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } fr import { DsDynamicTypeBindRelationService } from './ds-dynamic-type-bind-relation.service'; import { SearchResult } from '../../../search/models/search-result.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +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 { DsDynamicDisabledComponent } from './models/disabled/dynamic-disabled.component'; @@ -120,6 +123,10 @@ import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-cons import { FormFieldMetadataValueObject } from '../models/form-field-metadata-value.model'; import { APP_CONFIG, AppConfig } 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"; export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type | null { switch (model.type) { @@ -191,7 +198,21 @@ export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type< selector: 'ds-dynamic-form-control-container', styleUrls: ['./ds-dynamic-form-control-container.component.scss'], templateUrl: './ds-dynamic-form-control-container.component.html', - changeDetection: ChangeDetectionStrategy.Default + changeDetection: ChangeDetectionStrategy.Default, + imports: [ + ExistingMetadataListElementComponent, + NgIf, + NgClass, + AsyncPipe, + TranslateModule, + ReactiveFormsModule, + NgForOf, + FormsModule, + NgbTooltipModule, + NgTemplateOutlet, + ExistingRelationListElementComponent + ], + 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.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts index 45511d69416..fbcaab5f024 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 @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, ContentChildren, - EventEmitter, + EventEmitter, forwardRef, Input, Output, QueryList, @@ -19,10 +19,16 @@ import { DynamicTemplateDirective, } 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' + templateUrl: './ds-dynamic-form.component.html', + imports: [ + forwardRef(() => DsDynamicFormControlContainerComponent), + NgForOf + ], + standalone: true }) export class DsDynamicFormComponent extends DynamicFormComponent { 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 b5af2a8843f..3aa73d3efb4 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 @@ -72,22 +72,22 @@ describe('ExistingMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ExistingMetadataListElementComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ExistingMetadataListElementComponent + ], + providers: [ { provide: SelectableListService, useValue: selectionService }, { provide: Store, useValue: store }, { provide: SubmissionService, useValue: submissionServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 aa50133e8a2..8c440b6206e 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 @@ -21,6 +21,12 @@ 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 @@ -136,7 +142,15 @@ export class ReorderableRelationship extends Reorderable { @Component({ selector: 'ds-existing-metadata-list-element', templateUrl: './existing-metadata-list-element.component.html', - styleUrls: ['./existing-metadata-list-element.component.scss'] + styleUrls: ['./existing-metadata-list-element.component.scss'], + imports: [ + NgIf, + ThemedLoadingComponent, + AsyncPipe, + MetadataRepresentationLoaderComponent, + TranslateModule + ], + 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 5a53599f917..897ed82b514 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 @@ -65,14 +65,14 @@ describe('ExistingRelationListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ExistingRelationListElementComponent], - providers: [ + imports: [ExistingRelationListElementComponent], + providers: [ { provide: SelectableListService, useValue: selectionService }, { provide: Store, useValue: store }, { provide: SubmissionService, useClass: SubmissionServiceStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 c3a8b157a6c..89af38ada4a 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 @@ -14,6 +14,11 @@ import { RemoveRelationshipAction } from '../relation-lookup-modal/relationship. import { ViewMode } from '../../../../../core/shared/view-mode.model'; import { ReorderableRelationship } from '../existing-metadata-list-element/existing-metadata-list-element.component'; import { SubmissionService } from '../../../../../submission/submission.service'; +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 @@ -53,7 +58,14 @@ export abstract class Reorderable { @Component({ selector: 'ds-existing-relation-list-element', templateUrl: './existing-relation-list-element.component.html', - styleUrls: ['./existing-relation-list-element.component.scss'] + styleUrls: ['./existing-relation-list-element.component.scss'], + imports: [ + ThemedLoadingComponent, + AsyncPipe, + ListableObjectComponentLoaderComponent, + NgIf + ], + 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 9d48bdac216..8c85cf143db 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,6 +1,6 @@ -import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { Component, EventEmitter, Input, Output, QueryList } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop'; +import { Component, EventEmitter, forwardRef, Input, Output, QueryList } from '@angular/core'; +import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; import { DynamicFormArrayComponent, DynamicFormControlCustomEvent, @@ -15,11 +15,24 @@ 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'; @Component({ selector: 'ds-dynamic-form-array', templateUrl: './dynamic-form-array.component.html', - styleUrls: ['./dynamic-form-array.component.scss'] + styleUrls: ['./dynamic-form-array.component.scss'], + imports: [ + ReactiveFormsModule, + CdkDropList, + NgClass, + NgForOf, + CdkDrag, + CdkDragHandle, + forwardRef(() => DsDynamicFormControlContainerComponent), + NgTemplateOutlet + ], + 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 ceb498fe567..d47ce50f969 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 @@ -19,14 +19,13 @@ describe('CustomSwitchComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ ReactiveFormsModule, NoopAnimationsModule, - DynamicFormsCoreModule.forRoot() - ], - declarations: [CustomSwitchComponent] - - }).compileComponents().then(() => { + DynamicFormsCoreModule.forRoot(), + 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 47780e66f6a..f58a0e9d4ff 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,15 +1,21 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; import { DynamicNGBootstrapCheckboxComponent } from '@ng-dynamic-forms/ui-ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; import { DynamicCustomSwitchModel } from './custom-switch.model'; +import { NgClass } from "@angular/common"; @Component({ selector: 'ds-custom-switch', styleUrls: ['./custom-switch.component.scss'], templateUrl: './custom-switch.component.html', + imports: [ + NgClass, + ReactiveFormsModule + ], + 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 c0d1c83bf9f..91fed6cdd8f 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 @@ -20,16 +20,14 @@ describe('DsDatePickerInlineComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - - imports: [ + imports: [ ReactiveFormsModule, NoopAnimationsModule, NgbDatepickerModule, - DynamicFormsCoreModule.forRoot() - ], - declarations: [DsDatePickerInlineComponent] - - }).compileComponents().then(() => { + DynamicFormsCoreModule.forRoot(), + 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 2eb6e9291c4..00e71e4e041 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,6 +1,6 @@ import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; -import { NgbDatepicker, NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap'; +import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; +import { NgbDatepicker, NgbDatepickerConfig, NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicDatePickerModel, DynamicFormControlComponent, @@ -8,10 +8,18 @@ import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; +import { NgClass, NgIf } from '@angular/common'; @Component({ selector: 'ds-dynamic-date-picker-inline', - templateUrl: './dynamic-date-picker-inline.component.html' + templateUrl: './dynamic-date-picker-inline.component.html', + imports: [ + NgClass, + NgbDatepickerModule, + ReactiveFormsModule, + NgIf + ], + 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 ffc36008c69..c6bd80cde10 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 @@ -43,21 +43,19 @@ describe('DsDatePickerComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - NgbModule - ], - declarations: [ + imports: [ + NgbModule, DsDatePickerComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DsDatePickerComponent, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -240,8 +238,10 @@ describe('DsDatePickerComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 8d5ce5b48ee..81de011a246 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,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { FormsModule, UntypedFormGroup } from '@angular/forms'; import { DynamicDsDatePickerModel } from './date-picker.model'; import { hasValue } from '../../../../../empty.util'; import { @@ -7,6 +7,8 @@ import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; +import { NgClass, NgIf } from '@angular/common'; +import { NumberPickerComponent } from '../../../../number-picker/number-picker.component'; export const DS_DATE_PICKER_SEPARATOR = '-'; @@ -14,6 +16,13 @@ export const DS_DATE_PICKER_SEPARATOR = '-'; selector: 'ds-date-picker', styleUrls: ['./date-picker.component.scss'], templateUrl: './date-picker.component.html', + imports: [ + NgClass, + NgIf, + NumberPickerComponent, + FormsModule + ], + 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 a25ad4d2314..d8b873656ae 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 @@ -39,14 +39,13 @@ describe('DsDynamicDisabledComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [DsDynamicDisabledComponent], - imports: [FormsModule, TranslateModule.forRoot()], - providers: [ + imports: [FormsModule, TranslateModule.forRoot(), DsDynamicDisabledComponent], + providers: [ { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 222ad510496..6b8fbeeae84 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 @@ -4,13 +4,18 @@ import { UntypedFormGroup } from '@angular/forms'; import { DynamicFormControlComponent, DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; import { DynamicDisabledModel } from './dynamic-disabled.model'; +import { TranslateModule } from '@ngx-translate/core'; /** * Component representing a simple disabled input field */ @Component({ selector: 'ds-dynamic-disabled', - templateUrl: './dynamic-disabled.component.html' + templateUrl: './dynamic-disabled.component.html', + imports: [ + TranslateModule + ], + 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 cfd1bc293c6..ebbc7712c4a 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,5 +1,5 @@ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, QueryList } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { ChangeDetectionStrategy, Component, EventEmitter, forwardRef, Input, Output, QueryList } from '@angular/core'; +import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms'; import { DynamicFormControlComponent, DynamicFormControlCustomEvent, @@ -12,11 +12,20 @@ import { DynamicFormValidationService, DynamicTemplateDirective } from '@ng-dynamic-forms/core'; +import { NgClass, NgForOf } from '@angular/common'; +import { DsDynamicFormControlContainerComponent } from '../../ds-dynamic-form-control-container.component'; @Component({ selector: 'ds-dynamic-form-group', templateUrl: './dynamic-form-group.component.html', - changeDetection: ChangeDetectionStrategy.Default + changeDetection: ChangeDetectionStrategy.Default, + imports: [ + ReactiveFormsModule, + NgClass, + NgForOf, + forwardRef(() => DsDynamicFormControlContainerComponent), + ], + 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 51ce584bb1d..89b730f9428 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 @@ -78,18 +78,16 @@ describe('DsDynamicListComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, ReactiveFormsModule, - NgbModule - ], - declarations: [ + NgbModule, DsDynamicListComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DsDynamicListComponent, DynamicFormValidationService, @@ -97,9 +95,9 @@ describe('DsDynamicListComponent test suite', () => { { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -286,8 +284,14 @@ describe('DsDynamicListComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + FormsModule, + ReactiveFormsModule, + NgbModule] }) 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 16c46fc26b6..ea15aeb745b 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,5 +1,5 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormGroup, ValidatorFn, ValidationErrors, AbstractControl } from '@angular/forms'; +import { UntypedFormGroup, ValidatorFn, ValidationErrors, AbstractControl, ReactiveFormsModule } from '@angular/forms'; import { DynamicCheckboxModel, DynamicFormControlComponent, @@ -17,6 +17,8 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/share 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; @@ -31,7 +33,15 @@ export interface ListItem { @Component({ selector: 'ds-dynamic-list', styleUrls: ['./dynamic-list.component.scss'], - templateUrl: './dynamic-list.component.html' + templateUrl: './dynamic-list.component.html', + imports: [ + NgClass, + NgIf, + NgbButtonsModule, + NgForOf, + ReactiveFormsModule + ], + 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 2fea4fc9856..98defc88871 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 @@ -140,30 +140,28 @@ describe('Dynamic Lookup component', () => { beforeEach(waitForAsync(() => { vocabularyServiceStub = new VocabularyServiceStub(); TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, InfiniteScrollModule, ReactiveFormsModule, NgbModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), DsDynamicLookupComponent, TestComponent, AuthorityConfidenceStateDirective, ObjNgFor - ], // declare the test component - providers: [ + ], + providers: [ ChangeDetectorRef, DsDynamicLookupComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); beforeEach(() => { @@ -559,8 +557,15 @@ describe('Dynamic Lookup component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 63545f45d2f..bae8c13ad2a 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,9 +1,9 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { FormsModule, UntypedFormGroup } from '@angular/forms'; import { of as observableOf, Subscription } from 'rxjs'; import { catchError, distinctUntilChanged } from 'rxjs/operators'; -import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'; +import { NgbDropdown, NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; @@ -19,6 +19,11 @@ import { } from '../../../../../../core/data/paginated-list.model'; import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators'; 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'; /** * Component representing a lookup or lookup-name input field @@ -26,7 +31,21 @@ import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; @Component({ selector: 'ds-dynamic-lookup', styleUrls: ['./dynamic-lookup.component.scss'], - templateUrl: './dynamic-lookup.component.html' + templateUrl: './dynamic-lookup.component.html', + imports: [ + TranslateModule, + NgbTooltipModule, + NgbDropdownModule, + AuthorityConfidenceStateDirective, + FormsModule, + NgIf, + NgClass, + InfiniteScrollModule, + NgForOf, + NgTemplateOutlet, + ObjNgFor + ], + 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 69520aba633..0f5e88bcd68 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 @@ -127,32 +127,30 @@ describe('DsDynamicOneboxComponent test suite', () => { ); init(); TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, NgbModule, ReactiveFormsModule, TranslateModule.forRoot(), - CdkTreeModule - ], - declarations: [ + CdkTreeModule, DsDynamicOneboxComponent, TestComponent, AuthorityConfidenceStateDirective, ObjNgFor, VocabularyTreeviewComponent - ], // declare the test component - 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(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); }); @@ -452,8 +450,15 @@ describe('DsDynamicOneboxComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 2ff4256404d..f7d6ef4d137 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,5 +1,5 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +import { FormsModule, UntypedFormGroup } from '@angular/forms'; import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; import { @@ -14,7 +14,13 @@ import { tap } from 'rxjs/operators'; import { Observable, of as observableOf, Subject, Subscription } from 'rxjs'; -import { NgbModal, NgbModalRef, NgbTypeahead, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbModal, + NgbModalRef, + NgbTypeahead, + NgbTypeaheadModule, + NgbTypeaheadSelectItemEvent +} from '@ng-bootstrap/ng-bootstrap'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; import { DynamicOneboxModel } from './dynamic-onebox.model'; @@ -32,6 +38,10 @@ import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; import { Vocabulary } from '../../../../../../core/submission/vocabularies/models/vocabulary.model'; import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; 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'; /** * Component representing a onebox input field. @@ -40,7 +50,19 @@ import { VocabularyTreeviewModalComponent } from '../../../../vocabulary-treevie @Component({ selector: 'ds-dynamic-onebox', styleUrls: ['./dynamic-onebox.component.scss'], - templateUrl: './dynamic-onebox.component.html' + templateUrl: './dynamic-onebox.component.html', + imports: [ + NgbTypeaheadModule, + NgIf, + AsyncPipe, + AuthorityConfidenceStateDirective, + NgTemplateOutlet, + TranslateModule, + ObjNgFor, + NgForOf, + FormsModule + ], + 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 feca7f95c61..40e73065b8d 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 @@ -107,20 +107,18 @@ describe('DsDynamicRelationGroupComponent test suite', () => { /* 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, NgbModule, StoreModule.forRoot({}, storeModuleConfig), - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), FormComponent, DsDynamicRelationGroupComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DsDynamicRelationGroupComponent, DynamicFormValidationService, @@ -130,9 +128,9 @@ describe('DsDynamicRelationGroupComponent test suite', () => { FormService, { provide: VocabularyService, useValue: new VocabularyServiceStub() }, { provide: Store, useClass: StoreMock } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -314,8 +312,12 @@ describe('DsDynamicRelationGroupComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + NgbModule] }) 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 7fdfb61b74e..5c9d10909a6 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,4 +1,14 @@ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'; +import { + ChangeDetectorRef, + Component, + EventEmitter, + forwardRef, + Input, + OnDestroy, + OnInit, + Output, + ViewChild +} from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { combineLatest, Observable, of as observableOf, Subscription } from 'rxjs'; @@ -30,6 +40,11 @@ import { environment } from '../../../../../../../environments/environment'; import { PLACEHOLDER_PARENT_METADATA } from '../../ds-dynamic-form-constants'; import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/shared/operators'; import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry-detail.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 @@ -38,7 +53,18 @@ import { VocabularyEntryDetail } from '../../../../../../core/submission/vocabul selector: 'ds-dynamic-relation-group', styleUrls: ['./dynamic-relation-group.component.scss'], templateUrl: './dynamic-relation-group.component.html', - animations: [shrinkInOut] + animations: [shrinkInOut], + imports: [ + NgIf, + AsyncPipe, + NgbTooltipModule, + TranslateModule, + NgClass, + ThemedLoadingComponent, + ChipsComponent, + forwardRef(() => FormComponent), + ], + 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 05e46c6e6de..51d9a42fc3b 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 @@ -61,28 +61,26 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, InfiniteScrollModule, ReactiveFormsModule, NgbModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), DsDynamicScrollableDropdownComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DsDynamicScrollableDropdownComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -215,8 +213,15 @@ describe('Dynamic Dynamic Scrollable Dropdown component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts index a4ca2101934..7b5ab1ff601 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts @@ -3,7 +3,7 @@ import { UntypedFormGroup } from '@angular/forms'; import { Observable, of as observableOf } from 'rxjs'; import { catchError, distinctUntilChanged, map, tap } from 'rxjs/operators'; -import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'; +import { NgbDropdown, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core'; import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; @@ -18,6 +18,9 @@ import { } from '../../../../../../core/data/paginated-list.model'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; +import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; +import { TranslateModule } from '@ngx-translate/core'; /** * Component representing a dropdown input field @@ -25,7 +28,16 @@ import { FormFieldMetadataValueObject } from '../../../models/form-field-metadat @Component({ selector: 'ds-dynamic-scrollable-dropdown', styleUrls: ['./dynamic-scrollable-dropdown.component.scss'], - templateUrl: './dynamic-scrollable-dropdown.component.html' + templateUrl: './dynamic-scrollable-dropdown.component.html', + imports: [ + NgbDropdownModule, + NgIf, + AsyncPipe, + InfiniteScrollModule, + NgForOf, + TranslateModule + ], + standalone: true }) export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyComponent implements OnInit { @Input() bindId = true; 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 a6a4c451700..1414f133933 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 @@ -75,26 +75,24 @@ describe('DsDynamicTagComponent test suite', () => { const vocabularyServiceStub = new VocabularyServiceStub(); init(); TestBed.configureTestingModule({ - imports: [ + imports: [ DynamicFormsCoreModule, DynamicFormsNGBootstrapUIModule, FormsModule, NgbModule, ReactiveFormsModule, - ], - declarations: [ DsDynamicTagComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DsDynamicTagComponent, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: DynamicFormLayoutService, useValue: mockDynamicFormLayoutService }, { provide: DynamicFormValidationService, useValue: mockDynamicFormValidationService } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -286,8 +284,14 @@ describe('DsDynamicTagComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 4abb68a53be..248bd0ace8f 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,10 +1,10 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { UntypedFormGroup } from '@angular/forms'; +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, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap'; +import { NgbTypeahead, NgbTypeaheadModule, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap'; import isEqual from 'lodash/isEqual'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; @@ -20,6 +20,8 @@ import { import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model'; import { PageInfo } from '../../../../../../core/shared/page-info.model'; import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; +import { NgIf } from '@angular/common'; +import { ChipsComponent } from '../../../../chips/chips.component'; /** * Component representing a tag input field @@ -27,7 +29,14 @@ import { DsDynamicVocabularyComponent } from '../dynamic-vocabulary.component'; @Component({ selector: 'ds-dynamic-tag', styleUrls: ['./dynamic-tag.component.scss'], - templateUrl: './dynamic-tag.component.html' + templateUrl: './dynamic-tag.component.html', + imports: [ + NgbTypeaheadModule, + FormsModule, + NgIf, + ChipsComponent + ], + 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 9d57296f826..f84d4c36af6 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 @@ -103,36 +103,35 @@ describe('DsDynamicLookupRelationModalComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [DsDynamicLookupRelationModalComponent], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, DsDynamicLookupRelationModalComponent], + providers: [ { - provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions) - } + provide: SearchConfigurationService, useValue: { + paginatedSearchOptions: observableOf(pSearchOptions) + } }, { provide: ExternalSourceDataService, useValue: externalSourceService }, { provide: LookupRelationService, useValue: lookupRelationService }, { - provide: SelectableListService, useValue: selectableListService + provide: SelectableListService, useValue: selectableListService }, { - provide: RelationshipDataService, useValue: { getNameVariant: () => observableOf(nameVariant) } + provide: RelationshipDataService, useValue: { getNameVariant: () => observableOf(nameVariant) } }, { 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({}) }, NgbActiveModal - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 446497a74fc..acf532c3abe 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,6 +1,6 @@ import { Component, EventEmitter, NgZone, OnDestroy, OnInit, Output } from '@angular/core'; import { combineLatest as observableCombineLatest, Observable, Subscription, BehaviorSubject } from 'rxjs'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +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-page.component'; @@ -29,6 +29,18 @@ import { RemoteDataBuildService } from '../../../../../core/cache/builders/remot 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"; @Component({ selector: 'ds-dynamic-lookup-relation-modal', @@ -39,7 +51,19 @@ import { RelationshipType } from '../../../../../core/shared/item-relationships/ provide: SEARCH_CONFIG_SERVICE, useClass: SearchConfigurationService } - ] + ], + imports: [ + ThemedDynamicLookupRelationExternalSourceTabComponent, + TranslateModule, + ThemedLoadingComponent, + NgIf, + NgbNavModule, + ThemedDynamicLookupRelationSearchTabComponent, + AsyncPipe, + NgForOf, + DsDynamicLookupRelationSelectionTabComponent + ], + 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 cfffc5ddb76..3a03ec2e1b3 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 @@ -103,20 +103,19 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [DsDynamicLookupRelationExternalSourceTabComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, BrowserAnimationsModule], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, BrowserAnimationsModule, DsDynamicLookupRelationExternalSourceTabComponent, VarDirective], + providers: [ { - provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions) - } + provide: SearchConfigurationService, useValue: { + paginatedSearchOptions: observableOf(pSearchOptions) + } }, { provide: ExternalSourceDataService, useValue: externalSourceService }, { provide: SelectableListService, useValue: selectableListService }, { provide: PaginationService, useValue: new PaginationServiceStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 08ff5378ab8..baa9289750e 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 @@ -25,6 +25,14 @@ import { PaginationService } from '../../../../../../core/pagination/pagination. 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'; @Component({ selector: 'ds-dynamic-lookup-relation-external-source-tab', @@ -39,7 +47,19 @@ import { getFirstCompletedRemoteData } from '../../../../../../core/shared/opera animations: [ fadeIn, fadeInOut - ] + ], + imports: [ + ThemedSearchFormComponent, + PageSizeSelectorComponent, + ObjectCollectionComponent, + VarDirective, + AsyncPipe, + TranslateModule, + ErrorComponent, + NgIf, + ThemedLoadingComponent + ], + 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 c8711b6b47d..274337b927b 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 @@ -67,17 +67,16 @@ describe('DsDynamicLookupRelationExternalSourceTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [ExternalSourceEntryImportModalComponent], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NgbModule, ExternalSourceEntryImportModalComponent], + 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] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 bf1f2f7e70c..500f0c8f429 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 @@ -21,10 +21,12 @@ import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../../../../. import { switchMap, take } from 'rxjs/operators'; import { ItemSearchResult } from '../../../../../../object-collection/shared/item-search-result.model'; import { NotificationsService } from '../../../../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ItemType } from '../../../../../../../core/shared/item-relationships/item-type.model'; import { SubmissionImportExternalCollectionComponent } from '../../../../../../../submission/import-external/import-external-collection/submission-import-external-collection.component'; import { CollectionListEntry } from '../../../../../../collection-dropdown/collection-dropdown.component'; +import { SearchResultsComponent } from '../../../../../../search/search-results/search-results.component'; +import { AsyncPipe, NgIf } from '@angular/common'; /** * The possible types of import for the external entry @@ -40,7 +42,14 @@ export enum ImportType { @Component({ selector: 'ds-external-source-entry-import-modal', styleUrls: ['./external-source-entry-import-modal.component.scss'], - templateUrl: './external-source-entry-import-modal.component.html' + templateUrl: './external-source-entry-import-modal.component.html', + imports: [ + TranslateModule, + SearchResultsComponent, + NgIf, + AsyncPipe + ], + 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 26e6097c2d7..e5a56479f63 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 @@ -3,9 +3,10 @@ import { ThemedComponent } from '../../../../../../theme-support/themed.componen import { Component } from '@angular/core'; @Component({ - selector: 'ds-themed-external-source-entry-import-modal', - styleUrls: [], - templateUrl: '../../../../../../../shared/theme-support/themed.component.html', + 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 113d902c3d8..71996a86437 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 @@ -9,9 +9,10 @@ import { ExternalSource } from '../../../../../../core/shared/external-source.mo 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', + 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 f689743156f..67a8fe3b22b 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 @@ -92,25 +92,23 @@ describe('DsDynamicLookupRelationSearchTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [DsDynamicLookupRelationSearchTabComponent, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), DsDynamicLookupRelationSearchTabComponent, VarDirective], + providers: [ { provide: SearchService, useValue: { search: () => createSuccessfulRemoteDataObject$(results) } }, { - provide: SelectableListService, useValue: selectableListService + provide: SelectableListService, useValue: selectableListService }, { - provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions) - } + provide: SearchConfigurationService, useValue: { + paginatedSearchOptions: observableOf(pSearchOptions) + } }, { provide: LookupRelationService, useValue: lookupRelationService }, { provide: PaginationService, useValue: new PaginationServiceStub() }, { provide: RelationshipDataService, useValue: relationshipService } - - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 9452918a978..b894e6b024f 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 @@ -23,6 +23,11 @@ import { RelationshipType } from '../../../../../../core/shared/item-relationshi import { Relationship } from '../../../../../../core/shared/item-relationships/relationship.model'; import { SearchObjects } from '../../../../../search/models/search-objects.model'; import { DSpaceObject } from '../../../../../../core/shared/dspace-object.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 { ThemedSearchComponent } from '../../../../../search/themed-search.component'; @Component({ @@ -34,7 +39,16 @@ import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model' provide: SEARCH_CONFIG_SERVICE, useClass: SearchConfigurationService } - ] + ], + imports: [ + AsyncPipe, + VarDirective, + TranslateModule, + NgbDropdownModule, + NgIf, + ThemedSearchComponent + ], + 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 d44f8f84a02..ecdf7cf8159 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 @@ -12,9 +12,10 @@ import { SearchObjects } from '../../../../../search/models/search-objects.model import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model'; @Component({ - selector: 'ds-themed-dynamic-lookup-relation-search-tab', - styleUrls: [], - templateUrl: '../../../../../theme-support/themed.component.html', + 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 472a719b27b..6d1e5c15f21 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 @@ -46,23 +46,22 @@ describe('DsDynamicLookupRelationSelectionTabComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [DsDynamicLookupRelationSelectionTabComponent, VarDirective], - imports: [TranslateModule.forRoot()], - providers: [ + imports: [TranslateModule.forRoot(), DsDynamicLookupRelationSelectionTabComponent, VarDirective], + providers: [ { - provide: SearchConfigurationService, useValue: { - paginatedSearchOptions: observableOf(pSearchOptions) - }, + provide: SearchConfigurationService, useValue: { + paginatedSearchOptions: observableOf(pSearchOptions) + }, }, { - provide: Router, useValue: router + provide: Router, useValue: router }, { - provide: PaginationService, useValue: new PaginationServiceStub() + provide: PaginationService, useValue: new PaginationServiceStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); })); diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts index a78bf8896c8..45557f54157 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts @@ -13,6 +13,10 @@ import { PageInfo } from '../../../../../../core/shared/page-info.model'; import { Context } from '../../../../../../core/shared/context.model'; import { createSuccessfulRemoteDataObject } from '../../../../../remote-data.utils'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; +import { ObjectCollectionComponent } from '../../../../../object-collection/object-collection.component'; +import { AsyncPipe, NgIf } from '@angular/common'; +import { PageSizeSelectorComponent } from '../../../../../page-size-selector/page-size-selector.component'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'ds-dynamic-lookup-relation-selection-tab', @@ -23,7 +27,15 @@ import { PaginationService } from '../../../../../../core/pagination/pagination. provide: SEARCH_CONFIG_SERVICE, useClass: SearchConfigurationService } - ] + ], + imports: [ + ObjectCollectionComponent, + NgIf, + AsyncPipe, + PageSizeSelectorComponent, + TranslateModule + ], + standalone: true }) /** diff --git a/src/app/shared/form/chips/chips.component.spec.ts b/src/app/shared/form/chips/chips.component.spec.ts index 050950ed4d5..032e3b278d7 100644 --- a/src/app/shared/form/chips/chips.component.spec.ts +++ b/src/app/shared/form/chips/chips.component.spec.ts @@ -27,22 +27,20 @@ describe('ChipsComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, SortablejsModule.forRoot({ animation: 150 }), - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), ChipsComponent, TestComponent, AuthorityConfidenceStateDirective - ], // declare the test component - providers: [ + ], + providers: [ ChangeDetectorRef, ChipsComponent, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -178,8 +176,10 @@ describe('ChipsComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 51666575825..1230876bea2 100644 --- a/src/app/shared/form/chips/chips.component.ts +++ b/src/app/shared/form/chips/chips.component.ts @@ -1,19 +1,33 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core'; -import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { NgbTooltip, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import isObject from 'lodash/isObject'; import { Chips } from './models/chips.model'; import { ChipsItem } from './models/chips-item.model'; import { DragService } from '../../../core/drag.service'; -import { TranslateService } from '@ngx-translate/core'; +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', styleUrls: ['./chips.component.scss'], templateUrl: './chips.component.html', + imports: [ + NgbTooltipModule, + NgClass, + NgForOf, + SortablejsModule, + AsyncPipe, + AuthorityConfidenceStateDirective, + NgIf, + TranslateModule + ], + 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 49eee5ae8f2..3df34490f48 100644 --- a/src/app/shared/form/directives/authority-confidence-state.directive.ts +++ b/src/app/shared/form/directives/authority-confidence-state.directive.ts @@ -33,7 +33,8 @@ import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/mod * Directive to add to the element a bootstrap utility class based on metadata confidence value */ @Directive({ - selector: '[dsAuthorityConfidenceState]' + selector: '[dsAuthorityConfidenceState]', + standalone: true }) export class AuthorityConfidenceStateDirective implements OnChanges, AfterViewInit { diff --git a/src/app/shared/form/form.component.html b/src/app/shared/form/form.component.html index 1b27c9d308d..24214103337 100644 --- a/src/app/shared/form/form.component.html +++ b/src/app/shared/form/form.component.html @@ -17,7 +17,7 @@ class="col-xs-2 d-flex flex-column justify-content-sm-start align-items-end"> diff --git a/src/app/shared/form/form.component.spec.ts b/src/app/shared/form/form.component.spec.ts index 2f3be3fded3..ce24fc020c7 100644 --- a/src/app/shared/form/form.component.spec.ts +++ b/src/app/shared/form/form.component.spec.ts @@ -137,29 +137,27 @@ describe('FormComponent test suite', () => { init(); /* TODO make sure these files use mocks instead of real services/components https://github.com/DSpace/dspace-angular/issues/281 */ TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, CommonModule, FormsModule, ReactiveFormsModule, NgbModule, StoreModule.forRoot({}, storeModuleConfig), - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), FormComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, DynamicFormValidationService, FormBuilderService, FormComponent, FormService, { provide: Store, useClass: StoreMock } - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -438,8 +436,14 @@ describe('FormComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [BrowserModule, + CommonModule, + FormsModule, + ReactiveFormsModule, + NgbModule] }) class TestComponent { diff --git a/src/app/shared/form/form.component.ts b/src/app/shared/form/form.component.ts index 79cf8ad2c7b..e999d3a4f8c 100644 --- a/src/app/shared/form/form.component.ts +++ b/src/app/shared/form/form.component.ts @@ -1,6 +1,12 @@ import { distinctUntilChanged, filter, map } from 'rxjs/operators'; import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { + AbstractControl, + ReactiveFormsModule, + UntypedFormArray, + UntypedFormControl, + UntypedFormGroup +} from '@angular/forms'; import { Observable, Subscription } from 'rxjs'; import { @@ -8,7 +14,7 @@ import { DynamicFormControlEvent, DynamicFormControlModel, DynamicFormGroupModel, - DynamicFormLayout, + DynamicFormLayout, DynamicFormsCoreModule, } from '@ng-dynamic-forms/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import findIndex from 'lodash/findIndex'; @@ -18,6 +24,9 @@ import { hasValue, isNotEmpty, isNotNull, isNull } from '../empty.util'; 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. @@ -26,7 +35,16 @@ import { FormFieldMetadataValueObject } from './builder/models/form-field-metada exportAs: 'formComponent', selector: 'ds-form', styleUrls: ['form.component.scss'], - templateUrl: 'form.component.html' + templateUrl: 'form.component.html', + imports: [ + DsDynamicFormComponent, + ReactiveFormsModule, + TranslateModule, + DynamicFormsCoreModule, + NgIf, + AsyncPipe, + ], + 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 792de6f2518..6ba1c938fe2 100644 --- a/src/app/shared/form/form.module.ts +++ b/src/app/shared/form/form.module.ts @@ -80,39 +80,37 @@ const DIRECTIVES = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS, - ...DIRECTIVES, - ], - imports: [ - CommonModule, - DynamicFormsCoreModule, - DynamicFormsNGBootstrapUIModule, - SearchModule, - SharedModule, - TranslateModule, - SortablejsModule, - NgxMaskModule.forRoot(), - NgbDatepickerModule, - NgbTimepickerModule, - CdkTreeModule, - ], - exports: [ - ...COMPONENTS, - ...DIRECTIVES, - ], - providers: [ - { - provide: DYNAMIC_FORM_CONTROL_MAP_FN, - useValue: dsDynamicFormControlMapFn - }, - DynamicFormLayoutService, - DynamicFormService, - DynamicFormValidationService, - FormBuilderService, - DsDynamicTypeBindRelationService, - FormService, - ] + imports: [ + CommonModule, + DynamicFormsCoreModule, + DynamicFormsNGBootstrapUIModule, + SearchModule, + SharedModule, + 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, + ] }) export class FormModule { } 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 d4484dbfa33..da9866ea5cb 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 @@ -20,21 +20,19 @@ describe('NumberPickerComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, - NgbModule - ], - declarations: [ + NgbModule, NumberPickerComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, NumberPickerComponent, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -146,8 +144,12 @@ describe('NumberPickerComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + NgbModule] }) 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 82240c41d11..19fbb9c748f 100644 --- a/src/app/shared/form/number-picker/number-picker.component.ts +++ b/src/app/shared/form/number-picker/number-picker.component.ts @@ -1,6 +1,7 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core'; -import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; import { isEmpty } from '../../empty.util'; +import { NgClass } from '@angular/common'; @Component({ selector: 'ds-number-picker', @@ -9,6 +10,11 @@ import { isEmpty } from '../../empty.util'; providers: [ {provide: NG_VALUE_ACCESSOR, useExisting: NumberPickerComponent, multi: true} ], + imports: [ + NgClass, + FormsModule + ], + 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 590c69a1596..4e843f5040f 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 @@ -12,12 +12,11 @@ describe('VocabularyTreeviewModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ TranslateModule.forRoot() ], - declarations: [ VocabularyTreeviewModalComponent ], - providers: [ + imports: [TranslateModule.forRoot(), VocabularyTreeviewModalComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, - ], - }) + ] +}) .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 c6b0bf20feb..33248ffbf99 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 @@ -2,11 +2,18 @@ import { Component, Input } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model'; 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'; @Component({ selector: 'ds-vocabulary-treeview-modal', templateUrl: './vocabulary-treeview-modal.component.html', - styleUrls: ['./vocabulary-treeview-modal.component.scss'] + styleUrls: ['./vocabulary-treeview-modal.component.scss'], + imports: [ + VocabularyTreeviewComponent, + TranslateModule + ], + 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 9e6e8dedd35..f6b120cd01c 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 @@ -75,25 +75,23 @@ describe('VocabularyTreeviewComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CdkTreeModule, StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), VocabularyTreeviewComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub }, { provide: VocabularyService, useValue: vocabularyServiceStub }, { provide: NgbActiveModal, useValue: modalStub }, provideMockStore({ initialState }), ChangeDetectorRef, VocabularyTreeviewComponent - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents().then(() => { + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents().then(() => { vocabularyTreeviewServiceStub.getData.and.returnValue(observableOf([])); vocabularyTreeviewServiceStub.isLoading.and.returnValue(observableOf(false)); }); @@ -283,8 +281,10 @@ describe('VocabularyTreeviewComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 13d4495e614..3de31f57fe8 100644 --- a/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts +++ b/src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts @@ -1,10 +1,10 @@ -import { FlatTreeControl } from '@angular/cdk/tree'; +import { CdkTreeModule, FlatTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, OnChanges, SimpleChanges } from '@angular/core'; import { map } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; import { Store } from '@ngrx/store'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model'; import { hasValue, isEmpty, isNotEmpty } from '../../empty.util'; @@ -19,6 +19,11 @@ import { CoreState } from '../../../core/core-state.model'; import { lowerCase } from 'lodash/string'; import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service'; import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; +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'; /** * Component that shows a hierarchical vocabulary in a tree view @@ -26,7 +31,18 @@ import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operato @Component({ selector: 'ds-vocabulary-treeview', templateUrl: './vocabulary-treeview.component.html', - styleUrls: ['./vocabulary-treeview.component.scss'] + styleUrls: ['./vocabulary-treeview.component.scss'], + imports: [ + FormsModule, + NgbTooltipModule, + NgIf, + CdkTreeModule, + TranslateModule, + AsyncPipe, + ThemedLoadingComponent, + AlertComponent + ], + 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 67f66c97573..a1c415b5b2b 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts @@ -22,12 +22,12 @@ describe('GoogleRecaptchaComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GoogleRecaptchaComponent ], - providers: [ - { provide: ConfigurationDataService, useValue: configurationDataService }, - { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, + imports: [GoogleRecaptchaComponent], + providers: [ + { provide: ConfigurationDataService, useValue: configurationDataService }, + { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, ] - }) +}) .compileComponents(); }); diff --git a/src/app/shared/google-recaptcha/google-recaptcha.component.ts b/src/app/shared/google-recaptcha/google-recaptcha.component.ts index 16c49ba45bf..c5697cf1ae3 100644 --- a/src/app/shared/google-recaptcha/google-recaptcha.component.ts +++ b/src/app/shared/google-recaptcha/google-recaptcha.component.ts @@ -5,11 +5,14 @@ import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators' import { Observable } from 'rxjs'; import { NativeWindowRef, NativeWindowService } from 'src/app/core/services/window.service'; 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'], + 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 9c222dfe3ae..924e0cf06d6 100644 --- a/src/app/shared/hover-class.directive.spec.ts +++ b/src/app/shared/hover-class.directive.spec.ts @@ -4,7 +4,8 @@ import { HoverClassDirective } from './hover-class.directive'; import { By } from '@angular/platform-browser'; @Component({ - template: `
` + template: `
`, + standalone: true }) class TestComponent { } @@ -16,8 +17,8 @@ describe('HoverClassDirective', () => { beforeEach(() => { fixture = TestBed.configureTestingModule({ - declarations: [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 4c414868584..a6beb226561 100644 --- a/src/app/shared/hover-class.directive.ts +++ b/src/app/shared/hover-class.directive.ts @@ -1,7 +1,8 @@ import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[dsHoverClass]' + 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 7ea0b96d5be..8bc5bd11eca 100644 --- a/src/app/shared/idle-modal/idle-modal.component.spec.ts +++ b/src/app/shared/idle-modal/idle-modal.component.spec.ts @@ -22,15 +22,14 @@ describe('IdleModalComponent', () => { authServiceStub = jasmine.createSpyObj('authService', ['setIdle']); storeStub = jasmine.createSpyObj('store', ['dispatch']); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [IdleModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), IdleModalComponent], + providers: [ { provide: NgbActiveModal, useValue: modalStub }, { provide: AuthService, useValue: authServiceStub }, { provide: Store, useValue: storeStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 4873137ff1e..3baf219aeae 100644 --- a/src/app/shared/idle-modal/idle-modal.component.ts +++ b/src/app/shared/idle-modal/idle-modal.component.ts @@ -6,10 +6,13 @@ import { hasValue } from '../empty.util'; import { Store } from '@ngrx/store'; import { AppState } from '../../app.reducer'; import { LogOutAction } from '../../core/auth/auth.actions'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-idle-modal', - templateUrl: 'idle-modal.component.html', + 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 af03afc05f9..3b8ece938cb 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts @@ -42,18 +42,18 @@ describe('ImpersonateNavbarComponent', () => { }; TestBed.configureTestingModule({ - declarations: [ImpersonateNavbarComponent, VarDirective], - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), StoreModule.forRoot({ auth: authReducer }, storeModuleConfig), - ], - providers: [ + ImpersonateNavbarComponent, VarDirective + ], + providers: [ { provide: AuthService, useValue: authService }, provideMockStore({ initialState }), - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 6166ee950dc..ed0d1471c28 100644 --- a/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts +++ b/src/app/shared/impersonate-navbar/impersonate-navbar.component.ts @@ -4,10 +4,15 @@ import { AppState } from '../../app.reducer'; import { AuthService } from '../../core/auth/auth.service'; import { Observable } from 'rxjs'; 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' + 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 4c979a1d4c9..61b7901458c 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 @@ -35,11 +35,10 @@ describe('DsoInputSuggestionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule], - declarations: [DsoInputSuggestionsComponent], - providers: [], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(DsoInputSuggestionsComponent, { + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, DsoInputSuggestionsComponent], + providers: [], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(DsoInputSuggestionsComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); 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 26c7d91b416..cfe1f73c3d3 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,25 +1,31 @@ import { Component, forwardRef, Input } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; import { InputSuggestionsComponent } from '../input-suggestions.component'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { CollectionElementLinkType } from '../../object-collection/collection-element-link.type'; import { hasValue } from '../../empty.util'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +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'; @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 - } - ] + 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] }) /** 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 6a0324d2ac4..0f0ce3ef21f 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 @@ -21,11 +21,10 @@ describe('FilterInputSuggestionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule], - declarations: [FilterInputSuggestionsComponent], - providers: [], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(FilterInputSuggestionsComponent, { + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, FilterInputSuggestionsComponent], + providers: [], + schemas: [NO_ERRORS_SCHEMA] +}).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 ee47dc80c9e..35f7f0c0c28 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,21 +1,27 @@ import { Component, forwardRef, Input } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; 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 - } - ] + 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 9793844e892..2751c31ad02 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.spec.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.spec.ts @@ -23,11 +23,10 @@ describe('InputSuggestionsComponent', () => { }, { displayValue: 'suggestion tres', value: 'suggestion tres' }]; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule], - declarations: [InputSuggestionsComponent], - providers: [], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(InputSuggestionsComponent, { + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, InputSuggestionsComponent], + providers: [], + schemas: [NO_ERRORS_SCHEMA] +}).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 7e05dbcc8c6..2eefe461c85 100644 --- a/src/app/shared/input-suggestions/input-suggestions.component.ts +++ b/src/app/shared/input-suggestions/input-suggestions.component.ts @@ -12,11 +12,16 @@ import { } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { hasValue, isNotEmpty } from '../empty.util'; -import { ControlValueAccessor } from '@angular/forms'; +import { ControlValueAccessor, FormsModule } from '@angular/forms'; +import { NgClass, NgFor, AsyncPipe } from '@angular/common'; +import { DebounceDirective } from '../utils/debounce.directive'; +import { ClickOutsideDirective } from '../utils/click-outside.directive'; @Component({ - selector: 'ds-input-suggestions', - templateUrl: './input-suggestions.component.html', + selector: 'ds-input-suggestions', + templateUrl: './input-suggestions.component.html', + standalone: true, + imports: [FormsModule, ClickOutsideDirective, DebounceDirective, NgClass, NgFor, AsyncPipe] }) /** 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 dad2edc30e9..8a935f9fbb7 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 @@ -23,15 +23,14 @@ describe('ValidationSuggestionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, FormsModule, ReactiveFormsModule], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 050b3296c5e..5d0cee18e99 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,24 +1,29 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'; -import { UntypedFormControl, UntypedFormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; +import { UntypedFormControl, UntypedFormGroup, NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { MetadatumViewModel } from '../../../core/shared/metadata.models'; import { MetadataFieldValidator } from '../../utils/metadatafield-validator.directive'; import { InputSuggestionsComponent } from '../input-suggestions.component'; import { InputSuggestion } from '../input-suggestions.model'; +import { NgClass, NgFor, AsyncPipe } from '@angular/common'; +import { DebounceDirective } from '../../utils/debounce.directive'; +import { ClickOutsideDirective } from '../../utils/click-outside.directive'; @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 - } - ] + 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] }) /** 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 6d3c8470865..a587da11e72 100644 --- a/src/app/shared/lang-switch/lang-switch.component.spec.ts +++ b/src/app/shared/lang-switch/lang-switch.component.spec.ts @@ -67,18 +67,15 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot( - { + imports: [HttpClientTestingModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useClass: CustomLoader } - } - )], - declarations: [LangSwitchComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - TranslateService, - { provide: LocaleService, useValue: getMockLocaleService() }, - ] - }).compileComponents() + }), LangSwitchComponent], + schemas: [NO_ERRORS_SCHEMA], + providers: [ + TranslateService, + { provide: LocaleService, useValue: getMockLocaleService() }, + ] +}).compileComponents() .then(() => { translate = TestBed.inject(TranslateService); translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code)); @@ -153,18 +150,15 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - imports: [HttpClientTestingModule, TranslateModule.forRoot( - { + imports: [HttpClientTestingModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useClass: CustomLoader } - } - )], - declarations: [LangSwitchComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - TranslateService, - { provide: LocaleService, useValue: getMockLocaleService() } - ] - }).compileComponents(); + }), LangSwitchComponent], + schemas: [NO_ERRORS_SCHEMA], + providers: [ + TranslateService, + { provide: LocaleService, useValue: getMockLocaleService() } + ] +}).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 41d707a0568..58c06ca4611 100644 --- a/src/app/shared/lang-switch/lang-switch.component.ts +++ b/src/app/shared/lang-switch/lang-switch.component.ts @@ -1,15 +1,19 @@ import { Component, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } 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 { NgIf, NgFor } from '@angular/common'; @Component({ - selector: 'ds-lang-switch', - styleUrls: ['lang-switch.component.scss'], - templateUrl: 'lang-switch.component.html', + 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/loading/loading.component.spec.ts b/src/app/shared/loading/loading.component.spec.ts index d564d43dc0d..166b375db06 100644 --- a/src/app/shared/loading/loading.component.spec.ts +++ b/src/app/shared/loading/loading.component.spec.ts @@ -17,17 +17,17 @@ describe('LoadingComponent (inline template)', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [LoadingComponent], // declare the test component - 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 e64d89620b7..a150436a9fa 100644 --- a/src/app/shared/loading/loading.component.ts +++ b/src/app/shared/loading/loading.component.ts @@ -4,11 +4,14 @@ 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' + 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 48773d75c81..212efd1a43c 100644 --- a/src/app/shared/loading/themed-loading.component.ts +++ b/src/app/shared/loading/themed-loading.component.ts @@ -7,9 +7,10 @@ import { ThemeService } from '../theme-support/theme.service'; * Themed wrapper for LoadingComponent */ @Component({ - selector: 'ds-themed-loading', - styleUrls: [], - templateUrl: '../../shared/theme-support/themed.component.html', + 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 4700cf93071..bd4e461709b 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 @@ -34,27 +34,25 @@ describe('LogInContainerComponent', () => { }); // refine the test module by declaring the test component TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot(authReducer), SharedModule, TranslateModule.forRoot(), RouterTestingModule, - ], - declarations: [ TestComponent - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: HardRedirectService, useValue: hardRedirectService }, LogInContainerComponent - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA - ] - }) + ] +}) .compileComponents(); })); @@ -113,8 +111,13 @@ describe('LogInContainerComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + SharedModule, + 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 f6a08a1e1ec..4501cb02f75 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 @@ -2,14 +2,17 @@ import { Component, Injector, Input, OnInit } from '@angular/core'; import { rendersAuthMethodType } from '../methods/log-in.methods-decorator'; import { AuthMethod } from '../../../core/auth/models/auth.method'; +import { NgComponentOutlet } from '@angular/common'; /** * 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'] + 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 57ed3e46946..0e064c2cc08 100644 --- a/src/app/shared/log-in/log-in.component.spec.ts +++ b/src/app/shared/log-in/log-in.component.spec.ts @@ -51,23 +51,21 @@ describe('LogInComponent', () => { // refine the test module by declaring the test component void TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, StoreModule.forRoot(authReducer, { - runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false - } + runtimeChecks: { + strictStateImmutability: false, + strictActionImmutability: false + } }), RouterTestingModule, SharedModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), TestComponent - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: NativeWindowService, useFactory: NativeWindowMockFactory }, // { provide: Router, useValue: new RouterStub() }, @@ -76,11 +74,11 @@ describe('LogInComponent', () => { { provide: AuthorizationDataService, useValue: authorizationService }, provideMockStore({ initialState }), LogInComponent - ], - schemas: [ + ], + schemas: [ CUSTOM_ELEMENTS_SCHEMA - ] - }) + ] +}) .compileComponents(); })); @@ -132,8 +130,13 @@ describe('LogInComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FormsModule, + ReactiveFormsModule, + RouterTestingModule, + SharedModule] }) 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 4bfae183326..53617f3e5d2 100644 --- a/src/app/shared/log-in/log-in.component.ts +++ b/src/app/shared/log-in/log-in.component.ts @@ -12,16 +12,21 @@ import { hasValue } from '../empty.util'; import { AuthService } from '../../core/auth/auth.service'; import { CoreState } from '../../core/core-state.model'; import { AuthMethodType } from '../../core/auth/models/auth.method-type'; +import { LogInContainerComponent } from './container/log-in-container.component'; +import { ThemedLoadingComponent } from '../loading/themed-loading.component'; +import { NgIf, NgFor, AsyncPipe } from '@angular/common'; /** * /users/sign-in * @class LogInComponent */ @Component({ - selector: 'ds-log-in', - templateUrl: './log-in.component.html', - styleUrls: ['./log-in.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, + 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 5d7a1759737..989ed8c9981 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 @@ -54,14 +54,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() - ], - declarations: [ + TranslateModule.forRoot(), LogInExternalProviderComponent - ], - providers: [ + ], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: 'authMethodProvider', useValue: new AuthMethod(AuthMethodType.Orcid, 0, location) }, { provide: 'isStandalonePage', useValue: true }, @@ -70,11 +68,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 f1829684575..d30d324d2aa 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 @@ -15,11 +15,14 @@ import { URLCombiner } from '../../../../core/url-combiner/url-combiner'; import { CoreState } from '../../../../core/core-state.model'; import { renderAuthMethodFor } from '../log-in.methods-decorator'; import { AuthMethodType } from '../../../../core/auth/models/auth.method-type'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-log-in-external-provider', - templateUrl: './log-in-external-provider.component.html', - styleUrls: ['./log-in-external-provider.component.scss'] + selector: 'ds-log-in-external-provider', + templateUrl: './log-in-external-provider.component.html', + styleUrls: ['./log-in-external-provider.component.scss'], + standalone: true, + imports: [TranslateModule] }) @renderAuthMethodFor(AuthMethodType.Oidc) @renderAuthMethodFor(AuthMethodType.Shibboleth) diff --git a/src/app/shared/log-in/methods/password/log-in-password.component.spec.ts b/src/app/shared/log-in/methods/password/log-in-password.component.spec.ts index 2c9081d1c32..840ea44dfe4 100644 --- a/src/app/shared/log-in/methods/password/log-in-password.component.spec.ts +++ b/src/app/shared/log-in/methods/password/log-in-password.component.spec.ts @@ -48,28 +48,26 @@ describe('LogInPasswordComponent', () => { 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() - ], - declarations: [ - LogInPasswordComponent, - BrowserOnlyMockPipe, - ], - providers: [ + TranslateModule.forRoot(), + LogInPasswordComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ { provide: AuthService, useClass: AuthServiceStub }, { provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub }, { provide: 'authMethodProvider', useValue: new AuthMethod(AuthMethodType.Password, 0) }, { provide: 'isStandalonePage', useValue: true }, { provide: HardRedirectService, useValue: hardRedirectService }, 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 61323940192..ac1db8330fd 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,6 +1,6 @@ import { map } from 'rxjs/operators'; import { Component, Inject, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { select, Store } from '@ngrx/store'; import { Observable } from 'rxjs'; @@ -18,16 +18,22 @@ import { CoreState } from '../../../../core/core-state.model'; import { getForgotPasswordRoute, getRegisterRoute } from '../../../../app-routing-paths'; import { FeatureID } from '../../../../core/data/feature-authorization/feature-id'; import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service'; +import { BrowserOnlyPipe } from '../../../utils/browser-only.pipe'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { NgIf, AsyncPipe } from '@angular/common'; /** * /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] + 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] }) @renderAuthMethodFor(AuthMethodType.Password) 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 028738a019c..cbd5ed9ed3d 100644 --- a/src/app/shared/log-out/log-out.component.spec.ts +++ b/src/app/shared/log-out/log-out.component.spec.ts @@ -35,28 +35,26 @@ 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, - strictActionImmutability: false - } + runtimeChecks: { + strictStateImmutability: false, + strictActionImmutability: false + } }), - TranslateModule.forRoot() - ], - declarations: [ - LogOutComponent, - BrowserOnlyMockPipe, - ], - providers: [ + TranslateModule.forRoot(), + LogOutComponent + ], + declarations: [BrowserOnlyMockPipe], + 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 6fa71caa328..77b2675d154 100644 --- a/src/app/shared/log-out/log-out.component.ts +++ b/src/app/shared/log-out/log-out.component.ts @@ -8,12 +8,17 @@ import { LogOutAction } from '../../core/auth/auth.actions'; import { getLogOutError, } from '../../core/auth/selectors'; import { AppState } from '../../app.reducer'; 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] + 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/external-link-menu-item.component.spec.ts b/src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts index 4c55758b3d8..28d258f268e 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 @@ -19,13 +19,12 @@ describe('ExternalLinkMenuItemComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ExternalLinkMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), ExternalLinkMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: { text: text, href: link } }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 5fbbe608dba..a295cad0c74 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 @@ -3,13 +3,17 @@ import { rendersMenuItemForType } from '../menu-item.decorator'; import { isNotEmpty } from '../../empty.util'; import { ExternalLinkMenuItemModel } from './models/external-link.model'; import { MenuItemType } from '../menu-item-type.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass } from '@angular/common'; /** * Component that renders a menu section of type EXTERNAL */ @Component({ - selector: 'ds-external-link-menu-item', - templateUrl: './external-link-menu-item.component.html' + selector: 'ds-external-link-menu-item', + templateUrl: './external-link-menu-item.component.html', + standalone: true, + imports: [NgClass, TranslateModule] }) @rendersMenuItemForType(MenuItemType.EXTERNAL) export class ExternalLinkMenuItemComponent implements OnInit { 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 96444a5447d..a888144c6b8 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 @@ -25,14 +25,14 @@ describe('LinkMenuItemComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [LinkMenuItemComponent, RouterLinkDirectiveStub, QueryParamsDirectiveStub], - providers: [ + imports: [TranslateModule.forRoot(), LinkMenuItemComponent], + declarations: [RouterLinkDirectiveStub, QueryParamsDirectiveStub], + providers: [ { provide: 'itemModelProvider', useValue: { text: text, link: link, queryParams: queryParams } }, { provide: Router, useValue: RouterStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .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 39f90069877..e567169aa23 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 @@ -3,14 +3,18 @@ import { LinkMenuItemModel } from './models/link.model'; import { rendersMenuItemForType } from '../menu-item.decorator'; import { isNotEmpty } from '../../empty.util'; import { MenuItemType } from '../menu-item-type.model'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass } from '@angular/common'; /** * Component that renders a menu section of type LINK */ @Component({ - selector: 'ds-link-menu-item', - templateUrl: './link-menu-item.component.html' + selector: 'ds-link-menu-item', + templateUrl: './link-menu-item.component.html', + standalone: true, + imports: [NgClass, RouterLink, TranslateModule] }) @rendersMenuItemForType(MenuItemType.LINK) export class LinkMenuItemComponent implements OnInit { 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 18ae66b23dc..fd1fbed5a24 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 @@ -17,13 +17,12 @@ describe('OnClickMenuItemComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [OnClickMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), OnClickMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: item }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 68e477b1fbc..d0ee8f7fe3a 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 @@ -2,14 +2,18 @@ import { Component, Inject } from '@angular/core'; import { rendersMenuItemForType } from '../menu-item.decorator'; import { OnClickMenuItemModel } from './models/onclick.model'; import { MenuItemType } from '../menu-item-type.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; /** * Component that renders a menu section of type ONCLICK */ @Component({ - selector: 'ds-onclick-menu-item', - styleUrls: ['./onclick-menu-item.component.scss'], - templateUrl: './onclick-menu-item.component.html' + selector: 'ds-onclick-menu-item', + styleUrls: ['./onclick-menu-item.component.scss'], + templateUrl: './onclick-menu-item.component.html', + standalone: true, + imports: [NgIf, TranslateModule] }) @rendersMenuItemForType(MenuItemType.ONCLICK) export class OnClickMenuItemComponent { 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 a0c159af23a..8aaf8890548 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 @@ -11,13 +11,12 @@ describe('TextMenuItemComponent', () => { const text = 'HELLO'; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [TextMenuItemComponent], - providers: [ + imports: [TranslateModule.forRoot(), TextMenuItemComponent], + providers: [ { provide: 'itemModelProvider', useValue: { text: text } }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + 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 25549f53a89..8bf059b6d6a 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,13 +2,16 @@ import { Component, Inject } from '@angular/core'; import { TextMenuItemModel } from './models/text.model'; import { rendersMenuItemForType } from '../menu-item.decorator'; import { MenuItemType } from '../menu-item-type.model'; +import { TranslateModule } from '@ngx-translate/core'; /** * Component that renders a menu section of type TEXT */ @Component({ - selector: 'ds-text-menu-item', - templateUrl: './text-menu-item.component.html', + selector: 'ds-text-menu-item', + templateUrl: './text-menu-item.component.html', + standalone: true, + imports: [TranslateModule] }) @rendersMenuItemForType(MenuItemType.TEXT) export class TextMenuItemComponent { 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 f40f45f9b4a..8cbb639d550 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 @@ -22,15 +22,14 @@ describe('MenuSectionComponent', () => { active: false } as any; TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 9b5bd499e17..a29c0c63203 100644 --- a/src/app/shared/menu/menu-section/menu-section.component.ts +++ b/src/app/shared/menu/menu-section/menu-section.component.ts @@ -14,8 +14,9 @@ import { MenuItemType } from '../menu-item-type.model'; * A basic implementation of a menu section's component */ @Component({ - selector: 'ds-menu-section', - template: '' + 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 f0660fab4a2..b678eeb8cdb 100644 --- a/src/app/shared/menu/menu.component.spec.ts +++ b/src/app/shared/menu/menu.component.spec.ts @@ -55,17 +55,16 @@ describe('MenuComponent', () => { }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule], - declarations: [MenuComponent], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, MenuComponent], + providers: [ Injector, { provide: ThemeService, useValue: getMockThemeService() }, { provide: MenuService, useClass: MenuServiceStub }, { provide: AuthorizationDataService, useValue: authorizationService }, { provide: ActivatedRoute, useValue: routeStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MenuComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(MenuComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); diff --git a/src/app/shared/menu/menu.component.ts b/src/app/shared/menu/menu.component.ts index 35e180b4761..7f7ccb91a78 100644 --- a/src/app/shared/menu/menu.component.ts +++ b/src/app/shared/menu/menu.component.ts @@ -18,8 +18,9 @@ import { ThemeService } from '../theme-support/theme.service'; * A basic implementation of a MenuComponent */ @Component({ - selector: 'ds-menu', - template: '' + 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 28bdab99879..c07fe7a2092 100644 --- a/src/app/shared/menu/menu.module.ts +++ b/src/app/shared/menu/menu.module.ts @@ -31,20 +31,18 @@ const PROVIDERS = [ ]; @NgModule({ - imports: [ - ...MODULES - ], - declarations: [ - ...COMPONENTS, - ...ENTRY_COMPONENTS, - ], - providers: [ - ...PROVIDERS, - ...ENTRY_COMPONENTS, - ], - exports: [ - ...COMPONENTS - ] + 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 5ef272db3b3..40301daf0f8 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 @@ -7,7 +7,8 @@ import { MetadataFieldWrapperComponent } from './metadata-field-wrapper.componen @Component({ selector: 'ds-component-without-content', template: '\n' + - '' + '', + standalone: true }) class NoContentComponent { public hideIfNoTextContent = true; @@ -16,9 +17,10 @@ class NoContentComponent { @Component({ selector: 'ds-component-with-empty-spans', template: '\n' + - ' \n' + - ' \n' + - '' + ' \n' + + ' \n' + + '', + standalone: true }) class SpanContentComponent { @Input() hideIfNoTextContent = true; @@ -27,8 +29,9 @@ class SpanContentComponent { @Component({ selector: 'ds-component-with-text', template: '\n' + - ' The quick brown fox jumps over the lazy dog\n' + - '' + ' The quick brown fox jumps over the lazy dog\n' + + '', + standalone: true }) class TextContentComponent { @Input() hideIfNoTextContent = true; @@ -41,8 +44,8 @@ describe('MetadataFieldWrapperComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [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 5c6b99248f7..e5aa73b1c99 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,13 +1,16 @@ 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' + 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 7edf1a700e5..1eca9df0dde 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 @@ -40,20 +40,19 @@ describe('MetadataRepresentationLoaderComponent', () => { getThemeName: themeName, }); TestBed.configureTestingModule({ - imports: [], - declarations: [MetadataRepresentationLoaderComponent, PlainTextMetadataListElementComponent, MetadataRepresentationDirective], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + imports: [MetadataRepresentationLoaderComponent, PlainTextMetadataListElementComponent, MetadataRepresentationDirective], + schemas: [NO_ERRORS_SCHEMA], + providers: [ { - provide: METADATA_REPRESENTATION_COMPONENT_FACTORY, - useValue: jasmine.createSpy('getMetadataRepresentationComponent').and.returnValue(PlainTextMetadataListElementComponent) + 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 42ee093278a..1194936e6e5 100644 --- a/src/app/shared/metadata-representation/metadata-representation-loader.component.ts +++ b/src/app/shared/metadata-representation/metadata-representation-loader.component.ts @@ -12,8 +12,10 @@ import { hasValue, isNotEmpty, hasNoValue } from '../empty.util'; import { ThemeService } from '../theme-support/theme.service'; @Component({ - selector: 'ds-metadata-representation-loader', - templateUrl: './metadata-representation-loader.component.html' + selector: 'ds-metadata-representation-loader', + templateUrl: './metadata-representation-loader.component.html', + standalone: true, + imports: [MetadataRepresentationDirective] }) /** * 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.directive.ts b/src/app/shared/metadata-representation/metadata-representation.directive.ts index 9ff0573baff..e58a48b2c9a 100644 --- a/src/app/shared/metadata-representation/metadata-representation.directive.ts +++ b/src/app/shared/metadata-representation/metadata-representation.directive.ts @@ -1,7 +1,8 @@ import { Directive, ViewContainerRef } from '@angular/core'; @Directive({ - selector: '[dsMetadataRepresentation]', + selector: '[dsMetadataRepresentation]', + standalone: true }) /** * Directive used as a hook to know where to inject the dynamic metadata representation component 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 b79040fb125..b8ecbb73432 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 @@ -37,15 +37,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, + }, }), - ], - providers: [ + ClaimedTaskActionsApproveComponent + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -53,10 +54,9 @@ describe('ClaimedTaskActionsApproveComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - declarations: [ClaimedTaskActionsApproveComponent], - 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 467d1514c90..0ac7d085289 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 @@ -6,18 +6,22 @@ import { RemoteData } from '../../../../core/data/remote-data'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { Router } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; import { ClaimedApprovedTaskSearchResult } from '../../../object-collection/shared/claimed-approved-task-search-result.model'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; export const WORKFLOW_TASK_OPTION_APPROVE = 'submit_approve'; @rendersWorkflowTaskOption(WORKFLOW_TASK_OPTION_APPROVE) @Component({ - selector: 'ds-claimed-task-actions-approve', - styleUrls: ['./claimed-task-actions-approve.component.scss'], - templateUrl: './claimed-task-actions-approve.component.html', + 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 a2e0b141345..008040d0dda 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 @@ -95,16 +95,16 @@ describe('ClaimedTaskActionsComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ClaimedTaskActionsComponent, VarDirective], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ClaimedTaskActionsComponent, VarDirective + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -112,9 +112,9 @@ describe('ClaimedTaskActionsComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce }, { provide: WorkflowActionDataService, useValue: workflowActionService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedTaskActionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 195a2193e56..267e66295e6 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,8 +1,8 @@ import { Component, Injector, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { Observable } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { ClaimedTaskDataService } from '../../../core/tasks/claimed-task-data.service'; import { ClaimedTask } from '../../../core/tasks/models/claimed-task-object.model'; @@ -16,14 +16,20 @@ import { WorkflowAction } from '../../../core/tasks/models/workflow-action-objec import { WorkflowActionDataService } from '../../../core/data/workflow-action-data.service'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; import { Item } from '../../../core/shared/item.model'; +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'; /** * 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', + 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 092e53f3f4d..6a6f079224c 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 @@ -36,15 +36,16 @@ describe('ClaimedTaskActionsDeclineTaskComponent', () => { mockPoolTaskDataService = new PoolTaskDataService(null, null, null, null); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ClaimedTaskActionsDeclineTaskComponent + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -52,10 +53,9 @@ describe('ClaimedTaskActionsDeclineTaskComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - declarations: [ClaimedTaskActionsDeclineTaskComponent], - 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 5afbde7d7d9..40e28f800f8 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 @@ -3,7 +3,7 @@ import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-ac import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; import { Router } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; @@ -12,14 +12,18 @@ import { } from '../../../object-collection/shared/claimed-declined-task-task-search-result.model'; import { Observable, of as observableOf } from 'rxjs'; import { RemoteData } from 'src/app/core/data/remote-data'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; export const WORKFLOW_TASK_OPTION_DECLINE_TASK = 'submit_decline_task'; @rendersWorkflowTaskOption(WORKFLOW_TASK_OPTION_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'] + 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 7bdf57561f0..cb233a3cfc3 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 @@ -31,15 +31,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, + }, }), - ], - providers: [ + ClaimedTaskActionsEditMetadataComponent + ], + providers: [ { provide: ClaimedTaskDataService, useValue: {} }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -47,10 +48,9 @@ describe('ClaimedTaskActionsEditMetadataComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - declarations: [ClaimedTaskActionsEditMetadataComponent], - 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 7da189dddd3..cb755dccb03 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,19 +1,23 @@ import { Component, Injector } from '@angular/core'; import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf, AsyncPipe } from '@angular/common'; export const WORKFLOW_TASK_OPTION_EDIT_METADATA = 'submit_edit_metadata'; @rendersWorkflowTaskOption(WORKFLOW_TASK_OPTION_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', + 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 bb41fedfb5d..f3b18d21108 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 @@ -48,13 +48,11 @@ describe('AdvancedClaimedTaskActionRatingComponent', () => { searchService = new SearchServiceStub(); await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ], - declarations: [ - AdvancedClaimedTaskActionRatingComponent, - ], - providers: [ + AdvancedClaimedTaskActionRatingComponent + ], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: NotificationsService, useValue: notificationService }, @@ -62,9 +60,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 a1cc81e050c..a2d39cfca3f 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,7 +1,7 @@ import { Component, Injector } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; import { @@ -12,15 +12,18 @@ import { ADVANCED_WORKFLOW_TASK_OPTION_RATING, } from '../../../../workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component'; import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * Advanced Workflow button that redirect to the {@link AdvancedWorkflowActionRatingComponent} */ @rendersWorkflowTaskOption(ADVANCED_WORKFLOW_TASK_OPTION_RATING) @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'] + 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 2d369ae014e..f0ef17be3e3 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 @@ -44,18 +44,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, + }, }), - ], - declarations: [ClaimedTaskActionsRejectComponent], - providers: [ + ClaimedTaskActionsRejectComponent + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, Injector, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -65,9 +65,9 @@ describe('ClaimedTaskActionsRejectComponent', () => { { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, UntypedFormBuilder, NgbModal, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedTaskActionsRejectComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 7d68af1b8ff..1190327c154 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,26 +1,29 @@ import { Component, Injector, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbModalRef, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-decorator'; import { Router } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; import { Observable, of } from 'rxjs'; import { RemoteData } from '../../../../core/data/remote-data'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { ClaimedDeclinedTaskSearchResult } from '../../../object-collection/shared/claimed-declined-task-search-result.model'; +import { NgIf, AsyncPipe } from '@angular/common'; export const WORKFLOW_TASK_OPTION_REJECT = 'submit_reject'; @rendersWorkflowTaskOption(WORKFLOW_TASK_OPTION_REJECT) @Component({ - selector: 'ds-claimed-task-actions-reject', - styleUrls: ['./claimed-task-actions-reject.component.scss'], - templateUrl: './claimed-task-actions-reject.component.html', + 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 765849f0aec..d0311027953 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 @@ -37,15 +37,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, + }, }), - ], - providers: [ + ClaimedTaskActionsReturnToPoolComponent + ], + providers: [ { provide: ClaimedTaskDataService, useValue: claimedTaskService }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -53,10 +54,9 @@ describe('ClaimedTaskActionsReturnToPoolComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: mockPoolTaskDataService }, - ], - declarations: [ClaimedTaskActionsReturnToPoolComponent], - 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 7949176968d..ee5744c3afd 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 @@ -4,21 +4,25 @@ import { rendersWorkflowTaskOption } from '../switcher/claimed-task-actions-deco import { Observable } from 'rxjs'; import { Router } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; import { RemoteData } from '../../../../core/data/remote-data'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { PoolTaskDataService } from '../../../../core/tasks/pool-task-data.service'; import { take } from 'rxjs/operators'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; export const WORKFLOW_TASK_OPTION_RETURN_TO_POOL = 'return_to_pool'; @rendersWorkflowTaskOption(WORKFLOW_TASK_OPTION_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', + 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.spec.ts b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts index 81fe4234813..102c320cf14 100644 --- a/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts +++ b/src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts @@ -51,14 +51,12 @@ describe('AdvancedClaimedTaskActionSelectReviewerComponent', () => { searchService = new SearchServiceStub(); await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ], - declarations: [ - AdvancedClaimedTaskActionSelectReviewerComponent, - NgbTooltip, - ], - providers: [ + AdvancedClaimedTaskActionSelectReviewerComponent + ], + declarations: [NgbTooltip], + providers: [ { provide: ActivatedRoute, useValue: route }, { provide: ClaimedTaskDataService, useValue: claimedTaskDataService }, { provide: NotificationsService, useValue: notificationService }, @@ -66,9 +64,9 @@ describe('AdvancedClaimedTaskActionSelectReviewerComponent', () => { { 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/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 d6217320ba7..e3ac6070376 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 @@ -5,22 +5,25 @@ import { } from '../abstract/advanced-claimed-task-actions-abstract.component'; import { Router, ActivatedRoute } from '@angular/router'; import { NotificationsService } from '../../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { SearchService } from '../../../../core/shared/search/search.service'; import { RequestService } from '../../../../core/data/request.service'; 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'; /** * Advanced Workflow button that redirect to the {@link AdvancedWorkflowActionSelectReviewerComponent} */ @rendersWorkflowTaskOption(ADVANCED_WORKFLOW_TASK_OPTION_SELECT_REVIEWER) @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'] + 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-loader.component.spec.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts index 95e31f55239..b5bfa7c86db 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 @@ -62,10 +62,9 @@ describe('ClaimedTaskActionsLoaderComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ClaimedTaskActionsLoaderComponent, ClaimedTaskActionsEditMetadataComponent, ClaimedTaskActionsDirective], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + imports: [TranslateModule.forRoot(), ClaimedTaskActionsLoaderComponent, ClaimedTaskActionsEditMetadataComponent, ClaimedTaskActionsDirective], + schemas: [NO_ERRORS_SCHEMA], + providers: [ { provide: ClaimedTaskDataService, useValue: {} }, { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -73,8 +72,8 @@ describe('ClaimedTaskActionsLoaderComponent', () => { { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService }, { provide: PoolTaskDataService, useValue: {} } - ] - }).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 c0dc1cad02b..0dc9a14e73b 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 @@ -20,8 +20,10 @@ import { WorkflowItem } from '../../../../core/submission/models/workflowitem.mo import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; @Component({ - selector: 'ds-claimed-task-actions-loader', - templateUrl: './claimed-task-actions-loader.component.html' + selector: 'ds-claimed-task-actions-loader', + templateUrl: './claimed-task-actions-loader.component.html', + standalone: true, + imports: [ClaimedTaskActionsDirective] }) /** * Component for loading a ClaimedTaskAction component depending on the "option" input diff --git a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions.directive.ts b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions.directive.ts index a4a55b541b4..a30a8a038c7 100644 --- a/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions.directive.ts +++ b/src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions.directive.ts @@ -1,7 +1,8 @@ import { Directive, ViewContainerRef } from '@angular/core'; @Directive({ - selector: '[dsClaimedTaskActions]', + selector: '[dsClaimedTaskActions]', + standalone: true }) /** * Directive used as a hook to know where to inject the dynamic Claimed Task Actions component 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 e6abfa76a1c..6fccb4f1725 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 @@ -61,25 +61,25 @@ const requestServce = getMockRequestService(); describe('ItemActionsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ItemActionsComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemActionsComponent, { set: { 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 4df11d65d91..e65a42f9d9d 100644 --- a/src/app/shared/mydspace-actions/item/item-actions.component.ts +++ b/src/app/shared/mydspace-actions/item/item-actions.component.ts @@ -1,6 +1,6 @@ import { Component, Injector, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { Router, RouterLink } from '@angular/router'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; import { ItemDataService } from '../../../core/data/item-data.service'; import { Item } from '../../../core/shared/item.model'; @@ -8,14 +8,17 @@ import { NotificationsService } from '../../notifications/notifications.service' import { RequestService } from '../../../core/data/request.service'; import { SearchService } from '../../../core/shared/search/search.service'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * This component represents mydspace actions related to Item object. */ @Component({ - selector: 'ds-item-actions', - styleUrls: ['./item-actions.component.scss'], - templateUrl: './item-actions.component.html', + 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 68e3a8fb58a..0c56e7f75e4 100644 --- a/src/app/shared/mydspace-actions/mydspace-actions.module.ts +++ b/src/app/shared/mydspace-actions/mydspace-actions.module.ts @@ -40,19 +40,17 @@ const DECLARATIONS = [ * This module contains Item actions used in MyDSpace */ @NgModule({ - imports: [ - CommonModule, - SharedModule, - ], - declarations: [ - ...DECLARATIONS, - ], - providers: [ - ...ENTRY_COMPONENTS, - ], - exports: [ - ...DECLARATIONS, - ], + imports: [ + CommonModule, + SharedModule, + ...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 fe9d9552876..58aa91f71b9 100644 --- a/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts +++ b/src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts @@ -73,16 +73,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, + }, }), - ], - declarations: [PoolTaskActionsComponent], - providers: [ + PoolTaskActionsComponent + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -90,9 +90,9 @@ describe('MyDSpaceReloadableActionsComponent', () => { { provide: ClaimedTaskDataService, useValue: mockClaimedTaskDataService }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PoolTaskActionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 cb0799caa6b..092281412c2 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 @@ -77,16 +77,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, + }, }), - ], - declarations: [PoolTaskActionsComponent], - providers: [ + PoolTaskActionsComponent + ], + providers: [ { provide: Injector, useValue: {} }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, @@ -94,9 +94,9 @@ describe('PoolTaskActionsComponent', () => { { provide: ClaimedTaskDataService, useValue: mockClaimedTaskDataService }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PoolTaskActionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 c8dcd87a33e..25635c7453c 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,9 @@ import { Component, Injector, Input, OnDestroy } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { Observable } from 'rxjs'; import { switchMap, take } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { RemoteData } from '../../../core/data/remote-data'; @@ -18,14 +18,18 @@ import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { MyDSpaceReloadableActionsComponent } from '../mydspace-reloadable-actions'; import { ProcessTaskResponse } from '../../../core/tasks/models/process-task-response'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * 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', + 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 9f266d054e2..9e46f4df4a5 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 @@ -66,25 +66,25 @@ 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 - } - }) - ], - declarations: [WorkflowitemActionsComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + WorkflowitemActionsComponent + ], + providers: [ { provide: Injector, useValue: {} }, { provide: Router, useValue: new RouterStub() }, { provide: WorkflowItemDataService, useValue: mockDataService }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(WorkflowitemActionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 35873566423..35d0ba94760 100644 --- a/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts @@ -1,7 +1,7 @@ import { Component, Injector, Input } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; @@ -10,14 +10,17 @@ import { NotificationsService } from '../../notifications/notifications.service' import { RequestService } from '../../../core/data/request.service'; import { SearchService } from '../../../core/shared/search/search.service'; import { getWorkflowItemViewRoute } from '../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; /** * This component represents actions related to WorkflowItem object. */ @Component({ - selector: 'ds-workflowitem-actions', - styleUrls: ['./workflowitem-actions.component.scss'], - templateUrl: './workflowitem-actions.component.html', + 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 c76cce3982b..2978df7b65b 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 @@ -161,29 +161,29 @@ describe('WorkspaceitemActionsComponent', () => { isAuthorized: observableOf(true) }); await TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [WorkspaceitemActionsComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + WorkspaceitemActionsComponent + ], + providers: [ Injector, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, { provide: Router, useValue: new RouterStub() }, { provide: WorkspaceitemDataService, useValue: mockDataService }, { provide: SearchService, useValue: searchService }, { provide: RequestService, useValue: requestServce }, - { provide: AuthService, useValue: authService }, - { provide: AuthorizationDataService, useValue: authorizationService}, + { provide: AuthService, useValue: authService }, + { provide: AuthorizationDataService, useValue: authorizationService }, NgbModal - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(WorkspaceitemActionsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 05afacf0daa..538c1b76bd2 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -3,11 +3,11 @@ import { AuthService } from '../../../core/auth/auth.service'; import { Item } from '../../../core/shared/item.model'; import { FeatureID } from '../../../core/data/feature-authorization/feature-id'; import { Component, Injector, Input, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { BehaviorSubject, Observable, switchMap } from 'rxjs'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { TranslateService } from '@ngx-translate/core'; +import { NgbModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { WorkspaceItem } from '../../../core/submission/models/workspaceitem.model'; import { MyDSpaceActionsComponent } from '../mydspace-actions'; @@ -19,14 +19,17 @@ import { getFirstCompletedRemoteData, getRemoteDataPayload } from '../../../core import { RemoteData } from '../../../core/data/remote-data'; import { NoContent } from '../../../core/shared/NoContent.model'; import { getWorkspaceItemViewRoute } from '../../../workspaceitems-edit-page/workspaceitems-edit-page-routing-paths'; +import { NgIf, AsyncPipe } from '@angular/common'; /** * This component represents actions related to WorkspaceItem object. */ @Component({ - selector: 'ds-workspaceitem-actions', - styleUrls: ['./workspaceitem-actions.component.scss'], - templateUrl: './workspaceitem-actions.component.html', + 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 00979bc2bfd..cdd62a2aca2 100644 --- a/src/app/shared/ng-for-track-by-id.directive.ts +++ b/src/app/shared/ng-for-track-by-id.directive.ts @@ -4,8 +4,9 @@ import { NgForOf } from '@angular/common'; import { DSpaceObject } from '../core/shared/dspace-object.model'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: '[ngForTrackById]', + // 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 f6de303726a..8d0d1e88ffc 100644 --- a/src/app/shared/notifications/notification/notification.component.spec.ts +++ b/src/app/shared/notifications/notification/notification.component.spec.ts @@ -33,24 +33,25 @@ describe('NotificationComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, BrowserAnimationsModule, StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - })], - declarations: [NotificationComponent], // declare the test component - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 6dbda23e611..50e535ddf5e 100644 --- a/src/app/shared/notifications/notification/notification.component.ts +++ b/src/app/shared/notifications/notification/notification.component.ts @@ -24,24 +24,27 @@ import { NotificationAnimationsStatus } from '../models/notification-animations- import { isNotEmpty } from '../../empty.util'; import { INotification } from '../models/notification.model'; import { filter, first } from 'rxjs/operators'; +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, - scaleInState, scaleEnter, scaleOutState, scaleLeave - ]) - ], - templateUrl: './notification.component.html', - styleUrls: ['./notification.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + 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] }) 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 08b9585a8c7..ac931067030 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 @@ -24,20 +24,22 @@ describe('NotificationsBoardComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, BrowserAnimationsModule, StoreModule.forRoot({ notificationsReducer }, { - runtimeChecks: { - strictStateImmutability: false, - strictActionImmutability: false - } - })], - declarations: [NotificationsBoardComponent, NotificationComponent], // declare the test component - providers: [ + runtimeChecks: { + strictStateImmutability: false, + strictActionImmutability: false + } + }), + 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 97ae09c1a67..643eeeb8622 100644 --- a/src/app/shared/notifications/notifications-board/notifications-board.component.ts +++ b/src/app/shared/notifications/notifications-board/notifications-board.component.ts @@ -18,13 +18,17 @@ import { notificationsStateSelector } from '../selectors'; import { INotification } from '../models/notification.model'; import { NotificationsState } from '../notifications.reducers'; import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces'; +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 + 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 fde92e8891b..a49a1b5c926 100644 --- a/src/app/shared/notifications/notifications.reducers.spec.ts +++ b/src/app/shared/notifications/notifications.reducers.spec.ts @@ -24,15 +24,15 @@ describe('Notifications reducer', () => { beforeEach(async () => { TestBed.configureTestingModule({ - declarations: [NotificationComponent, NotificationsBoardComponent], - providers: [ + providers: [ NotificationsService, ChangeDetectorRef, - ], - imports: [ + ], + imports: [ StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), - ] - }); + 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 92c74e00170..79e1e30ce73 100644 --- a/src/app/shared/notifications/notifications.service.spec.ts +++ b/src/app/shared/notifications/notifications.service.spec.ts @@ -21,22 +21,22 @@ describe('NotificationsService test', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ StoreModule.forRoot({ notificationsReducer }, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [NotificationComponent, NotificationsBoardComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 1619e56b0dd..86013efb8bd 100644 --- a/src/app/shared/object-collection/object-collection.component.spec.ts +++ b/src/app/shared/object-collection/object-collection.component.spec.ts @@ -21,13 +21,13 @@ describe('ObjectCollectionComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ObjectCollectionComponent], - providers: [ + imports: [ObjectCollectionComponent], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useClass: RouterStub } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); // compile template and css + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); // compile template and css })); beforeEach(() => { diff --git a/src/app/shared/object-collection/object-collection.component.ts b/src/app/shared/object-collection/object-collection.component.ts index e1f9182562a..53d95434c95 100644 --- a/src/app/shared/object-collection/object-collection.component.ts +++ b/src/app/shared/object-collection/object-collection.component.ts @@ -22,15 +22,20 @@ import { CollectionElementLinkType } from './collection-element-link.type'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { Context } from '../../core/shared/context.model'; import { setPlaceHolderAttributes } from '../utils/object-list-utils'; -import { isPlatformBrowser } from '@angular/common'; +import { isPlatformBrowser, NgIf, NgClass, AsyncPipe } from '@angular/common'; +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'; /** * 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', + 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 f661ed6e005..7b46b4f7a76 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 @@ -57,13 +57,12 @@ describe('ItemAccessStatusBadgeComponent', () => { function initTestBed() { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [AccessStatusBadgeComponent, TruncatePipe], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - {provide: AccessStatusDataService, useValue: accessStatusDataService} - ] - }).compileComponents(); + imports: [TranslateModule.forRoot(), AccessStatusBadgeComponent, TruncatePipe], + schemas: [NO_ERRORS_SCHEMA], + providers: [ + { provide: AccessStatusDataService, useValue: accessStatusDataService } + ] +}).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 2be44669b02..a30f166a433 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 @@ -8,10 +8,14 @@ import { AccessStatusDataService } from 'src/app/core/data/access-status-data.se 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'; @Component({ - selector: 'ds-access-status-badge', - templateUrl: './access-status-badge.component.html' + selector: 'ds-access-status-badge', + templateUrl: './access-status-badge.component.html', + 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 ad8dfd7cb05..26695c970e3 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 @@ -7,9 +7,10 @@ import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; * Themed wrapper for AccessStatusBadgeComponent */ @Component({ - selector: 'ds-themed-access-status-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', + 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 9e0c277a081..ced4f195e2e 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 @@ -11,10 +11,10 @@ describe('BadgesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ BadgesComponent ], - providers: [{provide: ThemeService, useValue: getMockThemeService()}], - schemas: [NO_ERRORS_SCHEMA] - }) + imports: [BadgesComponent], + providers: [{ provide: ThemeService, useValue: getMockThemeService() }], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); }); 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 c66fed35fc4..5c8c9ff51ee 100644 --- a/src/app/shared/object-collection/shared/badges/badges.component.ts +++ b/src/app/shared/object-collection/shared/badges/badges.component.ts @@ -1,6 +1,11 @@ import { Component, Input } from '@angular/core'; 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'; /** * List of MyDSpace Status Contexts @@ -19,9 +24,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'] + 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 65fe5b7ef1d..9d70e4484cb 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 @@ -26,17 +26,17 @@ mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rd describe('MyDSpaceItemStatusComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [MyDSpaceStatusBadgeComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(MyDSpaceStatusBadgeComponent, { + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + 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 744a9278126..64aa19d4e5f 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 @@ -1,13 +1,16 @@ import { Component, Input, OnInit } from '@angular/core'; import { Context } from 'src/app/core/shared/context.model'; +import { TranslateModule } from '@ngx-translate/core'; /** * 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' + 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 4c375746c81..f4c71a0f546 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 @@ -7,9 +7,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', + 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 f3115073c39..39699edc26f 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 @@ -17,10 +17,9 @@ let notPrivateItem = Object.assign(new Item(), { isDiscoverable: true }); describe('ItemStatusBadgeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 a52f3f6f322..e5cf4026a21 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,10 +1,14 @@ import { Component, Input, OnInit } from '@angular/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' + 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 f50d029fffa..214073289a7 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 @@ -7,9 +7,10 @@ import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; * Themed wrapper for StatusBadgeComponent */ @Component({ - selector: 'ds-themed-status-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', + 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 1671b0c5b05..298be78c222 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 @@ -8,9 +8,10 @@ import { Context } from 'src/app/core/shared/context.model'; * Themed wrapper for BadgesComponent */ @Component({ - selector: 'ds-themed-badges', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html', + 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 a8dd0ee04cc..1d2785960bf 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 @@ -7,9 +7,10 @@ import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; * Themed wrapper for TypeBadgeComponent */ @Component({ - selector: 'ds-themed-type-badge', - styleUrls: [], - templateUrl: '../../../../theme-support/themed.component.html', + 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 87adc3761a2..1df6f3f8385 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 @@ -39,10 +39,9 @@ const mockItemWithoutEntityType = Object.assign(new Item(), { describe('ItemTypeBadgeComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 ea912063b65..553fb2593ce 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 @@ -2,10 +2,14 @@ import { Component, Input } from '@angular/core'; import { DSpaceObject } from '../../../../../core/shared/dspace-object.model'; import { hasValue, isEmpty } from '../../../../empty.util'; import { getResourceTypeValueFor } from '../../../../../core/cache/object-cache.reducer'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-type-badge', - templateUrl: './type-badge.component.html' + 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 f381a02d86d..aca44939dc2 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 @@ -1,9 +1,12 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ListableObject } from '../listable-object.model'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-importable-list-item-control', - templateUrl: './importable-list-item-control.component.html' + 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 e893fe807b7..b49f24aeb77 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 @@ -35,14 +35,13 @@ describe('ListableObjectComponentLoaderComponent', () => { getThemeName: 'dspace', }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ListableObjectComponentLoaderComponent, ItemListElementComponent, ListableObjectDirective], - schemas: [NO_ERRORS_SCHEMA], - providers: [ + imports: [TranslateModule.forRoot(), ListableObjectComponentLoaderComponent, ItemListElementComponent, ListableObjectDirective], + schemas: [NO_ERRORS_SCHEMA], + providers: [ provideMockStore({}), { provide: ThemeService, useValue: themeService }, - ] - }).overrideComponent(ListableObjectComponentLoaderComponent, { + ] +}).overrideComponent(ListableObjectComponentLoaderComponent, { set: { changeDetection: ChangeDetectionStrategy.Default, entryComponents: [ItemListElementComponent] 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 7a3cc42bf5a..0154949c69a 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 @@ -27,9 +27,11 @@ import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { ThemeService } from '../../../theme-support/theme.service'; @Component({ - selector: 'ds-listable-object-component-loader', - styleUrls: ['./listable-object-component-loader.component.scss'], - templateUrl: './listable-object-component-loader.component.html' + selector: 'ds-listable-object-component-loader', + styleUrls: ['./listable-object-component-loader.component.scss'], + templateUrl: './listable-object-component-loader.component.html', + standalone: true, + imports: [ListableObjectDirective] }) /** * 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/listable-object/listable-object.directive.ts b/src/app/shared/object-collection/shared/listable-object/listable-object.directive.ts index 93c06961f4c..d61eb014e2f 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object.directive.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object.directive.ts @@ -1,7 +1,8 @@ import { Directive, ViewContainerRef } from '@angular/core'; @Directive({ - selector: '[dsListableObject]', + selector: '[dsListableObject]', + standalone: true }) /** * Directive used as a hook to know where to inject the dynamic listable object component 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 87f79d35701..e477085d426 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 @@ -11,14 +11,19 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { NgIf, AsyncPipe } 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' + 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 abaf029155a..de902bd4f28 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 @@ -26,20 +26,20 @@ mockResultObject = Object.assign(new PoolTask(), { workflowitem: observableOf(rd describe('ItemSubmitterComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ItemSubmitterComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ItemSubmitterComponent + ], + providers: [ { provide: LinkService, useValue: getMockLinkService() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemSubmitterComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 990aa9906b8..837aeb22d5e 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 @@ -11,14 +11,18 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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' + 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 4614adcf434..a7238fff6a3 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 @@ -7,8 +7,9 @@ import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; @Component({ - selector: 'ds-abstract-object-element', - template: ``, + 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 c8756567b86..661cf3a8439 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 @@ -44,16 +44,15 @@ describe('SelectableListItemControlComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [SelectableListItemControlComponent, VarDirective], - imports: [FormsModule], - providers: [ + imports: [FormsModule, SelectableListItemControlComponent, VarDirective], + providers: [ { - provide: SelectableListService, - useValue: selectionService + provide: SelectableListService, + useValue: selectionService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 ebe49331d5c..e32ea9ed721 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 @@ -3,11 +3,16 @@ import { ListableObject } from '../listable-object.model'; import { SelectableListService } from '../../../object-list/selectable-list/selectable-list.service'; import { map, skip, take } from 'rxjs/operators'; import { Observable } from 'rxjs'; +import { FormsModule } from '@angular/forms'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../../../utils/var.directive'; @Component({ - selector: 'ds-selectable-list-item-control', - // styleUrls: ['./selectable-list-item-control.component.scss'], - templateUrl: './selectable-list-item-control.component.html' + 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] }) /** * 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 5d39dd909ae..862f5fd2b29 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 @@ -75,15 +75,14 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('ClaimedTaskSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ClaimedTaskSearchResultDetailElementComponent, VarDirective], - providers: [ + imports: [NoopAnimationsModule, ClaimedTaskSearchResultDetailElementComponent, VarDirective], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: LinkService, useValue: linkService }, { provide: ObjectCacheService, useValue: objectCacheServiceMock } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedTaskSearchResultDetailElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ClaimedTaskSearchResultDetailElementComponent, { set: { 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 7e463d3b3b5..e3ce0d55dbb 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 @@ -18,14 +18,19 @@ import { isNotEmpty, hasValue } 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'; /** * 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' + 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 56a0df1faa0..be1951cb735 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 @@ -47,23 +47,21 @@ const mockItemWithAuthorAndDate: Item = Object.assign(new Item(), { describe('ItemDetailPreviewFieldComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [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 5faf02eac05..5880b89cb27 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 @@ -3,13 +3,18 @@ import { Component, Input } from '@angular/core'; import { Metadata } from '../../../../../core/shared/metadata.utils'; import { Item } from '../../../../../core/shared/item.model'; 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'; /** * This component show values for the given item metadata */ @Component({ - selector: 'ds-item-detail-preview-field', - templateUrl: './item-detail-preview-field.component.html' + 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 0b5acd343bd..ff3a1fe91f6 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 @@ -84,17 +84,17 @@ describe('ItemDetailPreviewComponent', () => { }; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [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: {} }, @@ -108,9 +108,9 @@ describe('ItemDetailPreviewComponent', () => { { provide: DSOChangeAnalyzer, useValue: {} }, { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamDataService, useValue: mockBitstreamDataService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemDetailPreviewComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 2e290bfffa5..d2920fca2ea 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 @@ -13,15 +13,27 @@ import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service import { SearchResult } from '../../../search/models/search-result.model'; import { Context } from '../../../../core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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 { ThemedThumbnailComponent } from '../../../../thumbnail/themed-thumbnail.component'; +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 { NgIf, NgFor, AsyncPipe } from '@angular/common'; /** * 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] + 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 2c8039c9239..c0318c2ee99 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 @@ -52,13 +52,12 @@ mockResultObject.indexableObject = Object.assign(new Item(), { describe('ItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ItemSearchResultDetailElementComponent], - providers: [ + imports: [NoopAnimationsModule, ItemSearchResultDetailElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemSearchResultDetailElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemSearchResultDetailElementComponent, { set: { 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 40ed72dcf1c..e2a780721c8 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 @@ -6,14 +6,18 @@ import { SearchResultDetailElementComponent } from '../search-result-detail-elem import { listableObjectComponent } from '../../../object-collection/shared/listable-object/listable-object.decorator'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; import { Context } from '../../../../core/shared/context.model'; +import { ItemActionsComponent } from '../../../mydspace-actions/item/item-actions.component'; +import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.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' + 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 a10e13f63ea..ddc1c4b91e6 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 @@ -68,17 +68,16 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('PoolSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [PoolSearchResultDetailElementComponent, VarDirective], - providers: [ + imports: [NoopAnimationsModule, PoolSearchResultDetailElementComponent, VarDirective], + 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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PoolSearchResultDetailElementComponent, { set: { 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 80a81efa817..e799e3156b8 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 @@ -18,14 +18,19 @@ import { isNotEmpty, hasValue } 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 { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; +import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.component'; +import { NgIf, AsyncPipe } from '@angular/common'; /** * 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', + 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 5b0bd2c39b9..6a898a2ea76 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 @@ -10,8 +10,9 @@ import { SearchResult } from '../../search/models/search-result.model'; * Component representing Search Results with ViewMode.DetailedElement */ @Component({ - selector: 'ds-search-result-detail-element', - template: `` + 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 f4bc6b88faf..69a022cdfa3 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 @@ -59,16 +59,15 @@ mockResultObject.indexableObject = Object.assign(new WorkflowItem(), { item: obs describe('WorkflowItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(WorkflowItemSearchResultDetailElementComponent, { set: { 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 bad0fcee87c..19af7db70e1 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 @@ -14,14 +14,18 @@ import { LinkService } from '../../../../core/cache/builders/link.service'; import { followLink } from '../../../utils/follow-link-config.model'; import { Context } from 'src/app/core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { WorkflowitemActionsComponent } from '../../../mydspace-actions/workflowitem/workflowitem-actions.component'; +import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.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', + 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 e86bfdb5e60..30672e5b97e 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 @@ -59,16 +59,15 @@ mockResultObject.indexableObject = Object.assign(new WorkspaceItem(), { item: ob describe('WorkspaceItemSearchResultDetailElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [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, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(WorkspaceItemSearchResultDetailElementComponent, { set: { 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 03b41e795c8..cec2f252e50 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 @@ -15,14 +15,18 @@ import { followLink } from '../../../utils/follow-link-config.model'; import { LinkService } from '../../../../core/cache/builders/link.service'; import { Context } from '../../../../core/shared/context.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +import { WorkspaceitemActionsComponent } from '../../../mydspace-actions/workspaceitem/workspaceitem-actions.component'; +import { ItemDetailPreviewComponent } from '../item-detail-preview/item-detail-preview.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', + 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 d0fcbed4eba..30103a8d526 100644 --- a/src/app/shared/object-detail/object-detail.component.spec.ts +++ b/src/app/shared/object-detail/object-detail.component.spec.ts @@ -37,18 +37,18 @@ describe('ObjectDetailComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [ObjectDetailComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ObjectDetailComponent, { + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + ObjectDetailComponent + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ObjectDetailComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); diff --git a/src/app/shared/object-detail/object-detail.component.ts b/src/app/shared/object-detail/object-detail.component.ts index 1a32be74b84..b5335fdcf4c 100644 --- a/src/app/shared/object-detail/object-detail.component.ts +++ b/src/app/shared/object-detail/object-detail.component.ts @@ -11,17 +11,25 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o import { ViewMode } from '../../core/shared/view-mode.model'; import { Context } from '../../core/shared/context.model'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +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 { NgIf, NgFor } from '@angular/common'; +import { PaginationComponent } from '../pagination/pagination.component'; /** * 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] + 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 e5420f7d4fd..0a3823253a3 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 @@ -38,17 +38,16 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CollectionGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [CollectionGridElementComponent], - providers: [ + imports: [ + TranslateModule.forRoot(), + CollectionGridElementComponent + ], + providers: [ { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }, { provide: LinkService, useValue: linkService } - ], - - 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 e2ecf7b1aee..99997be9702 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 @@ -7,14 +7,20 @@ import { hasNoValue, hasValue } from '../../empty.util'; 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', + 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 2bf682350e9..7d3b7fabd79 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 @@ -38,17 +38,16 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CommunityGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [CommunityGridElementComponent], - providers: [ + imports: [ + TranslateModule.forRoot(), + CommunityGridElementComponent + ], + providers: [ { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }, { provide: LinkService, useValue: linkService } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(CommunityGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(CommunityGridElementComponent, { set: { 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 59ac0693eb7..101c544b50b 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 @@ -7,14 +7,20 @@ 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' + 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 b137c2e7083..70127c333cd 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 @@ -53,14 +53,13 @@ describe('ItemGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ItemGridElementComponent, TruncatePipe], - providers: [ + imports: [NoopAnimationsModule, ItemGridElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemGridElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemGridElementComponent, { set: { 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 c8a58c5a898..71b4f2ab323 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 @@ -4,14 +4,17 @@ 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 { Item } from '../../../../../core/shared/item.model'; +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] + 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 91630ca0074..d696c853ae9 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -24,14 +24,23 @@ import { PaginationComponentOptions } from '../pagination/pagination-component-o import { ViewMode } from '../../core/shared/view-mode.model'; import { Context } from '../../core/shared/context.model'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; +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 { NgIf, NgFor, AsyncPipe } from '@angular/common'; +import { PaginationComponent } from '../pagination/pagination.component'; @Component({ - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - selector: 'ds-object-grid', - styleUrls: ['./object-grid.component.scss'], - templateUrl: './object-grid.component.html', - animations: [fadeIn] + 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 15548d66082..280998d7ca8 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 @@ -61,11 +61,11 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CollectionSearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [CollectionSearchResultGridElementComponent, TruncatePipe], - providers: [ + imports: [ + TranslateModule.forRoot(), + CollectionSearchResultGridElementComponent, TruncatePipe + ], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) }, { provide: ObjectCacheService, useValue: {} }, @@ -81,10 +81,9 @@ describe('CollectionSearchResultGridElementComponent', () => { { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamFormatDataService, useValue: {} }, { provide: LinkService, useValue: linkService } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(CollectionSearchResultGridElementComponent, { + ], + 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 e4ea2e48f54..ce5be1978b2 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 @@ -10,11 +10,18 @@ import { LinkService } from '../../../../core/cache/builders/link.service'; import { TruncatableService } from '../../../truncatable/truncatable.service'; import { BitstreamDataService } from '../../../../core/data/bitstream-data.service'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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' + 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 710fbf3f672..9029b2e6184 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 @@ -61,11 +61,11 @@ const linkService = jasmine.createSpyObj('linkService', { describe('CommunitySearchResultGridElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [CommunitySearchResultGridElementComponent, TruncatePipe], - providers: [ + imports: [ + TranslateModule.forRoot(), + CommunitySearchResultGridElementComponent, TruncatePipe + ], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) }, { provide: ObjectCacheService, useValue: {} }, @@ -81,10 +81,9 @@ describe('CommunitySearchResultGridElementComponent', () => { { provide: DefaultChangeAnalyzer, useValue: {} }, { provide: BitstreamFormatDataService, useValue: {} }, { provide: LinkService, useValue: linkService } - ], - - 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 039b01c5676..c2d546a803c 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 @@ -10,14 +10,21 @@ import { BitstreamDataService } from '../../../../core/data/bitstream-data.servi import { hasNoValue, hasValue } from '../../../empty.util'; import { followLink } from '../../../utils/follow-link-config.model'; import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; +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', + 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 dc42b033d84..f22d604d152 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 @@ -214,27 +214,27 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - NoopAnimationsModule, - TranslateModule.forRoot() - ], - declarations: [component, TruncatePipe], - 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 }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(component, { + imports: [ + NoopAnimationsModule, + TranslateModule.forRoot(), + component, TruncatePipe + ], + 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 }, + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(component, { set: { 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 7d237e3f792..52ba5a00ffd 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 @@ -11,14 +11,23 @@ import { getItemPageRoute } from '../../../../../item-page/item-page-routing-pat import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service'; import { TruncatableService } from '../../../../truncatable/truncatable.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; +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'; @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] + 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 4c3431bb55d..a5092c42f48 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 @@ -11,8 +11,9 @@ import { TruncatableService } from '../../truncatable/truncatable.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @Component({ - selector: 'ds-search-result-grid-element', - template: `` + 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 906add6578d..f6f81c9d531 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 @@ -14,10 +14,9 @@ describe('BitstreamListItemComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ BitstreamListItemComponent ], - imports: [ CommonModule, SharedModule, TranslateModule, RouterTestingModule ], - providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }] - }) + imports: [CommonModule, SharedModule, TranslateModule, RouterTestingModule, BitstreamListItemComponent], + providers: [{ provide: DSONameService, useValue: new DSONameServiceMock() }] +}) .compileComponents(); }); 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 f281c0bd77f..bd1625c0c75 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 @@ -10,8 +10,9 @@ import { Context } from '../../../core/shared/context.model'; @listableObjectComponent(Bitstream, ViewMode.ListElement, Context.Bitstream) @Component({ - selector: 'ds-bitstream-list-item', - template: ` {{object.name}} `, - styleUrls: ['./bitstream-list-item.component.scss'] + 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 15d1d9df392..481dda00aa9 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 @@ -34,16 +34,15 @@ describe('BrowseEntryListElementComponent', () => { beforeEach(waitForAsync(() => { init(); TestBed.configureTestingModule({ - declarations: [BrowseEntryListElementComponent, TruncatePipe], - providers: [ + imports: [BrowseEntryListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: { mockValue } }, - {provide: PaginationService, useValue: paginationService}, - {provide: RouteService, useValue: routeService}, - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(BrowseEntryListElementComponent, { + { provide: PaginationService, useValue: paginationService }, + { provide: RouteService, useValue: routeService }, + ], + 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 e67dd4489e7..5a8b921e56e 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 @@ -5,17 +5,20 @@ import { BrowseEntry } from '../../../core/shared/browse-entry.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; import { PaginationService } from '../../../core/pagination/pagination.service'; -import { Params } from '@angular/router'; +import { Params, RouterLink } from '@angular/router'; import { BBM_PAGINATION_ID } from '../../../browse-by/browse-by-metadata-page/browse-by-metadata-page.component'; import { RouteService } from 'src/app/core/services/route.service'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-browse-entry-list-element', - styleUrls: ['./browse-entry-list-element.component.scss'], - templateUrl: './browse-entry-list-element.component.html' + 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 55eb5b116eb..4c89584d50f 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 @@ -5,8 +5,9 @@ import { listableObjectComponent } from '../../object-collection/shared/listable import { ViewMode } from '../../../core/shared/view-mode.model'; @Component({ - selector: 'ds-bundle-list-element', - templateUrl: './bundle-list-element.component.html' + 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 97f9eb88c2c..f4b8faae8cd 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 @@ -57,14 +57,13 @@ const mockCollectionWithoutAbstract: Collection = Object.assign(new Collection() describe('CollectionListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [CollectionListElementComponent], - providers: [ + imports: [CollectionListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(CollectionListElementComponent, { + ], + 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 c36034ba34f..9e988d11098 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 @@ -4,11 +4,15 @@ 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'; @Component({ - selector: 'ds-collection-list-element', - styleUrls: ['./collection-list-element.component.scss'], - templateUrl: './collection-list-element.component.html' + 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 8f7350d860a..d3411bb0b47 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 @@ -34,14 +34,13 @@ const mockCommunityWithoutAbstract: Community = Object.assign(new Community(), { describe('CommunityListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [CommunityListElementComponent], - providers: [ + imports: [CommunityListElementComponent], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(CommunityListElementComponent, { + ], + 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 4a83fd28345..e92e2373141 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 @@ -5,11 +5,15 @@ import { AbstractListableElementComponent } from '../../object-collection/shared import { ViewMode } from '../../../core/shared/view-mode.model'; import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { RouterLink } from '@angular/router'; +import { NgIf } from '@angular/common'; @Component({ - selector: 'ds-community-list-element', - styleUrls: ['./community-list-element.component.scss'], - templateUrl: './community-list-element.component.html' + 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.html b/src/app/shared/object-list/identifier-data/identifier-data.component.html index 91470628c4b..ec1ac6d6446 100644 --- a/src/app/shared/object-list/identifier-data/identifier-data.component.html +++ b/src/app/shared/object-list/identifier-data/identifier-data.component.html @@ -1,5 +1,3 @@ - -
- {{ identifiers[0].value | translate }} -
-
+
+ {{ identifiers[0].value | translate }} +
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 cb6d1d97e5a..908ac0bc662 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 @@ -5,10 +5,18 @@ import { hasValue } from '../../empty.util'; import { Item } from 'src/app/core/shared/item.model'; import { IdentifierData } from './identifier-data.model'; import { IdentifierDataService } from '../../../core/data/identifier-data.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { AsyncPipe, NgIf } from '@angular/common'; @Component({ selector: 'ds-identifier-data', - templateUrl: './identifier-data.component.html' + templateUrl: './identifier-data.component.html', + imports: [ + TranslateModule, + AsyncPipe, + NgIf + ], + 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 d75576e8ebc..e545d8192e1 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 @@ -55,13 +55,13 @@ describe('ItemListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemListElementComponent, TruncatePipe], - providers: [ + imports: [ItemListElementComponent, TruncatePipe], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 a3bd2a1ce00..76e715665c8 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 @@ -3,13 +3,16 @@ 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 { Item } from '../../../../../core/shared/item.model'; +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' + 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 3cf05f7fec6..6a305523859 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 @@ -11,13 +11,11 @@ describe('ListableNotificationObjectComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ], - declarations: [ - 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 ca23ee76a2a..1c5b160590f 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 @@ -6,6 +6,7 @@ import { ListableNotificationObject } from './listable-notification-object.model import { listableObjectComponent } from '../../object-collection/shared/listable-object/listable-object.decorator'; import { ViewMode } from '../../../core/shared/view-mode.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,9 +14,11 @@ import { LISTABLE_NOTIFICATION_OBJECT } from './listable-notification-object.res @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'], + 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 3527b9fddd5..d6733c0afaf 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 @@ -19,10 +19,9 @@ describe('BrowseLinkMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [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 80155837673..582a17523e8 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 @@ -3,13 +3,17 @@ import { Component } from '@angular/core'; import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator'; import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; +import { RouterLink } from '@angular/router'; +import { NgIf } from '@angular/common'; //@metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText) // For now, authority controlled fields are rendered the same way as plain text fields //@metadataRepresentationComponent('Publication', MetadataRepresentationType.AuthorityControlled) @metadataRepresentationComponent('Publication', MetadataRepresentationType.BrowseLink) @Component({ - selector: 'ds-browse-link-metadata-list-element', - templateUrl: './browse-link-metadata-list-element.component.html' + 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 99052b6b143..84635525175 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 @@ -12,10 +12,9 @@ describe('ItemMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [ItemMetadataListElementComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemMetadataListElementComponent, { + imports: [ItemMetadataListElementComponent], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemMetadataListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); 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 d0bbdf1ded5..d8e54c6b291 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 @@ -3,11 +3,14 @@ import { Component } from '@angular/core'; import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; import { ViewMode } from '../../../../core/shared/view-mode.model'; import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; @metadataRepresentationComponent('Publication', MetadataRepresentationType.Item) @Component({ - selector: 'ds-item-metadata-list-element', - templateUrl: './item-metadata-list-element.component.html' + 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 c4a6903129a..2d30fc7d6da 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 @@ -4,8 +4,9 @@ import { ItemMetadataRepresentation } from '../../../../core/shared/metadata-rep import { getItemPageRoute } from '../../../../item-page/item-page-routing-paths'; @Component({ - selector: 'ds-item-metadata-representation-list-element', - template: '' + 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 dc8febe84ac..540dba33e54 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 @@ -20,10 +20,9 @@ describe('MetadataRepresentationListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [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 d8f8621ca61..5a0c0058a05 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 @@ -3,8 +3,9 @@ import { MetadataRepresentation } from '../../../core/shared/metadata-representa import { Context } from '../../../core/shared/context.model'; @Component({ - selector: 'ds-metadata-representation-list-element', - template: '' + 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 91d7db35620..dc1d7cfb4b5 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 @@ -18,10 +18,9 @@ describe('PlainTextMetadataListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [PlainTextMetadataListElementComponent], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PlainTextMetadataListElementComponent, { + imports: [PlainTextMetadataListElementComponent], + 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 8a3e1d51a6f..f3240dfe5f8 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 @@ -3,13 +3,17 @@ import { Component } from '@angular/core'; import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; import { metadataRepresentationComponent } from '../../../metadata-representation/metadata-representation.decorator'; import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; +import { RouterLink } from '@angular/router'; +import { NgIf } from '@angular/common'; @metadataRepresentationComponent('Publication', MetadataRepresentationType.PlainText) // For now, authority controlled fields are rendered the same way as plain text fields @metadataRepresentationComponent('Publication', MetadataRepresentationType.AuthorityControlled) @Component({ - selector: 'ds-plain-text-metadata-list-element', - templateUrl: './plain-text-metadata-list-element.component.html' + 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 777a0258b04..b9b39c1315b 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 @@ -65,19 +65,19 @@ const linkService = getMockLinkService(); describe('ClaimedApprovedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, - ], - declarations: [ClaimedApprovedSearchResultListElementComponent, VarDirective], - providers: [ + ClaimedApprovedSearchResultListElementComponent, VarDirective + ], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedApprovedSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 10e29bbab9b..d974a852ec8 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 @@ -14,14 +14,20 @@ import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-objec 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 { VarDirective } from '../../../../utils/var.directive'; /** * 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' + 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: [VarDirective, 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 ccd742f8546..1143403eb41 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 @@ -65,19 +65,19 @@ const linkService = getMockLinkService(); describe('ClaimedDeclinedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), NoopAnimationsModule, - ], - declarations: [ClaimedDeclinedSearchResultListElementComponent, VarDirective], - providers: [ + ClaimedDeclinedSearchResultListElementComponent, VarDirective + ], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedDeclinedSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0d24ac99680..4b2cf3a8269 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 @@ -15,14 +15,20 @@ import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-objec 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 { VarDirective } from '../../../../utils/var.directive'; /** * 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' + 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: [VarDirective, 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 5e082ef4cfe..e1264f7c584 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 @@ -62,19 +62,19 @@ const linkService = getMockLinkService(); describe('ClaimedDeclinedTaskSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot(), - ], - declarations: [ClaimedDeclinedTaskSearchResultListElementComponent, VarDirective], - providers: [ + ClaimedDeclinedTaskSearchResultListElementComponent, VarDirective + ], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedDeclinedTaskSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 fb374ff52de..51cc24e01f2 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 @@ -14,14 +14,20 @@ import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-objec 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 { VarDirective } from '../../../../utils/var.directive'; /** * 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' + 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: [VarDirective, 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 c1778c1792b..b224537920b 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 @@ -76,17 +76,16 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('ClaimedSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ClaimedSearchResultListElementComponent, VarDirective], - providers: [ + imports: [NoopAnimationsModule, ClaimedSearchResultListElementComponent, VarDirective], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment }, { provide: ObjectCacheService, useValue: objectCacheServiceMock } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ClaimedSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ClaimedSearchResultListElementComponent, { set: { 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 18148b6a8c4..d458eb0849a 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 @@ -21,11 +21,16 @@ import { Item } from '../../../../core/shared/item.model'; import { mergeMap, tap } from 'rxjs/operators'; import { isNotEmpty, hasValue } from '../../../empty.util'; 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'; @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' + 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 aa618add35a..bc26dc79d84 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 @@ -82,23 +82,22 @@ const enviromentNoThumbs = { describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - NoopAnimationsModule - ], - declarations: [ItemListPreviewComponent, TruncatePipe], - providers: [ - { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate }}, + NoopAnimationsModule, + ItemListPreviewComponent, TruncatePipe + ], + providers: [ + { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemListPreviewComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemListPreviewComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -188,23 +187,22 @@ describe('ItemListPreviewComponent', () => { describe('ItemListPreviewComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - NoopAnimationsModule - ], - declarations: [ItemListPreviewComponent, TruncatePipe], - providers: [ - {provide: 'objectElementProvider', useValue: {mockItemWithAuthorAndDate}}, - {provide: APP_CONFIG, useValue: enviromentNoThumbs} - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemListPreviewComponent, { + NoopAnimationsModule, + ItemListPreviewComponent, TruncatePipe + ], + providers: [ + { provide: 'objectElementProvider', useValue: { mockItemWithAuthorAndDate } }, + { provide: APP_CONFIG, useValue: enviromentNoThumbs } + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemListPreviewComponent, { set: {changeDetection: ChangeDetectionStrategy.Default} }).compileComponents(); })); 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 be94eb85aad..533841f9afc 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 @@ -7,15 +7,25 @@ import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interfac import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service'; import { Context } from 'src/app/core/shared/context.model'; import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.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 { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; /** * 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] + 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 fc50b49d511..4d22bfe28c9 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 @@ -10,9 +10,10 @@ import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model' * Themed wrapper for ItemListPreviewComponent */ @Component({ - selector: 'ds-themed-item-list-preview', - styleUrls: [], - templateUrl: '../../../theme-support/themed.component.html' + 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 a26fbaaf57c..3dac33cc89c 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 @@ -54,15 +54,14 @@ mockResultObject.indexableObject = Object.assign(new Item(), { describe('ItemMyDSpaceResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [ItemSearchResultListElementSubmissionComponent], - providers: [ + imports: [NoopAnimationsModule, ItemSearchResultListElementSubmissionComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environment } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemSearchResultListElementSubmissionComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemSearchResultListElementSubmissionComponent, { set: { 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 91c2576deee..69b476e15f1 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 @@ -6,14 +6,19 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista import { Context } from '../../../../core/shared/context.model'; import { ItemSearchResult } from '../../../object-collection/shared/item-search-result.model'; 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 { 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' + 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 d63ee4ba139..d290de3f7c4 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 @@ -82,17 +82,16 @@ const objectCacheServiceMock = jasmine.createSpyObj('ObjectCacheService', { describe('PoolSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [PoolSearchResultListElementComponent, VarDirective], - providers: [ + imports: [NoopAnimationsModule, PoolSearchResultListElementComponent, VarDirective], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs }, { provide: ObjectCacheService, useValue: objectCacheServiceMock } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(PoolSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(PoolSearchResultListElementComponent, { set: { 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 19723a7e494..cfecd523a48 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 @@ -22,14 +22,19 @@ import { getFirstCompletedRemoteData } from '../../../../core/shared/operators'; import { Item } from '../../../../core/shared/item.model'; import { isNotEmpty, hasValue } from '../../../empty.util'; import { Context } from '../../../../core/shared/context.model'; +import { PoolTaskActionsComponent } from '../../../mydspace-actions/pool-task/pool-task-actions.component'; +import { ThemedItemListPreviewComponent } from '../item-list-preview/themed-item-list-preview.component'; +import { NgIf, NgClass, AsyncPipe } 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', + 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 52a13a69e1a..5ab1a38e961 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 @@ -71,17 +71,16 @@ describe('WorkflowItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { linkService = getMockLinkService(); TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [WorkflowItemSearchResultListElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkflowItemSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(WorkflowItemSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(WorkflowItemSearchResultListElementComponent, { set: { 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 6218f694905..e4960d2d108 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 @@ -18,14 +18,20 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/oper 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'; /** * 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', + 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 54344bb8795..1f77ea863ce 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 @@ -70,17 +70,16 @@ describe('WorkspaceItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { linkService = getMockLinkService(); TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [WorkspaceItemSearchResultListElementComponent], - providers: [ + imports: [NoopAnimationsModule, WorkspaceItemSearchResultListElementComponent], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: ItemDataService, useValue: {} }, { provide: LinkService, useValue: linkService }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(WorkspaceItemSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(WorkspaceItemSearchResultListElementComponent, { set: { 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 7ff9a2ef3df..46a2847acc0 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 @@ -18,14 +18,20 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../core/shared/oper import { CollectionElementLinkType } from '../../../object-collection/collection-element-link.type'; import { followLink } from '../../../utils/follow-link-config.model'; import { Context } from '../../../../core/shared/context.model'; +import { ThemedLoadingComponent } from '../../../loading/themed-loading.component'; +import { WorkspaceitemActionsComponent } from '../../../mydspace-actions/workspaceitem/workspaceitem-actions.component'; +import { ListableObjectComponentLoaderComponent } from '../../../object-collection/shared/listable-object/listable-object-component-loader.component'; +import { NgIf, NgClass, AsyncPipe } from '@angular/common'; /** * 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', + 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.html b/src/app/shared/object-list/object-list.component.html index b8712b85c57..5ee41a16409 100644 --- a/src/app/shared/object-list/object-list.component.html +++ b/src/app/shared/object-list/object-list.component.html @@ -1,6 +1,6 @@ { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [], - declarations: [ObjectListComponent], - providers: [{ provide: SelectableListService, useValue: {} }], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ObjectListComponent, { + imports: [ObjectListComponent], + providers: [{ provide: SelectableListService, useValue: {} }], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ObjectListComponent, { set: { 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 5161b754598..1e847d621aa 100644 --- a/src/app/shared/object-list/object-list.component.ts +++ b/src/app/shared/object-list/object-list.component.ts @@ -9,14 +9,22 @@ import { SelectableListService } from './selectable-list/selectable-list.service import { ViewMode } from '../../core/shared/view-mode.model'; import { Context } from '../../core/shared/context.model'; import { CollectionElementLinkType } from '../object-collection/collection-element-link.type'; +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 { NgIf, NgClass, NgFor } from '@angular/common'; +import { PaginationComponent } from '../pagination/pagination.component'; @Component({ - changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated, - selector: 'ds-object-list', - styleUrls: ['./object-list.component.scss'], - templateUrl: './object-list.component.html', - animations: [fadeIn] + 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 e5ea60b35d1..f2349497292 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 @@ -53,14 +53,14 @@ const environmentUseThumbs = { describe('CollectionSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [CollectionSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [CollectionSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(CollectionSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 23e9e5ee572..db70b3d3ddf 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 @@ -4,11 +4,16 @@ import { Collection } from '../../../../core/shared/collection.model'; import { CollectionSearchResult } from '../../../object-collection/shared/collection-search-result.model'; 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 { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; +import { NgIf, NgClass } from '@angular/common'; @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' + 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 ce12f5f7da3..0c50c67ab1e 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 @@ -53,15 +53,14 @@ const environmentUseThumbs = { describe('CommunitySearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [CommunitySearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [CommunitySearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: truncatableServiceStub }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - 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 f31e36ce826..ede49aea6f2 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 @@ -4,11 +4,16 @@ import { Community } from '../../../../core/shared/community.model'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; 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 { ThemedBadgesComponent } from '../../../object-collection/shared/badges/themed-badges.component'; +import { NgIf, NgClass } from '@angular/common'; @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' + 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 7665b7d64e3..6e7f2f57f84 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 @@ -187,15 +187,14 @@ const enviromentNoThumbs = { describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemSearchResultListElementComponent, TruncatePipe], - providers: [ + imports: [ItemSearchResultListElementComponent, TruncatePipe], + providers: [ { provide: TruncatableService, useValue: {} }, { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: environmentUseThumbs } - ], - - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(ItemSearchResultListElementComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(ItemSearchResultListElementComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -370,15 +369,14 @@ describe('ItemSearchResultListElementComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ItemSearchResultListElementComponent, TruncatePipe], - providers: [ - {provide: TruncatableService, useValue: {}}, - {provide: DSONameService, useClass: DSONameServiceMock}, + imports: [ItemSearchResultListElementComponent, TruncatePipe], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: DSONameService, useClass: DSONameServiceMock }, { provide: APP_CONFIG, useValue: enviromentNoThumbs } - ], - - 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 99251d3c243..6cafe8d26ce 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 @@ -5,13 +5,21 @@ import { ItemSearchResult } from '../../../../../object-collection/shared/item-s import { SearchResultListElementComponent } from '../../../search-result-list-element.component'; import { Item } from '../../../../../../core/shared/item.model'; import { getItemPageRoute } from '../../../../../../item-page/item-page-routing-paths'; +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 { NgIf, NgClass, NgFor, AsyncPipe } from '@angular/common'; @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' + 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 e13be91e633..98acea69049 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 @@ -11,8 +11,9 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; @Component({ - selector: 'ds-search-result-list-element', - template: `` + 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 13703240f43..c3e7cb478ef 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 @@ -5,12 +5,17 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista import { Context } from '../../../../core/shared/context.model'; import { ViewMode } from '../../../../core/shared/view-mode.model'; 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'; @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' + 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 14c8ec09cd7..ffe7a1e89e6 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 @@ -5,12 +5,17 @@ import { ViewMode } from '../../../../core/shared/view-mode.model'; import { SidebarSearchListElementComponent } from '../sidebar-search-list-element.component'; import { CommunitySearchResult } from '../../../object-collection/shared/community-search-result.model'; import { Community } from '../../../../core/shared/community.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgClass, NgIf, AsyncPipe } from '@angular/common'; +import { TruncatablePartComponent } from '../../../truncatable/truncatable-part/truncatable-part.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' + 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 0822accc501..a473331a51a 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 @@ -5,14 +5,19 @@ import { Context } from '../../../../../core/shared/context.model'; import { ItemSearchResult } from '../../../../object-collection/shared/item-search-result.model'; import { Item } from '../../../../../core/shared/item.model'; 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'; @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' + 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 226c1be33ef..ac365bdb8b1 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 @@ -34,16 +34,15 @@ export function createSidebarSearchListElementTests( }) }); TestBed.configureTestingModule({ - declarations: [componentClass, VarDirective], - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - providers: [ - { provide: TruncatableService, useValue: {} }, - { provide: LinkService, useValue: linkService }, - DSONameService, - ...extraProviders - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), componentClass, VarDirective], + providers: [ + { provide: TruncatableService, useValue: {} }, + { provide: LinkService, useValue: linkService }, + DSONameService, + ...extraProviders + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 0ffe2d58b44..b4106db080d 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 @@ -12,10 +12,15 @@ import { followLink } from '../../utils/follow-link-config.model'; import { RemoteData } from '../../../core/data/remote-data'; 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'; @Component({ - selector: 'ds-sidebar-search-list-element', - templateUrl: './sidebar-search-list-element.component.html' + 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 14ddf474ad9..1eab8dad08e 100644 --- a/src/app/shared/object-list/themed-object-list.component.ts +++ b/src/app/shared/object-list/themed-object-list.component.ts @@ -13,9 +13,10 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode * Themed wrapper for ObjectListComponent */ @Component({ - selector: 'ds-themed-object-list', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', + 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 0b1ae83ca7b..c2ac0a12faa 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 @@ -72,9 +72,8 @@ describe('CollectionSelectComponent', () => { const paginationService = new PaginationServiceStub(); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([])], - declarations: [], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([])], + providers: [ { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockCollectionList[1].id]) }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -83,9 +82,9 @@ describe('CollectionSelectComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 2d36f80274a..39823e0c146 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 @@ -5,11 +5,21 @@ import { isNotEmpty } from '../../empty.util'; import { ObjectSelectService } from '../object-select.service'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; 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 { 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'], + 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 5131060cb29..05c703c61a4 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 @@ -97,9 +97,8 @@ describe('ItemSelectComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([])], - declarations: [], - providers: [ + imports: [TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([])], + providers: [ { provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockItemList[1].id]) }, { provide: HostWindowService, useValue: new HostWindowServiceStub(0) }, { provide: PaginationService, useValue: paginationService }, @@ -108,9 +107,9 @@ describe('ItemSelectComponent', () => { { provide: LinkHeadService, useValue: linkHeadService }, { provide: ConfigurationDataService, useValue: configurationDataService }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 dd0266ff834..32294dacdc6 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 @@ -9,10 +9,20 @@ import { map } from 'rxjs/operators'; import { getItemPageRoute } from '../../../item-page/item-page-routing-paths'; import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service'; 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 { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common'; +import { VarDirective } from '../../utils/var.directive'; @Component({ - selector: 'ds-item-select', - templateUrl: './item-select.component.html' + 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 6b0e9d265ba..0ef8b0e088f 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 @@ -46,20 +46,19 @@ describe('PageSizeSelectorComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - declarations: [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(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0dce32a4ba8..44c731ead9c 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 @@ -7,11 +7,16 @@ import { SearchConfigurationService } from '../../core/shared/search/search-conf import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model'; import { map, take } from 'rxjs/operators'; import { PaginationService } from '../../core/pagination/pagination.service'; +import { FormsModule } from '@angular/forms'; +import { NgFor, AsyncPipe } from '@angular/common'; +import { SidebarDropdownComponent } from '../sidebar/sidebar-dropdown.component'; @Component({ - selector: 'ds-page-size-selector', - styleUrls: ['./page-size-selector.component.scss'], - templateUrl: './page-size-selector.component.html' + 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 30ace4b2b9b..753e421cc8d 100644 --- a/src/app/shared/pagination/pagination.component.spec.ts +++ b/src/app/shared/pagination/pagination.component.spec.ts @@ -144,35 +144,34 @@ describe('Pagination component', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, StoreModule.forRoot({}, storeModuleConfig), TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), NgxPaginationModule, NgbModule, RouterTestingModule.withRoutes([ - { path: 'home', component: TestComponent } - ])], - declarations: [ + { path: 'home', component: TestComponent } + ]), PaginationComponent, TestComponent, EnumKeysPipe - ], // declare the test component - providers: [ + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useValue: routerStub }, { provide: HostWindowService, useValue: hostWindowServiceStub }, { provide: PaginationService, useValue: paginationService }, ChangeDetectorRef, PaginationComponent - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -379,7 +378,13 @@ describe('Pagination component', () => { }); // declare a test component -@Component({ selector: 'ds-test-cmp', template: '' }) +@Component({ + selector: 'ds-test-cmp', template: '', + standalone: true, + imports: [CommonModule, + NgxPaginationModule, + NgbModule] +}) class TestComponent { collection: string[] = []; diff --git a/src/app/shared/pagination/pagination.component.ts b/src/app/shared/pagination/pagination.component.ts index 6da813cbc7d..9e18f63f853 100644 --- a/src/app/shared/pagination/pagination.component.ts +++ b/src/app/shared/pagination/pagination.component.ts @@ -24,17 +24,24 @@ import { RemoteData } from '../../core/data/remote-data'; import { PaginatedList } from '../../core/data/paginated-list.model'; import { ListableObject } from '../object-collection/shared/listable-object.model'; import { ViewMode } from '../../core/shared/view-mode.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 { NgIf, NgFor, NgClass, AsyncPipe } from '@angular/common'; /** * 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 + 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 b60e7f64c09..be775cf57de 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 @@ -89,14 +89,12 @@ describe('ResourcePolicyCreateComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [ + imports: [ + TranslateModule.forRoot(), ResourcePolicyCreateComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -105,11 +103,11 @@ describe('ResourcePolicyCreateComponent test suite', () => { ResourcePolicyCreateComponent, ChangeDetectorRef, Injector - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -261,8 +259,9 @@ describe('ResourcePolicyCreateComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 236351571fd..9ccfb10f2c5 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 @@ -3,21 +3,26 @@ import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { NotificationsService } from '../../notifications/notifications.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; -import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; +import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @Component({ selector: 'ds-resource-policy-create', - templateUrl: './resource-policy-create.component.html' + templateUrl: './resource-policy-create.component.html', + imports: [ + ResourcePolicyFormComponent, + TranslateModule + ], + 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 ff473d5c49e..9c7694e33a0 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 @@ -71,14 +71,12 @@ describe('ResourcePolicyEditComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ - TranslateModule.forRoot() - ], - declarations: [ + imports: [ + TranslateModule.forRoot(), ResourcePolicyEditComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: NotificationsService, useValue: new NotificationsServiceStub() }, @@ -87,11 +85,11 @@ describe('ResourcePolicyEditComponent test suite', () => { ResourcePolicyEditComponent, ChangeDetectorRef, Injector - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -213,8 +211,9 @@ describe('ResourcePolicyEditComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 a16f409bcb1..936e2b12ea0 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 @@ -3,20 +3,25 @@ import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject, Observable, of, combineLatest as observableCombineLatest, } from 'rxjs'; import { map, take } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { ResourcePolicyDataService } from '../../../core/resource-policy/resource-policy-data.service'; import { NotificationsService } from '../../notifications/notifications.service'; import { RemoteData } from '../../../core/data/remote-data'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; -import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; +import { ResourcePolicyEvent, ResourcePolicyFormComponent } from '../form/resource-policy-form.component'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../item-page/edit-item-page/edit-item-page.routing-paths'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; @Component({ selector: 'ds-resource-policy-edit', - templateUrl: './resource-policy-edit.component.html' + templateUrl: './resource-policy-edit.component.html', + imports: [ + ResourcePolicyFormComponent, + TranslateModule + ], + 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 b5232459f55..9239b7dc17a 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 @@ -115,23 +115,18 @@ describe('ResourcePolicyEntryComponent', () => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, - TranslateModule.forRoot() - ], - declarations: [ - ResourcePolicyEntryComponent, - ], - providers: [ + TranslateModule.forRoot(), + ResourcePolicyEntryComponent + ], + providers: [ { provide: ActivatedRoute, useValue: routeStub }, { provide: Router, useValue: routerStub }, { provide: GroupDataService, useValue: groupService }, { provide: DSONameService, useValue: dsoNameService } - ], - // schemas: [ - // NO_ERRORS_SCHEMA - // ] - }).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 904a79cbe61..5f7653470d6 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 @@ -20,6 +20,9 @@ import { Group } from '../../../core/eperson/models/group.model'; import { ACCESS_CONTROL_MODULE_PATH } from '../../../app-routing-paths'; import { GROUP_EDIT_PATH } from '../../../access-control/access-control-routing-paths'; 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'; export interface ResourcePolicyCheckboxEntry { id: string; @@ -31,6 +34,13 @@ export interface ResourcePolicyCheckboxEntry { /* eslint-disable @angular-eslint/component-selector */ selector: 'tr[ds-resource-policy-entry]', templateUrl: './resource-policy-entry.component.html', + imports: [ + AsyncPipe, + TranslateModule, + FormsModule, + NgIf + ], + 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 1cc908cc6d8..65b6dd7adc5 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 @@ -176,22 +176,20 @@ describe('ResourcePolicyFormComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ BrowserModule, CommonModule, FormsModule, NgbModule, NoopAnimationsModule, ReactiveFormsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), FormComponent, EpersonGroupListComponent, ResourcePolicyFormComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: Router, useValue: new RouterMock() }, { provide: Store, useValue: StoreMock }, @@ -203,11 +201,11 @@ describe('ResourcePolicyFormComponent test suite', () => { FormBuilderService, ChangeDetectorRef, ResourcePolicyFormComponent - ], - schemas: [ + ], + schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -451,8 +449,14 @@ describe('ResourcePolicyFormComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [BrowserModule, + CommonModule, + FormsModule, + NgbModule, + 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 223e610908b..d462331e5a4 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 @@ -41,7 +41,11 @@ import { EPersonDataService } from '../../../core/eperson/eperson-data.service'; import { GroupDataService } from '../../../core/eperson/group-data.service'; import { getFirstSucceededRemoteData } from '../../../core/shared/operators'; import { RequestService } from '../../../core/data/request.service'; -import { NgbModal, NgbNavChangeEvent } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbNavChangeEvent, NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; +import { FormComponent } from '../../form/form.component'; +import { EpersonGroupListComponent } from '../../eperson-group-list/eperson-group-list.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { AsyncPipe, NgIf } from '@angular/common'; export interface ResourcePolicyEvent { object: ResourcePolicy; @@ -55,6 +59,15 @@ export interface ResourcePolicyEvent { @Component({ selector: 'ds-resource-policy-form', templateUrl: './resource-policy-form.component.html', + imports: [ + FormComponent, + NgbNavModule, + EpersonGroupListComponent, + TranslateModule, + AsyncPipe, + NgIf + ], + 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 77eaffd413b..910aba1dd40 100644 --- a/src/app/shared/resource-policies/resource-policies.component.spec.ts +++ b/src/app/shared/resource-policies/resource-policies.component.spec.ts @@ -196,18 +196,16 @@ describe('ResourcePoliciesComponent test suite', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, FormsModule, ReactiveFormsModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), ResourcePoliciesComponent, ResourcePolicyEntryComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: LinkService, useValue: linkService }, { provide: ActivatedRoute, useValue: routeStub }, { provide: EPersonDataService, useValue: epersonService }, @@ -219,10 +217,10 @@ describe('ResourcePoliciesComponent test suite', () => { { provide: DSONameService, useValue: dsoNameService }, ChangeDetectorRef, ResourcePoliciesComponent - ], schemas: [ + ], schemas: [ NO_ERRORS_SCHEMA - ] - }).compileComponents(); + ] +}).compileComponents(); })); describe('', () => { @@ -420,8 +418,12 @@ describe('ResourcePoliciesComponent test suite', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 afe23b13d19..8dbb9dc9461 100644 --- a/src/app/shared/resource-policies/resource-policies.component.ts +++ b/src/app/shared/resource-policies/resource-policies.component.ts @@ -3,7 +3,7 @@ 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 { TranslateService } from '@ngx-translate/core'; +import { TranslateModule, TranslateService } from '@ngx-translate/core'; import { getAllSucceededRemoteData } from '../../core/shared/operators'; import { ResourcePolicyDataService } from '../../core/resource-policy/resource-policy-data.service'; @@ -15,12 +15,21 @@ import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { RequestService } from '../../core/data/request.service'; import { NotificationsService } from '../notifications/notifications.service'; import { followLink } from '../utils/follow-link-config.model'; -import { ResourcePolicyCheckboxEntry } from './entry/resource-policy-entry.component'; +import { ResourcePolicyCheckboxEntry, ResourcePolicyEntryComponent } from './entry/resource-policy-entry.component'; +import { AsyncPipe, NgForOf, NgIf } from '@angular/common'; @Component({ selector: 'ds-resource-policies', styleUrls: ['./resource-policies.component.scss'], templateUrl: './resource-policies.component.html', + imports: [ + ResourcePolicyEntryComponent, + TranslateModule, + NgIf, + AsyncPipe, + NgForOf + ], + 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 8a7f6dca793..c58d5708206 100644 --- a/src/app/shared/resource-policies/resource-policies.module.ts +++ b/src/app/shared/resource-policies/resource-policies.module.ts @@ -28,21 +28,19 @@ const PROVIDERS = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS - ], - imports: [ - NgbModule, - CommonModule, - FormModule, - TranslateModule, - SharedModule - ], - providers: [ - ...PROVIDERS - ], - exports: [ - ...COMPONENTS - ] + imports: [ + NgbModule, + CommonModule, + FormModule, + TranslateModule, + SharedModule, + ...COMPONENTS + ], + providers: [ + ...PROVIDERS + ], + exports: [ + ...COMPONENTS + ] }) export class ResourcePoliciesModule { } 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 11928a03c4b..4fcb0ed8e88 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 @@ -19,15 +19,13 @@ describe('ResultsBackButtonComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [ResultsBackButtonComponent], - imports: [TranslateModule.forRoot(), - RouterTestingModule.withRoutes([]) - ], - providers: [ - { provide: TranslateService, useValue: translate } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), + RouterTestingModule.withRoutes([]), ResultsBackButtonComponent], + providers: [ + { provide: TranslateService, useValue: translate } + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 cf29cf2f4ae..fe6059ababc 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,12 +1,15 @@ import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; +import { AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-results-back-button', - styleUrls: ['./results-back-button.component.scss'], - templateUrl: './results-back-button.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + 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/results-back-button.module.ts b/src/app/shared/results-back-button/results-back-button.module.ts index 91f387c56e6..9b497fbc56d 100644 --- a/src/app/shared/results-back-button/results-back-button.module.ts +++ b/src/app/shared/results-back-button/results-back-button.module.ts @@ -5,17 +5,15 @@ import { ResultsBackButtonComponent } from './results-back-button.component'; import { ThemedResultsBackButtonComponent } from './themed-results-back-button.component'; @NgModule({ - declarations: [ - ResultsBackButtonComponent, - ThemedResultsBackButtonComponent - ], - imports: [ - CommonModule, - TranslateModule - ], - exports: [ - ThemedResultsBackButtonComponent - ] + imports: [ + CommonModule, + TranslateModule, + ResultsBackButtonComponent, + ThemedResultsBackButtonComponent + ], + exports: [ + ThemedResultsBackButtonComponent + ] }) export class ResultsBackButtonModule { 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 fa9fac8e70e..51b2f0a62bb 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 @@ -4,9 +4,10 @@ import { ResultsBackButtonComponent } from './results-back-button.component'; import { Observable } from 'rxjs'; @Component({ - selector: 'ds-themed-results-back-button', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', + 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 3ee99959d1c..fd48279fb1b 100644 --- a/src/app/shared/roles/role.directive.ts +++ b/src/app/shared/roles/role.directive.ts @@ -17,7 +17,8 @@ import { RoleService } from '../../core/roles/role.service'; import { RoleType } from '../../core/roles/role-types'; @Directive({ - selector: '[dsShowOnlyForRole],[dsShowExceptForRole]' + 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 61b54a11251..15dbc283fa4 100644 --- a/src/app/shared/rss-feed/rss.component.spec.ts +++ b/src/app/shared/rss-feed/rss.component.spec.ts @@ -72,16 +72,16 @@ describe('RssComponent', () => { paginatedSearchOptions: mockSearchOptions }; TestBed.configureTestingModule({ - 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() } - ], - declarations: [RSSComponent] - }).compileComponents(); + 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(); })); beforeEach(() => { diff --git a/src/app/shared/rss-feed/rss.component.ts b/src/app/shared/rss-feed/rss.component.ts index 7f27a32b9f8..058e60e6baf 100644 --- a/src/app/shared/rss-feed/rss.component.ts +++ b/src/app/shared/rss-feed/rss.component.ts @@ -17,18 +17,22 @@ import { Router } from '@angular/router'; import { map, switchMap } from 'rxjs/operators'; import { PaginatedSearchOptions } from '../search/models/paginated-search-options.model'; import { RemoteData } from '../../core/data/remote-data'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, AsyncPipe } 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 + 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 42d00aaa08d..3d86413259f 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 @@ -28,28 +28,27 @@ describe('ScopeSelectorModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [ScopeSelectorModalComponent], - providers: [ + imports: [TranslateModule.forRoot(), ScopeSelectorModalComponent], + 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 + provide: Router, useValue: router } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); 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 3301435956e..2b42b54bf89 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 @@ -6,6 +6,8 @@ import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../../dso- import { DSpaceObject } from '../../../core/shared/dspace-object.model'; 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/dso-selector.component'; /** * Component to wrap a button - to select the entire repository - @@ -14,9 +16,11 @@ import { environment } from '../../../../environments/environment'; * Used to select a scope */ @Component({ - selector: 'ds-scope-selector-modal', - styleUrls: ['./scope-selector-modal.component.scss'], - templateUrl: './scope-selector-modal.component.html', + 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 1fe1ea83160..e231863778b 100644 --- a/src/app/shared/search-form/search-form.component.spec.ts +++ b/src/app/shared/search-form/search-form.component.spec.ts @@ -35,19 +35,16 @@ describe('SearchFormComponent', () => { beforeEach(waitForAsync(() => { return TestBed.configureTestingModule({ - imports: [FormsModule, RouterTestingModule, TranslateModule.forRoot()], - 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 }, - ], - declarations: [ - SearchFormComponent, - BrowserOnlyMockPipe, - ] - }).compileComponents(); + ], + declarations: [BrowserOnlyMockPipe] +}).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 95a063bdd67..6e3f0a2f37c 100644 --- a/src/app/shared/search-form/search-form.component.ts +++ b/src/app/shared/search-form/search-form.component.ts @@ -6,18 +6,24 @@ import { SearchService } from '../../core/shared/search/search.service'; import { currentPath } from '../utils/route.utils'; import { PaginationService } from '../../core/pagination/pagination.service'; import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { ScopeSelectorModalComponent } from './scope-selector-modal/scope-selector-modal.component'; import { take } from 'rxjs/operators'; import { BehaviorSubject } from 'rxjs'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators'; import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, AsyncPipe } from '@angular/common'; +import { FormsModule } from '@angular/forms'; @Component({ - selector: 'ds-search-form', - styleUrls: ['./search-form.component.scss'], - templateUrl: './search-form.component.html' + 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 50b3751b06d..636bbc8f9b0 100644 --- a/src/app/shared/search-form/themed-search-form.component.ts +++ b/src/app/shared/search-form/themed-search-form.component.ts @@ -6,9 +6,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', + 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/search-export-csv/search-export-csv.component.spec.ts b/src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts index 82c15feeace..d0cf688d7c1 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 @@ -52,15 +52,14 @@ describe('SearchExportCsvComponent', () => { router = jasmine.createSpyObj('authorizationService', ['navigateByUrl']); TestBed.configureTestingModule({ - declarations: [SearchExportCsvComponent], - imports: [TranslateModule.forRoot(), NgbModule], - providers: [ - {provide: ScriptDataService, useValue: scriptDataService}, - {provide: AuthorizationDataService, useValue: authorizationDataService}, - {provide: NotificationsService, useValue: notificationsService}, - {provide: Router, useValue: router}, - ] - }).compileComponents(); + imports: [TranslateModule.forRoot(), NgbModule, SearchExportCsvComponent], + providers: [ + { provide: ScriptDataService, useValue: scriptDataService }, + { provide: AuthorizationDataService, useValue: authorizationDataService }, + { provide: NotificationsService, useValue: notificationsService }, + { provide: Router, useValue: router }, + ] +}).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 1997a663a13..15181d479ee 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 @@ -10,14 +10,18 @@ import { RemoteData } from '../../../core/data/remote-data'; import { Process } from '../../../process-page/processes/process.model'; import { getProcessDetailRoute } from '../../../process-page/process-page-routing.paths'; import { NotificationsService } from '../../notifications/notifications.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { Router } from '@angular/router'; import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-export-csv', - styleUrls: ['./search-export-csv.component.scss'], - templateUrl: './search-export-csv.component.html', + 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 6dcb47ce9f1..9a99d947ec1 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 @@ -2,12 +2,20 @@ import { Component, OnInit } from '@angular/core'; import { FilterType } from '../../../models/filter-type.model'; import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; import { renderFacetFor } from '../search-filter-type-decorator'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; +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 { NgFor, NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-authority-filter', - styleUrls: ['./search-authority-filter.component.scss'], - templateUrl: './search-authority-filter.component.html', - animations: [facetLoad] + 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 c9da8500d00..5152158c18d 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 @@ -2,12 +2,18 @@ import { Component, OnInit } from '@angular/core'; import { FilterType } from '../../../models/filter-type.model'; import { renderFacetFor } from '../search-filter-type-decorator'; import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; +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 { NgFor, NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-boolean-filter', - styleUrls: ['./search-boolean-filter.component.scss'], - templateUrl: './search-boolean-filter.component.html', - animations: [facetLoad] + 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 53acb1d911c..0dac98546ac 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 @@ -89,34 +89,33 @@ describe('SearchFacetOptionComponent', () => { const paginationService = new PaginationServiceStub(pagination); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [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', - searchOptions: observableOf({}) - } + 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) => { + }, + resetPage: (filterName: string) => { + } + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ } - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFacetOptionComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 cdbab61a309..648014f61f4 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,7 +1,7 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { FacetValue } from '../../../../models/facet-value.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -11,11 +11,16 @@ import { hasValue } from '../../../../../empty.util'; import { currentPath } from '../../../../../utils/route.utils'; import { getFacetValueForType } from '../../../../search.utils'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; +import { ShortNumberPipe } from '../../../../../utils/short-number.pipe'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-facet-option', - styleUrls: ['./search-facet-option.component.scss'], - templateUrl: './search-facet-option.component.html', + 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 b0acf43c325..a274eceda71 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 @@ -63,33 +63,32 @@ describe('SearchFacetRangeOptionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [SearchFacetRangeOptionComponent, ShortNumberPipe], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchFacetRangeOptionComponent, ShortNumberPipe], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: Router, useValue: new RouterStub() }, { provide: PaginationService, useValue: paginationService }, { - provide: SearchConfigurationService, useValue: { - searchOptions: observableOf({}), - paginationId: 'page-id' - } + provide: SearchConfigurationService, useValue: { + searchOptions: observableOf({}), + paginationId: 'page-id' + } }, { - provide: SearchFilterService, useValue: { - 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: { + 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) => { + } + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ } - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFacetRangeOptionComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(SearchFacetRangeOptionComponent, { set: { 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 b08a54e42ba..9764c106c1c 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,7 +1,7 @@ import { Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { FacetValue } from '../../../../models/facet-value.model'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { SearchService } from '../../../../../../core/shared/search/search.service'; @@ -14,14 +14,18 @@ import { SearchConfigurationService } from '../../../../../../core/shared/search import { hasValue } from '../../../../../empty.util'; import { currentPath } from '../../../../../utils/route.utils'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; +import { ShortNumberPipe } from '../../../../../utils/short-number.pipe'; +import { NgIf, AsyncPipe } from '@angular/common'; 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', + 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 15e418842fd..3467f9e64b7 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 @@ -114,33 +114,32 @@ describe('SearchFacetSelectedOptionComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [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: { - searchOptions: observableOf({}) - } + 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) => { + }, + resetPage: (filterName: string) => { + } + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ } - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFacetSelectedOptionComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 4566b882eb3..2eea21caaeb 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,6 @@ import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { SearchFilterConfig } from '../../../../models/search-filter-config.model'; import { SearchService } from '../../../../../../core/shared/search/search.service'; import { SearchFilterService } from '../../../../../../core/shared/search/search-filter.service'; @@ -10,11 +10,14 @@ import { FacetValue } from '../../../../models/facet-value.model'; import { currentPath } from '../../../../../utils/route.utils'; import { getFacetValueForType } from '../../../../search.utils'; import { PaginationService } from '../../../../../../core/pagination/pagination.service'; +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', + 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 0aa131d4282..502f90deb36 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 @@ -10,10 +10,13 @@ import { import { GenericConstructor } from '../../../../../core/shared/generic-constructor'; import { SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; import { BehaviorSubject } from 'rxjs'; +import { NgComponentOutlet } from '@angular/common'; @Component({ - selector: 'ds-search-facet-filter-wrapper', - templateUrl: './search-facet-filter-wrapper.component.html' + 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 92d2e5265ba..f4d752be9eb 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 @@ -89,9 +89,8 @@ describe('SearchFacetFilterComponent', () => { const mockValues = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), values)); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [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() }, @@ -100,21 +99,21 @@ describe('SearchFacetFilterComponent', () => { { provide: IN_PLACE_SEARCH, useValue: false }, { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) }, { - 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) => { + }, + resetPage: (filterName: string) => { + } + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ } - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFacetFilterComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 2b2eb9b11a7..4ff366afdfb 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 @@ -37,8 +37,9 @@ import { createPendingRemoteDataObject } from '../../../../remote-data.utils'; import { FacetValues } from '../../../models/facet-values.model'; @Component({ - selector: 'ds-search-facet-filter', - template: ``, + selector: 'ds-search-facet-filter', + template: ``, + standalone: true }) /** 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 7abe45ca8c7..2448b31a053 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 @@ -62,22 +62,19 @@ describe('SearchFilterComponent', () => { sequenceService = jasmine.createSpyObj('sequenceService', { next: 17 }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule], - declarations: [ - SearchFilterComponent, - BrowserOnlyMockPipe, - ], - providers: [ + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, SearchFilterComponent], + declarations: [BrowserOnlyMockPipe], + providers: [ { provide: SearchService, useValue: searchServiceStub }, { - provide: SearchFilterService, - useValue: mockFilterService + provide: SearchFilterService, + useValue: mockFilterService }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: SequenceService, useValue: sequenceService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFilterComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(SearchFilterComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).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 d1d3bd729d4..b0b4dff97bf 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 @@ -11,12 +11,18 @@ 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 { 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 { NgIf, NgClass, AsyncPipe, LowerCasePipe } from '@angular/common'; @Component({ - selector: 'ds-search-filter', - styleUrls: ['./search-filter.component.scss'], - templateUrl: './search-filter.component.html', - animations: [slide], + 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 e6c74d80478..10987deaaf3 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 @@ -57,15 +57,13 @@ describe('SearchHierarchyFilterComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, TranslateModule.forRoot(), - ], - declarations: [ - SearchHierarchyFilterComponent, - ], - providers: [ + SearchHierarchyFilterComponent + ], + providers: [ { provide: SearchService, useValue: searchService }, { provide: SearchFilterService, useValue: searchFilterService }, { provide: RemoteDataBuildService, useValue: {} }, @@ -75,10 +73,10 @@ describe('SearchHierarchyFilterComponent', () => { { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: IN_PLACE_SEARCH, useValue: false }, { provide: FILTER_CONFIG, useValue: Object.assign(new SearchFilterConfig(), { name: testSearchFilter }) }, - { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false)} - ], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) } + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); }); function init() { diff --git a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts index f9b3f2bff94..c95deef4be1 100644 --- a/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts +++ b/src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts @@ -26,12 +26,20 @@ import { PageInfo } from '../../../../../core/shared/page-info.model'; import { environment } from '../../../../../../environments/environment'; import { addOperatorToFilterValue } from '../../../search.utils'; import { VocabularyTreeviewModalComponent } from '../../../../form/vocabulary-treeview-modal/vocabulary-treeview-modal.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; +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 { NgFor, NgIf, AsyncPipe, LowerCasePipe } from '@angular/common'; @Component({ - selector: 'ds-search-hierarchy-filter', - styleUrls: ['./search-hierarchy-filter.component.scss'], - templateUrl: './search-hierarchy-filter.component.html', - animations: [facetLoad] + selector: 'ds-search-hierarchy-filter', + styleUrls: ['./search-hierarchy-filter.component.scss'], + templateUrl: './search-hierarchy-filter.component.html', + animations: [facetLoad], + standalone: true, + imports: [NgFor, SearchFacetSelectedOptionComponent, SearchFacetOptionComponent, NgIf, FilterInputSuggestionsComponent, FormsModule, AsyncPipe, LowerCasePipe, TranslateModule] }) /** 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 3a146f50590..0e6356465fc 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 @@ -94,9 +94,8 @@ describe('SearchRangeFilterComponent', () => { const mockValues = createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), values)); beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [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 }, @@ -106,21 +105,21 @@ describe('SearchRangeFilterComponent', () => { { provide: IN_PLACE_SEARCH, useValue: false }, { provide: REFRESH_FILTER, useValue: new BehaviorSubject(false) }, { - 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) => { + }, + resetPage: (filterName: string) => { + } + /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ } - /* eslint-enable no-empty, @typescript-eslint/no-empty-function */ - } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchRangeFilterComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 ed20e63c52f..b9683585dd3 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,8 +1,8 @@ import { BehaviorSubject, combineLatest as observableCombineLatest, Subscription } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; -import { isPlatformBrowser } from '@angular/common'; +import { isPlatformBrowser, NgIf, NgFor, AsyncPipe } from '@angular/common'; import { Component, Inject, OnDestroy, OnInit, PLATFORM_ID } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service'; import { FilterType } from '../../../models/filter-type.model'; import { renderFacetFor } from '../search-filter-type-decorator'; @@ -21,6 +21,10 @@ import { SearchConfigurationService } from '../../../../../core/shared/search/se import { RouteService } from '../../../../../core/services/route.service'; import { hasValue } from '../../../../empty.util'; import { yearFromString } from 'src/app/shared/date.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'; /** * The suffix for a range filters' minimum in the frontend URL @@ -38,10 +42,12 @@ export const RANGE_FILTER_MAX_SUFFIX = '.max'; * 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] + 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 cfd81c3750d..eefdd529201 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 @@ -3,6 +3,12 @@ import { FilterType } from '../../../models/filter-type.model'; import { facetLoad, SearchFacetFilterComponent } from '../search-facet-filter/search-facet-filter.component'; import { renderFacetFor } from '../search-filter-type-decorator'; import { addOperatorToFilterValue, } from '../../../search.utils'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; +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 { NgFor, NgIf, AsyncPipe } from '@angular/common'; /** * This component renders a simple item page. @@ -11,10 +17,12 @@ import { addOperatorToFilterValue, } from '../../../search.utils'; */ @Component({ - selector: 'ds-search-text-filter', - styleUrls: ['./search-text-filter.component.scss'], - templateUrl: './search-text-filter.component.html', - animations: [facetLoad] + 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 522459b603a..fa344997c18 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 @@ -31,16 +31,14 @@ describe('SearchFiltersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule], - declarations: [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 }, - - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchFiltersComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 766939226dd..00edd4c31c3 100644 --- a/src/app/shared/search/search-filters/search-filters.component.ts +++ b/src/app/shared/search/search-filters/search-filters.component.ts @@ -1,5 +1,5 @@ import { Component, Inject, Input, OnDestroy, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -12,12 +12,16 @@ import { SearchFilterService } from '../../../core/shared/search/search-filter.s import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; 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 { NgIf, NgFor, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-filters', - styleUrls: ['./search-filters.component.scss'], - templateUrl: './search-filters.component.html', - + selector: 'ds-search-filters', + styleUrls: ['./search-filters.component.scss'], + templateUrl: './search-filters.component.html', + standalone: true, + imports: [NgIf, NgFor, SearchFilterComponent, RouterLink, AsyncPipe, TranslateModule] }) /** 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 a9a9c10e519..4d810929652 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 @@ -9,9 +9,10 @@ import { SearchFilterConfig } from '../models/search-filter-config.model'; * Themed wrapper for SearchFiltersComponent */ @Component({ - selector: 'ds-themed-search-filters', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', + 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 b2be2ae53f0..482912537b6 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 @@ -42,18 +42,17 @@ describe('SearchLabelComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule], - declarations: [SearchLabelComponent, ObjectKeysPipe], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, SearchLabelComponent, ObjectKeysPipe], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, { provide: SearchConfigurationService, useValue: new SearchConfigurationServiceStub() }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: {} } // { provide: SearchConfigurationService, useValue: {getCurrentFrontendFilters : () => observableOf({})} } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchLabelComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(SearchLabelComponent, { set: { 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 ab4c57d9f53..8e1c1a9c187 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,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { Params, Router } from '@angular/router'; +import { Params, Router, RouterLink } from '@angular/router'; import { map } from 'rxjs/operators'; import { hasValue, isNotEmpty } from '../../../empty.util'; import { SearchService } from '../../../../core/shared/search/search.service'; @@ -8,10 +8,14 @@ import { currentPath } from '../../../utils/route.utils'; import { PaginationService } from '../../../../core/pagination/pagination.service'; import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service'; 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', + 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 e00c56aabca..98a4401bbd2 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 @@ -31,14 +31,13 @@ describe('SearchLabelsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, RouterTestingModule], - declarations: [SearchLabelsComponent, ObjectKeysPipe], - providers: [ + imports: [TranslateModule.forRoot(), NoopAnimationsModule, FormsModule, RouterTestingModule, SearchLabelsComponent, ObjectKeysPipe], + providers: [ { provide: SearchService, useValue: new SearchServiceStub(searchLink) }, { provide: SEARCH_CONFIG_SERVICE, useValue: { getCurrentFrontendFilters: () => observableOf(mockFilters) } } - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(SearchLabelsComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(SearchLabelsComponent, { set: { 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 2cc1919f500..96365b078cc 100644 --- a/src/app/shared/search/search-labels/search-labels.component.ts +++ b/src/app/shared/search/search-labels/search-labels.component.ts @@ -4,11 +4,16 @@ import { Observable } from 'rxjs'; import { Params, Router } from '@angular/router'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { map } from 'rxjs/operators'; +import { ObjectKeysPipe } from '../../utils/object-keys-pipe'; +import { SearchLabelComponent } from './search-label/search-label.component'; +import { NgFor, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search-labels', - styleUrls: ['./search-labels.component.scss'], - templateUrl: './search-labels.component.html', + 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 4cc4f84f654..2a8e22da526 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 @@ -16,12 +16,10 @@ describe('SearchResultsComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NoopAnimationsModule], - declarations: [ - SearchResultsComponent, - QueryParamsDirectiveStub], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + imports: [TranslateModule.forRoot(), NoopAnimationsModule, SearchResultsComponent], + declarations: [QueryParamsDirectiveStub], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { 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 15d2cc0f008..628ed8b0d77 100644 --- a/src/app/shared/search/search-results/search-results.component.ts +++ b/src/app/shared/search/search-results/search-results.component.ts @@ -11,6 +11,13 @@ import { CollectionElementLinkType } from '../../object-collection/collection-el import { ViewMode } from '../../../core/shared/view-mode.model'; import { Context } from '../../../core/shared/context.model'; import { PaginatedSearchOptions } from '../models/paginated-search-options.model'; +import { TranslateModule } from '@ngx-translate/core'; +import { RouterLink } from '@angular/router'; +import { ErrorComponent } from '../../error/error.component'; +import { ThemedLoadingComponent } from '../../loading/themed-loading.component'; +import { ObjectCollectionComponent } from '../../object-collection/object-collection.component'; +import { SearchExportCsvComponent } from '../search-export-csv/search-export-csv.component'; +import { NgIf } from '@angular/common'; export interface SelectionConfig { repeatable: boolean; @@ -18,12 +25,14 @@ export interface SelectionConfig { } @Component({ - selector: 'ds-search-results', - templateUrl: './search-results.component.html', - animations: [ - fadeIn, - fadeInOut - ] + 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 01ee5761f3a..d06cde0c903 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 @@ -16,9 +16,10 @@ import { ListableObject } from '../../object-collection/shared/listable-object.m * Themed wrapper for SearchResultsComponent */ @Component({ - selector: 'ds-themed-search-results', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', + selector: 'ds-themed-search-results', + styleUrls: [], + templateUrl: '../../theme-support/themed.component.html', + standalone: true }) export class ThemedSearchResultsComponent extends ThemedComponent { protected inAndOutputNames: (keyof SearchResultsComponent & keyof this)[] = ['linkType', 'searchResults', 'searchConfig', 'showCsvExport', 'showThumbnails', 'sortConfig', 'viewMode', 'configuration', 'disableHeader', 'selectable', 'context', 'hidePaginationDetail', 'selectionConfig', 'contentChange', 'deselectObject', 'selectObject']; 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 d0b51f04b1f..8b8e3596c90 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 @@ -68,34 +68,32 @@ describe('SearchSettingsComponent', () => { paginationService = new PaginationServiceStub(pagination, sort); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([])], - declarations: [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 0efd38b5b28..f9b58d794a9 100644 --- a/src/app/shared/search/search-settings/search-settings.component.ts +++ b/src/app/shared/search/search-settings/search-settings.component.ts @@ -5,11 +5,18 @@ import { ActivatedRoute, Router } from '@angular/router'; import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service'; import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component'; import { PaginationService } from '../../../core/pagination/pagination.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 { NgIf, NgFor } from '@angular/common'; @Component({ - selector: 'ds-search-settings', - styleUrls: ['./search-settings.component.scss'], - templateUrl: './search-settings.component.html' + 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 b1f1d082648..50629813f60 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 @@ -7,9 +7,10 @@ import { SortOptions } from '../../../core/cache/models/sort-options.model'; * Themed wrapper for SearchSettingsComponent */ @Component({ - selector: 'ds-themed-search-settings', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', + 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 a16387cf51c..5b56f583d40 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 @@ -11,10 +11,9 @@ describe('SearchSidebarComponent', () => { // waitForAsync beforeEach beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), NgbCollapseModule], - declarations: [SearchSidebarComponent], - schemas: [NO_ERRORS_SCHEMA], - }) + imports: [TranslateModule.forRoot(), NgbCollapseModule, SearchSidebarComponent], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); // compile template and css })); 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 929f819ca3f..cabc08d2864 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.ts +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.ts @@ -7,6 +7,12 @@ import { SortOptions } from '../../../core/cache/models/sort-options.model'; import { ViewMode } from '../../../core/shared/view-mode.model'; import { RemoteData } from '../../../core/data/remote-data'; 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'; /** * This component renders a simple item page. @@ -15,9 +21,11 @@ import { SearchFilterConfig } from '../models/search-filter-config.model'; */ @Component({ - selector: 'ds-search-sidebar', - styleUrls: ['./search-sidebar.component.scss'], - templateUrl: './search-sidebar.component.html', + 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 935f7975328..860435204bd 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 @@ -13,9 +13,10 @@ import { SearchFilterConfig } from '../models/search-filter-config.model'; * Themed wrapper for SearchSidebarComponent */ @Component({ - selector: 'ds-themed-search-sidebar', - styleUrls: [], - templateUrl: '../../theme-support/themed.component.html', + 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 8fc178c67a4..b40fa55473d 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 @@ -40,22 +40,22 @@ describe('SearchSwitchConfigurationComponent', () => { ]; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }) - ], - declarations: [SearchSwitchConfigurationComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), + SearchSwitchConfigurationComponent + ], + providers: [ { provide: Router, useValue: new RouterStub() }, { provide: SearchService, useValue: searchServiceStub }, { provide: SEARCH_CONFIG_SERVICE, useValue: new SearchConfigurationServiceStub() }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 0e1b4f221b3..d9744a1708a 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 @@ -11,11 +11,16 @@ import { SearchConfigurationOption } from './search-configuration-option.model'; import { SearchService } from '../../../core/shared/search/search.service'; import { currentPath } from '../../utils/route.utils'; import findIndex from 'lodash/findIndex'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; +import { NgIf, NgFor } from '@angular/common'; @Component({ - selector: 'ds-search-switch-configuration', - styleUrls: ['./search-switch-configuration.component.scss'], - templateUrl: './search-switch-configuration.component.html', + 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 d0d9bdda86a..51c297e1684 100644 --- a/src/app/shared/search/search.component.spec.ts +++ b/src/app/shared/search/search.component.spec.ts @@ -193,42 +193,40 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar searchConfigurationServiceStub.paginatedSearchOptions = new BehaviorSubject(new PaginatedSearchOptions({pagination: {id: 'default'} as any})); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule], - declarations: [compType, ...additionalDeclarations], + imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule, compType, ...additionalDeclarations], providers: [ - { provide: SearchService, useValue: searchServiceStub }, - { - provide: CommunityDataService, - useValue: jasmine.createSpyObj('communityService', ['findById', 'findAll']) - }, - { 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, - useValue: SidebarServiceStub - }, - { - provide: SearchFilterService, - useValue: {} - }, - { - provide: SEARCH_CONFIG_SERVICE, - useValue: searchConfigurationServiceStub - } + { provide: SearchService, useValue: searchServiceStub }, + { + provide: CommunityDataService, + useValue: jasmine.createSpyObj('communityService', ['findById', 'findAll']) + }, + { 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, + useValue: SidebarServiceStub + }, + { + provide: SearchFilterService, + useValue: {} + }, + { + provide: SEARCH_CONFIG_SERVICE, + useValue: searchConfigurationServiceStub + } ], schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(compType, { +}).overrideComponent(compType, { set: { changeDetection: ChangeDetectionStrategy.Default, providers: [{ diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index 61f3a119c87..c40c557966f 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -38,13 +38,23 @@ import { WorkspaceItem } from '../..//core/submission/models/workspaceitem.model import { ITEM_MODULE_PATH } from '../../item-page/item-page-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 { 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 { NgIf, NgTemplateOutlet, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-search', - styleUrls: ['./search.component.scss'], - templateUrl: './search.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, - animations: [pushInOut], + 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 69500999a8c..4b41f71829c 100644 --- a/src/app/shared/search/search.module.ts +++ b/src/app/shared/search/search.module.ts @@ -87,21 +87,19 @@ export const MODELS = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS - ], - imports: [ - CommonModule, - TranslateModule.forChild({ - missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper }, - useDefaultLang: true - }), - SharedModule.withEntryComponents(), - NouisliderModule, - ], - exports: [ - ...COMPONENTS - ] + imports: [ + CommonModule, + TranslateModule.forChild({ + missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MissingTranslationHelper }, + useDefaultLang: true + }), + SharedModule.withEntryComponents(), + NouisliderModule, + ...COMPONENTS + ], + exports: [ + ...COMPONENTS + ] }) export class SearchModule { /** diff --git a/src/app/shared/search/themed-search.component.ts b/src/app/shared/search/themed-search.component.ts index fe531e4f0f5..c7d1a16a460 100644 --- a/src/app/shared/search/themed-search.component.ts +++ b/src/app/shared/search/themed-search.component.ts @@ -14,9 +14,10 @@ import { ListableObject } from '../object-collection/shared/listable-object.mode * Themed wrapper for {@link SearchComponent} */ @Component({ - selector: 'ds-themed-search', - styleUrls: [], - templateUrl: '../theme-support/themed.component.html', + selector: 'ds-themed-search', + styleUrls: [], + templateUrl: '../theme-support/themed.component.html', + standalone: true }) export class ThemedSearchComponent extends ThemedComponent { protected inAndOutputNames: (keyof SearchComponent & keyof this)[] = ['configurationList', 'context', 'configuration', 'fixedFilterQuery', 'useCachedVersionIfAvailable', 'inPlaceSearch', 'linkType', 'paginationId', 'searchEnabled', 'sideBarWidth', 'searchFormPlaceholder', 'selectable', 'selectionConfig', 'showCsvExport', 'showSidebar', 'showThumbnails', 'showViewModes', 'useUniquePageId', 'viewModeList', 'showScopeSelector', 'resultFound', 'deselectObject', 'selectObject', 'trackStatistics', 'query']; diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 0f7871f7f9b..36725383317 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -494,27 +494,25 @@ const DIRECTIVES = [ ]; @NgModule({ - imports: [ - ...MODULES, - ...ROOT_MODULES - ], - declarations: [ - ...PIPES, - ...COMPONENTS, - ...ENTRY_COMPONENTS, - ...DIRECTIVES, - ], - providers: [ - ...PROVIDERS - ], - exports: [ - ...MODULES, - ...PIPES, - ...COMPONENTS, - ...ENTRY_COMPONENTS, - ...DIRECTIVES, - TranslateModule, - ] + imports: [ + ...MODULES, + ...ROOT_MODULES, + ...PIPES, + ...COMPONENTS, + ...ENTRY_COMPONENTS, + ...DIRECTIVES + ], + providers: [ + ...PROVIDERS + ], + exports: [ + ...MODULES, + ...PIPES, + ...COMPONENTS, + ...ENTRY_COMPONENTS, + ...DIRECTIVES, + TranslateModule, + ] }) /** 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 f04632488cd..c058caa9fb9 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.spec.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.spec.ts @@ -15,23 +15,21 @@ describe('PageWithSidebarComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - providers: [ + imports: [NoopAnimationsModule, PageWithSidebarComponent], + providers: [ { - provide: SidebarService, - useClass: SidebarServiceStub + 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) }) }, - ], - declarations: [PageWithSidebarComponent] - }).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 63b4a6195c2..ee31cbeeb3c 100644 --- a/src/app/shared/sidebar/page-with-sidebar.component.ts +++ b/src/app/shared/sidebar/page-with-sidebar.component.ts @@ -4,12 +4,15 @@ import { HostWindowService } from '../host-window.service'; import { Observable } from 'rxjs'; import { pushInOut } from '../animations/push'; import { map } from 'rxjs/operators'; +import { NgTemplateOutlet, AsyncPipe } from '@angular/common'; @Component({ - selector: 'ds-page-with-sidebar', - styleUrls: ['./page-with-sidebar.component.scss'], - templateUrl: './page-with-sidebar.component.html', - animations: [pushInOut], + 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 471d357e253..a5f770b14fa 100644 --- a/src/app/shared/sidebar/sidebar-dropdown.component.ts +++ b/src/app/shared/sidebar/sidebar-dropdown.component.ts @@ -1,9 +1,12 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ - selector: 'ds-sidebar-dropdown', - styleUrls: ['./sidebar-dropdown.component.scss'], - templateUrl: './sidebar-dropdown.component.html', + 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 2407f21fdf3..fa27f7e8de8 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 @@ -32,17 +32,16 @@ describe('StartsWithDateComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [StartsWithDateComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithDateComponent, EnumKeysPipe], + providers: [ { provide: 'startsWithOptions', useValue: options }, { provide: 'paginationId', useValue: 'page-id' }, { provide: ActivatedRoute, useValue: activatedRouteStub }, { provide: PaginationService, useValue: paginationService }, { provide: Router, useValue: new RouterStub() } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 89d9361b6a0..84225c86616 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 @@ -5,15 +5,20 @@ import { renderStartsWithFor, StartsWithType } from '../starts-with-decorator'; import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; import { hasValue } from '../../empty.util'; import { PaginationService } from '../../../core/pagination/pagination.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgFor } from '@angular/common'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; /** * 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' + selector: 'ds-starts-with-date', + styleUrls: ['./starts-with-date.component.scss'], + templateUrl: './starts-with-date.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgFor, TranslateModule] }) @renderStartsWithFor(StartsWithType.date) export class StartsWithDateComponent extends StartsWithAbstractComponent { 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 b717c72d76b..5ad6fa8cd00 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 @@ -23,15 +23,14 @@ describe('StartsWithTextComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule], - declarations: [StartsWithTextComponent, EnumKeysPipe], - providers: [ + imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, StartsWithTextComponent, EnumKeysPipe], + providers: [ { provide: 'startsWithOptions', useValue: options }, { provide: 'paginationId', useValue: 'page-id' }, { provide: PaginationService, useValue: paginationService } - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 9f44fc4d40b..7fa00d8589d 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 @@ -2,14 +2,18 @@ import { Component } from '@angular/core'; import { renderStartsWithFor, StartsWithType } from '../starts-with-decorator'; import { StartsWithAbstractComponent } from '../starts-with-abstract.component'; import { hasValue } from '../../empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; /** * 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' + selector: 'ds-starts-with-text', + styleUrls: ['./starts-with-text.component.scss'], + templateUrl: './starts-with-text.component.html', + standalone: true, + imports: [FormsModule, ReactiveFormsModule, TranslateModule] }) @renderStartsWithFor(StartsWithType.text) 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 992e0de18d7..2c975e7de26 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 @@ -76,28 +76,28 @@ describe('SubscriptionModalComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModalModule, ReactiveFormsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [SubscriptionModalComponent], - providers: [ + SubscriptionModalComponent + ], + providers: [ NgbActiveModal, { provide: AuthService, useValue: authService }, { provide: NotificationsService, useValue: notificationServiceStub }, { provide: SubscriptionsDataService, useValue: subscriptionServiceStub }, - ], - 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 2413aad36ed..7a16d9a2a35 100644 --- a/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts +++ b/src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts @@ -1,10 +1,10 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BehaviorSubject, combineLatest, from, shareReplay } from 'rxjs'; import { map, mergeMap, take, tap } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import findIndex from 'lodash/findIndex'; @@ -18,11 +18,16 @@ import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from import { AuthService } from '../../../core/auth/auth.service'; import { isNotEmpty } from '../../empty.util'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; +import { AlertComponent } from '../../alert/alert.component'; +import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; +import { NgIf, NgFor, AsyncPipe, KeyValuePipe } from '@angular/common'; @Component({ - selector: 'ds-subscription-modal', - templateUrl: './subscription-modal.component.html', - styleUrls: ['./subscription-modal.component.scss'] + 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 aefdb5772b6..a90a26d300e 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 @@ -54,27 +54,27 @@ describe('SubscriptionViewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ + imports: [ CommonModule, NgbModule, ReactiveFormsModule, BrowserModule, RouterTestingModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [ SubscriptionViewComponent ], - providers: [ + SubscriptionViewComponent + ], + providers: [ { provide: ComponentFixtureAutoDetect, useValue: true }, { provide: NotificationsService, useValue: NotificationsServiceStub }, { provide: SubscriptionsDataService, useValue: subscriptionServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }) + ], + schemas: [NO_ERRORS_SCHEMA] +}) .compileComponents(); }); 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 072b8d78281..b8d27ba5bbb 100644 --- a/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts +++ b/src/app/shared/subscriptions/subscription-view/subscription-view.component.ts @@ -13,12 +13,18 @@ import { getCollectionModuleRoute } from '../../../collection-page/collection-pa import { getItemModuleRoute } from '../../../item-page/item-page-routing-paths'; import { SubscriptionModalComponent } from '../subscription-modal/subscription-modal.component'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.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'] + // 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.module.ts b/src/app/shared/subscriptions/subscriptions.module.ts index 122bf5ca8d9..8dc795e8866 100644 --- a/src/app/shared/subscriptions/subscriptions.module.ts +++ b/src/app/shared/subscriptions/subscriptions.module.ts @@ -15,20 +15,18 @@ const COMPONENTS = [ ]; @NgModule({ - declarations: [ - ...COMPONENTS - ], - imports: [ - CommonModule, - NgbModalModule, - ReactiveFormsModule, - TranslateModule, - RouterModule, - SharedModule - ], - exports: [ - ...COMPONENTS - ] + imports: [ + CommonModule, + NgbModalModule, + ReactiveFormsModule, + TranslateModule, + RouterModule, + SharedModule, + ...COMPONENTS + ], + exports: [ + ...COMPONENTS + ] }) export class SubscriptionsModule { } diff --git a/src/app/shared/testing/test-module.ts b/src/app/shared/testing/test-module.ts index 85fa295dc22..29846cb8307 100644 --- a/src/app/shared/testing/test-module.ts +++ b/src/app/shared/testing/test-module.ts @@ -27,7 +27,8 @@ import { BrowserOnlyMockPipe } from './browser-only-mock.pipe'; ], exports: [ QueryParamsDirectiveStub, - RouterLinkDirectiveStub + RouterLinkDirectiveStub, + BrowserOnlyMockPipe ], schemas: [ CUSTOM_ELEMENTS_SCHEMA diff --git a/src/app/shared/theme-support/themed.component.spec.ts b/src/app/shared/theme-support/themed.component.spec.ts index 7776e603798..8401723e7f9 100644 --- a/src/app/shared/theme-support/themed.component.spec.ts +++ b/src/app/shared/theme-support/themed.component.spec.ts @@ -9,8 +9,9 @@ import { TestComponent } from './test/test.component.spec'; import { ThemeConfig } from '../../../config/theme.model'; @Component({ - selector: 'ds-test-themed-component', - templateUrl: './themed.component.html' + selector: 'ds-test-themed-component', + templateUrl: './themed.component.html', + standalone: true }) class TestThemedComponent extends ThemedComponent { protected inAndOutputNames: (keyof TestComponent & keyof this)[] = ['testInput']; @@ -36,13 +37,12 @@ describe('ThemedComponent', () => { function setupTestingModuleForTheme(theme: string, themes?: ThemeConfig[]) { themeService = getMockThemeService(theme, themes); TestBed.configureTestingModule({ - imports: [], - declarations: [TestThemedComponent, VarDirective], - providers: [ + imports: [TestThemedComponent, VarDirective], + providers: [ { provide: ThemeService, useValue: themeService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 c538f074c54..f067677a2ff 100644 --- a/src/app/shared/trackable/abstract-trackable.component.spec.ts +++ b/src/app/shared/trackable/abstract-trackable.component.spec.ts @@ -46,15 +46,14 @@ describe('AbstractTrackableComponent', () => { scheduler = getTestScheduler(); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot()], - declarations: [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 e1a99d90b94..5a0b26a49e5 100644 --- a/src/app/shared/trackable/abstract-trackable.component.ts +++ b/src/app/shared/trackable/abstract-trackable.component.ts @@ -8,8 +8,9 @@ import { Component } from '@angular/core'; * Abstract Component that is able to track changes made in the inheriting component using the ObjectUpdateService */ @Component({ - selector: 'ds-abstract-trackable', - template: '' + 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 08d3e18117d..a789cf51420 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 @@ -31,21 +31,19 @@ describe('TruncatablePartComponent', () => { beforeEach(waitForAsync(() => { translateService = getMockTranslateService(); void TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, + imports: [NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } - }), - ], - declarations: [TruncatablePartComponent], - providers: [ + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } + }), TruncatablePartComponent], + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: TruncatableService, useValue: truncatableServiceStub }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(TruncatablePartComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).overrideComponent(TruncatablePartComponent, { set: { changeDetection: ChangeDetectionStrategy.Default } }).compileComponents(); })); @@ -113,22 +111,22 @@ describe('TruncatablePartComponent', () => { beforeEach(waitForAsync(() => { translateService = getMockTranslateService(); void TestBed.configureTestingModule({ - imports: [ + imports: [ NoopAnimationsModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), - ], - declarations: [TruncatablePartComponent], - providers: [ + TruncatablePartComponent + ], + providers: [ { provide: NativeWindowService, useValue: new NativeWindowRef() }, { provide: TruncatableService, useValue: mockTruncatableService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(TruncatablePartComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 790bd5985d2..c16bb92d686 100644 --- a/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts +++ b/src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts @@ -1,11 +1,16 @@ import { AfterViewChecked, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { TruncatableService } from '../truncatable.service'; import { hasValue } from '../../empty.util'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; +import { DragClickDirective } from '../../utils/drag-click.directive'; @Component({ - selector: 'ds-truncatable-part', - templateUrl: './truncatable-part.component.html', - styleUrls: ['./truncatable-part.component.scss'] + 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 29100e50d2e..0ce4ac0f165 100644 --- a/src/app/shared/truncatable/truncatable.component.spec.ts +++ b/src/app/shared/truncatable/truncatable.component.spec.ts @@ -12,13 +12,12 @@ describe('TruncatableComponent', () => { let truncatableService; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [TruncatableComponent], - providers: [ + imports: [NoopAnimationsModule, TruncatableComponent], + providers: [ { provide: TruncatableService, useValue: mockTruncatableService }, - ], - schemas: [NO_ERRORS_SCHEMA] - }).overrideComponent(TruncatableComponent, { + ], + schemas: [NO_ERRORS_SCHEMA] +}).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 8fca300cd46..c5d28ae3289 100644 --- a/src/app/shared/truncatable/truncatable.component.ts +++ b/src/app/shared/truncatable/truncatable.component.ts @@ -2,10 +2,10 @@ import { AfterViewChecked, Component, ElementRef, Input, OnInit } from '@angular import { TruncatableService } from './truncatable.service'; @Component({ - selector: 'ds-truncatable', - templateUrl: './truncatable.component.html', - styleUrls: ['./truncatable.component.scss'], - + 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 06636f4256e..d964c446170 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,8 +1,12 @@ import { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core'; import uniqueId from 'lodash/uniqueId'; -import { FileUploader } from 'ng2-file-upload'; +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 { FormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; +import { FileValidator } from "../../utils/require-file.validator"; /** * Component to have a file dropzone without that dropping/choosing a file in browse automatically triggers @@ -14,7 +18,15 @@ import { UploaderOptions } from '../uploader/uploader-options.model'; @Component({ selector: 'ds-file-dropzone-no-uploader', templateUrl: './file-dropzone-no-uploader.component.html', - styleUrls: ['./file-dropzone-no-uploader.scss'] + styleUrls: ['./file-dropzone-no-uploader.scss'], + imports: [ + CommonModule, + FormsModule, + TranslateModule, + FileUploadModule, + FileValidator + ], + 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 9f2895d7aca..12b6567e4f4 100644 --- a/src/app/shared/upload/upload.module.ts +++ b/src/app/shared/upload/upload.module.ts @@ -18,21 +18,19 @@ const COMPONENTS = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - FileUploadModule, - ], - declarations: [ - ...COMPONENTS, - ], - providers: [ - ...COMPONENTS, - ], - exports: [ - ...COMPONENTS, - FileUploadModule, - ] + imports: [ + CommonModule, + SharedModule, + 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 8ea23c8acbd..e9dd4d37ef8 100644 --- a/src/app/shared/upload/uploader/uploader.component.spec.ts +++ b/src/app/shared/upload/uploader/uploader.component.spec.ts @@ -25,24 +25,22 @@ describe('Chips component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FileUploadModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), UploaderComponent, - TestComponent, - ], // declare the test component - providers: [ + TestComponent + ], + providers: [ ChangeDetectorRef, ScrollToService, UploaderComponent, DragService, { provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock('mock-token') }, { provide: CookieService, useValue: new CookieServiceMock() }, - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}); })); @@ -66,8 +64,10 @@ describe('Chips component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + selector: 'ds-test-cmp', + template: ``, + standalone: true, + imports: [FileUploadModule] }) 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 ef4ce4ee451..c6683950ff7 100644 --- a/src/app/shared/upload/uploader/uploader.component.ts +++ b/src/app/shared/upload/uploader/uploader.component.ts @@ -1,7 +1,16 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostListener, Input, Output, ViewEncapsulation, } from '@angular/core'; +import { + ChangeDetectionStrategy, + ChangeDetectorRef, + Component, + EventEmitter, + HostListener, + Input, + Output, + ViewEncapsulation, +} from '@angular/core'; import { of as observableOf } from 'rxjs'; -import { FileUploader } from 'ng2-file-upload'; +import { FileUploader, FileUploadModule } from 'ng2-file-upload'; import uniqueId from 'lodash/uniqueId'; import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to'; @@ -12,15 +21,18 @@ import { HttpXsrfTokenExtractor } from '@angular/common/http'; import { XSRF_COOKIE, XSRF_REQUEST_HEADER, XSRF_RESPONSE_HEADER } from '../../../core/xsrf/xsrf.constants'; import { CookieService } from '../../../core/services/cookie.service'; import { DragService } from '../../../core/drag.service'; +import { TranslateModule } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'ds-uploader', templateUrl: 'uploader.component.html', styleUrls: ['uploader.component.scss'], changeDetection: ChangeDetectionStrategy.Default, - encapsulation: ViewEncapsulation.Emulated + encapsulation: ViewEncapsulation.Emulated, + standalone: true, + 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 a2d860a8e19..a04c85b0054 100644 --- a/src/app/shared/utils/auto-focus.directive.ts +++ b/src/app/shared/utils/auto-focus.directive.ts @@ -5,7 +5,8 @@ import { isNotEmpty } from '../empty.util'; * Directive to set focus on an element when it is rendered */ @Directive({ - selector: '[dsAutoFocus]' + 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 e3ee3df69d4..f7d11e327ed 100644 --- a/src/app/shared/utils/browser-only.pipe.ts +++ b/src/app/shared/utils/browser-only.pipe.ts @@ -17,7 +17,8 @@ import { isPlatformBrowser } from '@angular/common'; * until such components are fully interactive before trying to interact with them. */ @Pipe({ - name: 'dsBrowserOnly' + 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 2842d1dc7ea..3a378022005 100644 --- a/src/app/shared/utils/capitalize.pipe.ts +++ b/src/app/shared/utils/capitalize.pipe.ts @@ -1,7 +1,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'dsCapitalize' + 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 b9397c65e5d..e0b1105543f 100644 --- a/src/app/shared/utils/click-outside.directive.ts +++ b/src/app/shared/utils/click-outside.directive.ts @@ -1,7 +1,8 @@ import { Directive, ElementRef, Output, EventEmitter, HostListener } from '@angular/core'; @Directive({ - selector: '[dsClickOutside]' + 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 fc672a84aee..8963bf57a0e 100644 --- a/src/app/shared/utils/console.pipe.ts +++ b/src/app/shared/utils/console.pipe.ts @@ -1,7 +1,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'dsConsole' + 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 8830679e2b2..5cce67a903e 100644 --- a/src/app/shared/utils/debounce.directive.ts +++ b/src/app/shared/utils/debounce.directive.ts @@ -5,7 +5,8 @@ import { NgControl } from '@angular/forms'; import { Subject } from 'rxjs'; @Directive({ - selector: '[ngModel][dsDebounce]', + 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 b7377b4c55a..41029c838ca 100644 --- a/src/app/shared/utils/drag-click.directive.ts +++ b/src/app/shared/utils/drag-click.directive.ts @@ -1,7 +1,8 @@ import { Directive, EventEmitter, HostListener, Output } from '@angular/core'; @Directive({ - selector: '[dsDragClick]' + selector: '[dsDragClick]', + standalone: true }) /** diff --git a/src/app/shared/utils/emphasize.pipe.ts b/src/app/shared/utils/emphasize.pipe.ts index 613074a308c..46893f17b44 100644 --- a/src/app/shared/utils/emphasize.pipe.ts +++ b/src/app/shared/utils/emphasize.pipe.ts @@ -1,6 +1,9 @@ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ name: 'dsEmphasize' }) +@Pipe({ + 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 0a4a445c02c..99ef278bba1 100644 --- a/src/app/shared/utils/enum-keys-pipe.ts +++ b/src/app/shared/utils/enum-keys-pipe.ts @@ -1,6 +1,9 @@ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ name: 'dsKeys' }) +@Pipe({ + 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 934f3ee67ad..8efa4bba79f 100644 --- a/src/app/shared/utils/file-size-pipe.ts +++ b/src/app/shared/utils/file-size-pipe.ts @@ -12,7 +12,10 @@ import * as fileSize from 'filesize'; * formats to: 1 KB */ -@Pipe({ name: 'dsFileSize' }) +@Pipe({ + name: 'dsFileSize', + standalone: true +}) export class FileSizePipe implements PipeTransform { transform(bytes: number = 0, precision: number = 2): string { return fileSize(bytes, { standard: 'jedec', round: precision }); diff --git a/src/app/shared/utils/file-value-accessor.directive.ts b/src/app/shared/utils/file-value-accessor.directive.ts index 82ce2e6ab0d..ca292a00558 100644 --- a/src/app/shared/utils/file-value-accessor.directive.ts +++ b/src/app/shared/utils/file-value-accessor.directive.ts @@ -5,13 +5,14 @@ import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms'; // 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)', + host: { + '(change)': 'onChange($event.target.files)', '(blur)': 'onTouched()' }, providers: [ { 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 fef0c2f9628..5b857889fb2 100644 --- a/src/app/shared/utils/in-list-validator.directive.ts +++ b/src/app/shared/utils/in-list-validator.directive.ts @@ -6,11 +6,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 } - ] + 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 90b6d25731a..bc15cded9ee 100644 --- a/src/app/shared/utils/markdown.pipe.ts +++ b/src/app/shared/utils/markdown.pipe.ts @@ -37,7 +37,8 @@ const SANITIZE_HTML = new InjectionToken( * */ @Pipe({ - name: 'dsMarkdown' + 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 8725246eebe..84e3b7087df 100644 --- a/src/app/shared/utils/metadatafield-validator.directive.ts +++ b/src/app/shared/utils/metadatafield-validator.directive.ts @@ -12,11 +12,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 } - ] + 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 0d6a2c82229..ee9f4754244 100644 --- a/src/app/shared/utils/object-keys-pipe.ts +++ b/src/app/shared/utils/object-keys-pipe.ts @@ -1,6 +1,9 @@ import { PipeTransform, Pipe } from '@angular/core'; -@Pipe({name: 'dsObjectKeys'}) +@Pipe({ + 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 982e3342e00..d3269fb6082 100644 --- a/src/app/shared/utils/object-ngfor.pipe.ts +++ b/src/app/shared/utils/object-ngfor.pipe.ts @@ -9,7 +9,8 @@ import { Pipe, PipeTransform } from '@angular/core'; * */ @Pipe({ - name: 'dsObjNgFor' + 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 5fab8bf8419..4207368d8e1 100644 --- a/src/app/shared/utils/object-values-pipe.ts +++ b/src/app/shared/utils/object-values-pipe.ts @@ -2,8 +2,9 @@ import { PipeTransform, Pipe } from '@angular/core'; import { isNotEmpty } from '../empty.util'; @Pipe({ - name: 'dsObjectValues', - pure: 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 ef41ad43094..903b50985a5 100644 --- a/src/app/shared/utils/require-file.validator.ts +++ b/src/app/shared/utils/require-file.validator.ts @@ -2,11 +2,12 @@ import {Directive} from '@angular/core'; import {NG_VALIDATORS, Validator, UntypedFormControl} from '@angular/forms'; @Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector + // 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 3f35ed92627..971e481fbf8 100644 --- a/src/app/shared/utils/safe-url-pipe.ts +++ b/src/app/shared/utils/safe-url-pipe.ts @@ -6,7 +6,10 @@ import { DomSanitizer } from '@angular/platform-browser'; * only use this when you are sure the URL is indeed safe */ -@Pipe({ name: 'dsSafeUrl' }) +@Pipe({ + name: 'dsSafeUrl', + standalone: true +}) export class SafeUrlPipe implements PipeTransform { constructor(private domSanitizer: DomSanitizer) { } transform(url) { diff --git a/src/app/shared/utils/short-number.pipe.ts b/src/app/shared/utils/short-number.pipe.ts index e4d5cf83562..0b71935696a 100644 --- a/src/app/shared/utils/short-number.pipe.ts +++ b/src/app/shared/utils/short-number.pipe.ts @@ -3,7 +3,8 @@ import { isEmpty } from '../empty.util'; @Pipe({ - name: 'dsShortNumber' + name: 'dsShortNumber', + standalone: true }) export class ShortNumberPipe implements PipeTransform { diff --git a/src/app/shared/utils/truncate.pipe.ts b/src/app/shared/utils/truncate.pipe.ts index f841535bb81..b905a686f15 100644 --- a/src/app/shared/utils/truncate.pipe.ts +++ b/src/app/shared/utils/truncate.pipe.ts @@ -6,7 +6,8 @@ import { hasValue } from '../empty.util'; * Default value: 10 */ @Pipe({ - name: 'dsTruncate' + 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 497fc91a8bb..906112ff9ee 100644 --- a/src/app/shared/utils/var.directive.ts +++ b/src/app/shared/utils/var.directive.ts @@ -2,7 +2,8 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core'; /* eslint-disable @angular-eslint/directive-selector */ @Directive({ - selector: '[ngVar]', + 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 248a8433161..5c090c1d67c 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 @@ -11,7 +11,10 @@ import { SearchServiceStub } from '../testing/search-service.stub'; import { ViewMode } from '../../core/shared/view-mode.model'; import { BrowserOnlyMockPipe } from '../testing/browser-only-mock.pipe'; -@Component({ template: '' }) +@Component({ + template: '', + standalone: true +}) class DummyComponent { } @@ -24,26 +27,24 @@ describe('ViewModeSwitchComponent', () => { let detailButton: HTMLElement; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock - } + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock + } }), RouterTestingModule.withRoutes([ - { path: 'search', component: DummyComponent, pathMatch: 'full' }, - ]) - ], - declarations: [ + { path: 'search', component: DummyComponent, pathMatch: 'full' }, + ]), ViewModeSwitchComponent, - DummyComponent, - BrowserOnlyMockPipe, - ], - providers: [ + DummyComponent + ], + declarations: [BrowserOnlyMockPipe], + 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 95f35abf175..0ebd3956cc5 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 @@ -6,16 +6,21 @@ 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 { Router } from '@angular/router'; +import { Router, RouterLink, RouterLinkActive } from '@angular/router'; import { filter } from 'rxjs/operators'; +import { BrowserOnlyPipe } from '../utils/browser-only.pipe'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; /** * 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' + 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 d5bb80dfde9..b7b10f5c679 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 @@ -62,24 +62,22 @@ describe('CollectionStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, SharedModule, - ], - declarations: [ 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 4875ce39cd4..5a708065e6c 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,20 +1,23 @@ import { Component } from '@angular/core'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { ActivatedRoute , Router} from '@angular/router'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; import { Collection } from '../../core/shared/collection.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AuthService } from '../../core/auth/auth.service'; +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'; /** * 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'] + 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 StatisticsPageComponent { +export class CollectionStatisticsPageComponent extends StatisticsPageDirective { /** * The report types to show on this statistics page. @@ -25,20 +28,4 @@ export class CollectionStatisticsPageComponent extends StatisticsPageComponent { 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 2e63f83b8f1..3e55c70148a 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 @@ -62,24 +62,22 @@ describe('CommunityStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, SharedModule, - ], - declarations: [ 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 de7a8bbf8cc..4e9b322b4fd 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,10 +1,11 @@ import { Component } from '@angular/core'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { ActivatedRoute, Router } from '@angular/router'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; import { Community } from '../../core/shared/community.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AuthService } from '../../core/auth/auth.service'; +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'; /** * Component representing the statistics page for a community. @@ -12,9 +13,11 @@ import { AuthService } from '../../core/auth/auth.service'; @Component({ selector: 'ds-community-statistics-page', templateUrl: '../statistics-page/statistics-page.component.html', - styleUrls: ['./community-statistics-page.component.scss'] + styleUrls: ['./community-statistics-page.component.scss'], + standalone: true, + imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], }) -export class CommunityStatisticsPageComponent extends StatisticsPageComponent { +export class CommunityStatisticsPageComponent extends StatisticsPageDirective { /** * The report types to show on this statistics page. @@ -25,20 +28,4 @@ export class CommunityStatisticsPageComponent extends StatisticsPageComponent { 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 88bbca3fba4..0e11b1e66e1 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 @@ -62,24 +62,22 @@ describe('ItemStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, SharedModule, - ], - declarations: [ 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 f5f107af747..4673301764d 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,23 @@ import { Component } from '@angular/core'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { ActivatedRoute, Router } from '@angular/router'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; import { Item } from '../../core/shared/item.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; -import { AuthService } from '../../core/auth/auth.service'; +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'; /** * 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'] + 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 StatisticsPageComponent { +export class ItemStatisticsPageComponent extends StatisticsPageDirective { /** * The report types to show on this statistics page. @@ -26,20 +29,4 @@ export class ItemStatisticsPageComponent extends StatisticsPageComponent { 'TopCountries', 'TopCities', ]; - - constructor( - protected route: ActivatedRoute, - protected router: Router, - protected usageReportService: UsageReportDataService, - protected nameService: DSONameService, - protected authService: AuthService - ) { - super( - route, - router, - usageReportService, - nameService, - authService, - ); - } } 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 50e26329a97..035d44f7f3f 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 @@ -6,9 +6,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', + 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 3c181c18161..597b4094c19 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 @@ -62,16 +62,14 @@ describe('SiteStatisticsPageComponent', () => { }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), CommonModule, SharedModule, - ], - declarations: [ SiteStatisticsPageComponent, - StatisticsTableComponent, - ], - providers: [ + StatisticsTableComponent + ], + providers: [ { provide: ActivatedRoute, useValue: activatedRoute }, { provide: Router, useValue: router }, { provide: UsageReportDataService, useValue: usageReportService }, @@ -79,8 +77,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 5eb19bec563..7d1fe3aa1f4 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,12 +1,13 @@ import { Component } from '@angular/core'; -import { StatisticsPageComponent } from '../statistics-page/statistics-page.component'; -import { SiteDataService } from '../../core/data/site-data.service'; -import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; -import { ActivatedRoute, Router } from '@angular/router'; +import { StatisticsPageDirective } from '../statistics-page/statistics-page.directive'; import { Site } from '../../core/shared/site.model'; -import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { switchMap } from 'rxjs/operators'; -import { AuthService } from '../../core/auth/auth.service'; +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'; /** * Component representing the site-wide statistics page. @@ -14,9 +15,11 @@ import { AuthService } from '../../core/auth/auth.service'; @Component({ selector: 'ds-site-statistics-page', templateUrl: '../statistics-page/statistics-page.component.html', - styleUrls: ['./site-statistics-page.component.scss'] + styleUrls: ['./site-statistics-page.component.scss'], + standalone: true, + imports: [CommonModule, VarDirective, ThemedLoadingComponent, StatisticsTableComponent, TranslateModule], }) -export class SiteStatisticsPageComponent extends StatisticsPageComponent { +export class SiteStatisticsPageComponent extends StatisticsPageDirective { /** * The report types to show on this statistics page. @@ -25,21 +28,8 @@ export class SiteStatisticsPageComponent extends StatisticsPageComponent { 'TotalVisits', ]; - constructor( - protected route: ActivatedRoute, - protected router: Router, - protected usageReportService: UsageReportDataService, - protected nameService: DSONameService, - protected siteService: SiteDataService, - protected authService: AuthService, - ) { - super( - route, - router, - usageReportService, - nameService, - authService, - ); + constructor(protected siteService: SiteDataService) { + super(); } protected getScope$() { 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 3f841163ed2..f7585c10c7e 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 @@ -6,9 +6,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', + 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.module.ts b/src/app/statistics-page/statistics-page.module.ts index 75726de94cc..43ea70351c3 100644 --- a/src/app/statistics-page/statistics-page.module.ts +++ b/src/app/statistics-page/statistics-page.module.ts @@ -28,17 +28,17 @@ const components = [ ]; @NgModule({ - imports: [ - CommonModule, - SharedModule, - CoreModule.forRoot(), - StatisticsModule.forRoot() - ], - declarations: components, - providers: [ - UsageReportDataService, - ], - exports: components + imports: [ + CommonModule, + SharedModule, + CoreModule.forRoot(), + StatisticsModule.forRoot(), + ...components + ], + providers: [ + UsageReportDataService, + ], + exports: components }) /** diff --git a/src/app/statistics-page/statistics-page/statistics-page.component.ts b/src/app/statistics-page/statistics-page/statistics-page.directive.ts similarity index 85% rename from src/app/statistics-page/statistics-page/statistics-page.component.ts rename to src/app/statistics-page/statistics-page/statistics-page.directive.ts index 8b91d54ae8f..9022c9b56d9 100644 --- a/src/app/statistics-page/statistics-page/statistics-page.component.ts +++ b/src/app/statistics-page/statistics-page/statistics-page.directive.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Directive, inject, OnInit } from '@angular/core'; import { combineLatest, Observable } from 'rxjs'; import { UsageReportDataService } from '../../core/statistics/usage-report-data.service'; import { map, switchMap } from 'rxjs/operators'; @@ -14,14 +14,11 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { AuthService } from '../../core/auth/auth.service'; import { redirectOn4xx } from '../../core/shared/authorized.operators'; +@Directive() /** * Class representing an abstract statistics page component. */ -@Component({ - selector: 'ds-statistics-page', - template: '' -}) -export abstract class StatisticsPageComponent implements OnInit { +export abstract class StatisticsPageDirective implements OnInit { /** * The scope dso for this statistics page, as an Observable. @@ -40,14 +37,11 @@ export abstract class StatisticsPageComponent implements hasData$: Observable; - constructor( - protected route: ActivatedRoute, - protected router: Router, - protected usageReportService: UsageReportDataService, - protected nameService: DSONameService, - protected authService: AuthService, - ) { - } + protected route = inject(ActivatedRoute); + protected router = inject(Router); + protected usageReportService = inject(UsageReportDataService); + protected nameService = inject(DSONameService); + protected authService = inject(AuthService); ngOnInit(): void { this.scope$ = this.getScope$(); 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 c7900cd2785..4fa4319145c 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 @@ -16,17 +16,15 @@ describe('StatisticsTableComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), - ], - declarations: [ - StatisticsTableComponent, - ], - providers: [ + StatisticsTableComponent + ], + providers: [ { provide: DSpaceObjectDataService, useValue: {} }, { provide: DSONameService, useValue: {} }, - ], - }) + ] +}) .compileComponents(); })); 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 45924caa8d1..96c1ff731cd 100644 --- a/src/app/statistics-page/statistics-table/statistics-table.component.ts +++ b/src/app/statistics-page/statistics-table/statistics-table.component.ts @@ -5,16 +5,19 @@ import { DSONameService } from '../../core/breadcrumbs/dso-name.service'; import { map } from 'rxjs/operators'; import { getRemoteDataPayload, getFinishedRemoteData } from '../../core/shared/operators'; import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslateModule } from '@ngx-translate/core'; import { isEmpty } from '../../shared/empty.util'; +import { NgIf, NgFor, AsyncPipe } 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'] + 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 805d311cfd9..471f148a0d7 100644 --- a/src/app/statistics/angulartics/dspace/view-tracker.component.ts +++ b/src/app/statistics/angulartics/dspace/view-tracker.component.ts @@ -10,9 +10,10 @@ import { ReferrerService } from '../../../core/services/referrer.service'; * This component triggers a page view statistic */ @Component({ - selector: 'ds-view-tracker', - styleUrls: ['./view-tracker.component.scss'], - templateUrl: './view-tracker.component.html', + 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 4870e4fbf0b..186bd2fe760 100644 --- a/src/app/statistics/statistics.module.ts +++ b/src/app/statistics/statistics.module.ts @@ -13,17 +13,15 @@ export const models = [ ]; @NgModule({ - imports: [ - CommonModule, - CoreModule.forRoot(), - SharedModule, - ], - declarations: [ - ViewTrackerComponent, - ], - exports: [ - ViewTrackerComponent, - ] + imports: [ + CommonModule, + CoreModule.forRoot(), + SharedModule, + ViewTrackerComponent + ], + exports: [ + ViewTrackerComponent, + ] }) /** * This module handles the statistics diff --git a/src/app/submission/edit/submission-edit.component.spec.ts b/src/app/submission/edit/submission-edit.component.spec.ts index 8013162d85c..eb5892b7afc 100644 --- a/src/app/submission/edit/submission-edit.component.spec.ts +++ b/src/app/submission/edit/submission-edit.component.spec.ts @@ -39,14 +39,14 @@ describe('SubmissionEditComponent Component', () => { findByHref: createSuccessfulRemoteDataObject$(submissionObject.item), }); TestBed.configureTestingModule({ - imports: [ + imports: [ TranslateModule.forRoot(), RouterTestingModule.withRoutes([ - { path: ':id/edit', component: SubmissionEditComponent, pathMatch: 'full' }, - ]) - ], - declarations: [SubmissionEditComponent], - providers: [ + { path: ':id/edit', component: SubmissionEditComponent, pathMatch: 'full' }, + ]), + SubmissionEditComponent + ], + providers: [ { provide: NotificationsService, useClass: NotificationsServiceStub }, { provide: SubmissionService, useClass: SubmissionServiceStub }, { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, @@ -54,10 +54,9 @@ describe('SubmissionEditComponent Component', () => { { provide: TranslateService, useValue: getMockTranslateService() }, { provide: Router, useValue: new RouterStub() }, { provide: ActivatedRoute, useValue: route }, - - ], - schemas: [NO_ERRORS_SCHEMA] - }).compileComponents(); + ], + schemas: [NO_ERRORS_SCHEMA] +}).compileComponents(); })); beforeEach(() => { diff --git a/src/app/submission/edit/submission-edit.component.ts b/src/app/submission/edit/submission-edit.component.ts index 93200e5e5c6..ae88295d2de 100644 --- a/src/app/submission/edit/submission-edit.component.ts +++ b/src/app/submission/edit/submission-edit.component.ts @@ -19,6 +19,7 @@ import { ItemDataService } from '../../core/data/item-data.service'; import { SubmissionJsonPatchOperationsService } from '../../core/submission/submission-json-patch-operations.service'; import parseSectionErrors from '../utils/parseSectionErrors'; import { SubmissionError } from '../objects/submission-error.model'; +import { SubmissionFormComponent } from '../form/submission-form.component'; /** * This component allows to edit an existing workspaceitem/workflowitem. @@ -26,7 +27,11 @@ import { SubmissionError } from '../objects/submission-error.model'; @Component({ selector: 'ds-submission-edit', styleUrls: ['./submission-edit.component.scss'], - templateUrl: './submission-edit.component.html' + templateUrl: './submission-edit.component.html', + standalone: true, + imports: [ + 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 bbaf432c134..b5ac61a1f3a 100644 --- a/src/app/submission/edit/themed-submission-edit.component.ts +++ b/src/app/submission/edit/themed-submission-edit.component.ts @@ -6,9 +6,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' + 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 c76de83b833..8fc5be12e0f 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 @@ -127,17 +127,15 @@ describe('SubmissionFormCollectionComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ FormsModule, ReactiveFormsModule, NgbModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), SubmissionFormCollectionComponent, TestComponent - ], - providers: [ + ], + providers: [ { provide: DSONameService, useValue: new DSONameServiceMock() }, { provide: CollectionDataService, useValue: collectionDataService }, { provide: SubmissionJsonPatchOperationsService, useClass: SubmissionJsonPatchOperationsServiceStub }, @@ -148,9 +146,9 @@ describe('SubmissionFormCollectionComponent Component', () => { { provide: SectionsService, useValue: sectionsService }, ChangeDetectorRef, SubmissionFormCollectionComponent - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); describe('', () => { @@ -291,8 +289,12 @@ describe('SubmissionFormCollectionComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 964f86577af..8e7d217b1eb 100644 --- a/src/app/submission/form/collection/submission-form-collection.component.ts +++ b/src/app/submission/form/collection/submission-form-collection.component.ts @@ -11,10 +11,7 @@ import { } from '@angular/core'; import { BehaviorSubject, Observable, of as observableOf, Subscription } from 'rxjs'; -import { - find, - map, mergeMap -} from 'rxjs/operators'; +import { find, map, mergeMap } from 'rxjs/operators'; import { Collection } from '../../../core/shared/collection.model'; import { hasValue, isNotEmpty } from '../../../shared/empty.util'; @@ -23,13 +20,21 @@ import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder'; import { SubmissionService } from '../../submission.service'; 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 { CollectionDataService } from '../../../core/data/collection-data.service'; import { CollectionDropdownComponent } from '../../../shared/collection-dropdown/collection-dropdown.component'; import { SectionsService } from '../../sections/sections.service'; import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; import { SectionsType } from '../../sections/sections-type'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.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. @@ -37,7 +42,14 @@ import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; @Component({ selector: 'ds-submission-form-collection', styleUrls: ['./submission-form-collection.component.scss'], - templateUrl: './submission-form-collection.component.html' + templateUrl: './submission-form-collection.component.html', + standalone: true, + imports: [ + CommonModule, + TranslateModule, + NgbDropdownModule, + 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 dd28f9a10a7..6773c1cdcb6 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 @@ -31,24 +31,22 @@ describe('SubmissionFormFooterComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, - TranslateModule.forRoot() - ], - declarations: [ + TranslateModule.forRoot(), SubmissionFormFooterComponent, - TestComponent, - BrowserOnlyMockPipe, - ], - providers: [ + TestComponent + ], + declarations: [BrowserOnlyMockPipe], + providers: [ { provide: SubmissionService, useValue: submissionServiceStub }, { provide: SubmissionRestService, useClass: SubmissionRestServiceStub }, ChangeDetectorRef, NgbModal, SubmissionFormFooterComponent - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] - }).compileComponents(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); describe('', () => { @@ -248,8 +246,10 @@ describe('SubmissionFormFooterComponent', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 7a11537616d..aa10eb93231 100644 --- a/src/app/submission/form/footer/submission-form-footer.component.ts +++ b/src/app/submission/form/footer/submission-form-footer.component.ts @@ -8,14 +8,19 @@ import { SubmissionRestService } from '../../../core/submission/submission-rest. import { SubmissionService } from '../../submission.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'; /** * 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' + 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 a8ad7fbe497..090b93d569e 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 @@ -57,24 +57,22 @@ describe('SubmissionFormSectionAddComponent Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ NgbModule, - TranslateModule.forRoot() - ], - declarations: [ + 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(); + ], + schemas: [CUSTOM_ELEMENTS_SCHEMA] +}).compileComponents(); })); describe('', () => { @@ -207,8 +205,10 @@ describe('SubmissionFormSectionAddComponent Component', () => { // declare a test component @Component({ - selector: 'ds-test-cmp', - template: `` + 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 1a758961d6c..04e7bfa6580 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 @@ -7,14 +7,19 @@ import { SectionsService } from '../../sections/sections.service'; import { HostWindowService } from '../../../shared/host-window.service'; import { SubmissionService } from '../../submission.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'; /** * This component allow to add any new section to submission form */ @Component({ selector: 'ds-submission-form-section-add', - styleUrls: [ './submission-form-section-add.component.scss' ], - templateUrl: './submission-form-section-add.component.html' + styleUrls: ['./submission-form-section-add.component.scss'], + templateUrl: './submission-form-section-add.component.html', + standalone: true, + imports: [CommonModule, TranslateModule, NgbDropdownModule,] }) export class SubmissionFormSectionAddComponent implements OnInit { diff --git a/src/app/submission/form/submission-form.component.html b/src/app/submission/form/submission-form.component.html index 4a916cfe238..d31611ff2bc 100644 --- a/src/app/submission/form/submission-form.component.html +++ b/src/app/submission/form/submission-form.component.html @@ -27,10 +27,10 @@
- + + [sectionData]="$any(object)">