mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merge remote-tracking branch 'github/main' into DURACOM-191-20240311-main-merge
# Conflicts: # src/app/access-control/access-control-routing.module.ts # src/app/access-control/access-control.module.ts # src/app/access-control/bulk-access/browse/bulk-access-browse.component.spec.ts # src/app/access-control/bulk-access/browse/bulk-access-browse.component.ts # src/app/access-control/bulk-access/bulk-access.component.spec.ts # src/app/access-control/bulk-access/bulk-access.component.ts # src/app/access-control/bulk-access/settings/bulk-access-settings.component.spec.ts # src/app/access-control/bulk-access/settings/bulk-access-settings.component.ts # src/app/access-control/epeople-registry/epeople-registry.component.spec.ts # src/app/access-control/epeople-registry/epeople-registry.component.ts # src/app/access-control/epeople-registry/eperson-form/eperson-form.component.spec.ts # src/app/access-control/epeople-registry/eperson-form/eperson-form.component.ts # src/app/access-control/group-registry/group-form/group-form.component.spec.ts # src/app/access-control/group-registry/group-form/group-form.component.ts # src/app/access-control/group-registry/group-form/members-list/members-list.component.spec.ts # src/app/access-control/group-registry/group-form/members-list/members-list.component.ts # src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.spec.ts # src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts # src/app/access-control/group-registry/groups-registry.component.spec.ts # src/app/access-control/group-registry/groups-registry.component.ts # src/app/admin/admin-curation-tasks/admin-curation-tasks.component.spec.ts # src/app/admin/admin-import-batch-page/batch-import-page.component.spec.ts # src/app/admin/admin-import-batch-page/batch-import-page.component.ts # src/app/admin/admin-import-metadata-page/metadata-import-page.component.spec.ts # src/app/admin/admin-import-metadata-page/metadata-import-page.component.ts # src/app/admin/admin-ldn-services/admin-ldn-services-routes.ts # src/app/admin/admin-ldn-services/admin-ldn-services.module.ts # src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.spec.ts # src/app/admin/admin-ldn-services/ldn-service-form/ldn-service-form.component.ts # src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.spec.ts # src/app/admin/admin-ldn-services/ldn-services-directory/ldn-services-directory.component.ts # src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.spec.ts # src/app/admin/admin-notifications/admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component.ts # src/app/admin/admin-notifications/admin-notifications-routing.module.ts # src/app/admin/admin-notifications/admin-notifications.module.ts # src/app/admin/admin-registries/admin-registries-routing.module.ts # src/app/admin/admin-registries/admin-registries.module.ts # src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.spec.ts # src/app/admin/admin-registries/bitstream-formats/add-bitstream-format/add-bitstream-format.component.ts # src/app/admin/admin-registries/bitstream-formats/bitstream-formats-routing.module.ts # src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.spec.ts # src/app/admin/admin-registries/bitstream-formats/bitstream-formats.component.ts # src/app/admin/admin-registries/bitstream-formats/bitstream-formats.module.ts # src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.spec.ts # src/app/admin/admin-registries/bitstream-formats/edit-bitstream-format/edit-bitstream-format.component.ts # src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.spec.ts # src/app/admin/admin-registries/bitstream-formats/format-form/format-form.component.ts # src/app/admin/admin-registries/metadata-registry/metadata-registry.component.spec.ts # src/app/admin/admin-registries/metadata-registry/metadata-registry.component.ts # src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.spec.ts # src/app/admin/admin-registries/metadata-registry/metadata-schema-form/metadata-schema-form.component.ts # src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.spec.ts # src/app/admin/admin-registries/metadata-schema/metadata-field-form/metadata-field-form.component.ts # src/app/admin/admin-registries/metadata-schema/metadata-schema.component.spec.ts # src/app/admin/admin-registries/metadata-schema/metadata-schema.component.ts # src/app/admin/admin-reports/admin-reports-routing.module.ts # src/app/admin/admin-reports/admin-reports.module.ts # src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts # src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts # src/app/admin/admin-reports/filtered-items/filtered-items.component.ts # src/app/admin/admin-reports/filters-section/filters-section.component.spec.ts # src/app/admin/admin-reports/filters-section/filters-section.component.ts # src/app/admin/admin-routing.module.ts # src/app/admin/admin-search-page/admin-search-page.component.spec.ts # src/app/admin/admin-search-page/admin-search-page.component.ts # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.spec.ts # src/app/admin/admin-search-page/admin-search-results/item-admin-search-result-actions.component.ts # src/app/admin/admin-search-page/admin-search.module.ts # src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.spec.ts # src/app/admin/admin-sidebar/admin-sidebar-section/admin-sidebar-section.component.ts # src/app/admin/admin-sidebar/admin-sidebar.component.spec.ts # src/app/admin/admin-sidebar/admin-sidebar.component.ts # src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.spec.ts # src/app/admin/admin-sidebar/expandable-admin-sidebar-section/expandable-admin-sidebar-section.component.ts # src/app/admin/admin-workflow-page/admin-workflow-page.component.spec.ts # src/app/admin/admin-workflow-page/admin-workflow-page.component.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.spec.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workflow-item/workflow-item-admin-workflow-actions.component.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.spec.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-group-selector/supervision-order-group-selector.component.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.spec.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/supervision-order-status/supervision-order-status.component.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.spec.ts # src/app/admin/admin-workflow-page/admin-workflow-search-results/actions/workspace-item/workspace-item-admin-workflow-actions.component.ts # 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 # 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 # 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 # 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 # 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 # 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 # 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 # 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 # src/app/admin/admin-workflow-page/admin-workflow.module.ts # src/app/admin/admin.module.ts # src/app/app-routing.module.ts # src/app/app.component.ts # src/app/app.module.ts # src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.spec.ts # src/app/bitstream-page/bitstream-authorizations/bitstream-authorizations.component.ts # src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.spec.ts # src/app/bitstream-page/bitstream-download-page/bitstream-download-page.component.ts # src/app/bitstream-page/bitstream-page-routing.module.ts # src/app/bitstream-page/bitstream-page.module.ts # src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts # src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts # src/app/breadcrumbs/breadcrumbs.component.spec.ts # src/app/breadcrumbs/breadcrumbs.component.ts # src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts # src/app/browse-by/browse-by-date/browse-by-date.component.ts # src/app/browse-by/browse-by-guard.spec.ts # src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts # src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts # src/app/browse-by/browse-by-page.module.ts # src/app/browse-by/browse-by-routing.module.ts # src/app/browse-by/browse-by-switcher/browse-by-decorator.ts # src/app/browse-by/browse-by-switcher/browse-by-switcher.component.spec.ts # src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts # src/app/browse-by/browse-by-switcher/dynamic-component-loader.directive.ts # src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.spec.ts # src/app/browse-by/browse-by-taxonomy/browse-by-taxonomy.component.ts # src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts # src/app/browse-by/browse-by-title/browse-by-title.component.ts # src/app/browse-by/browse-by.module.ts # src/app/collection-page/collection-form/collection-form.component.ts # src/app/collection-page/collection-form/collection-form.module.ts # src/app/collection-page/collection-item-mapper/collection-item-mapper.component.spec.ts # src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts # src/app/collection-page/collection-page-routing.module.ts # src/app/collection-page/collection-page.component.ts # src/app/collection-page/collection-page.module.ts # src/app/collection-page/create-collection-page/create-collection-page.component.spec.ts # src/app/collection-page/create-collection-page/create-collection-page.component.ts # src/app/collection-page/delete-collection-page/delete-collection-page.component.spec.ts # src/app/collection-page/delete-collection-page/delete-collection-page.component.ts # src/app/collection-page/edit-collection-page/collection-access-control/collection-access-control.component.spec.ts # src/app/collection-page/edit-collection-page/collection-authorizations/collection-authorizations.component.spec.ts # src/app/collection-page/edit-collection-page/collection-curate/collection-curate.component.spec.ts # src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.spec.ts # src/app/collection-page/edit-collection-page/collection-metadata/collection-metadata.component.ts # src/app/collection-page/edit-collection-page/collection-roles/collection-roles.component.spec.ts # src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.spec.ts # src/app/collection-page/edit-collection-page/collection-source/collection-source-controls/collection-source-controls.component.ts # src/app/collection-page/edit-collection-page/collection-source/collection-source.component.spec.ts # src/app/collection-page/edit-collection-page/collection-source/collection-source.component.ts # src/app/collection-page/edit-collection-page/edit-collection-page.component.spec.ts # src/app/collection-page/edit-collection-page/edit-collection-page.component.ts # src/app/collection-page/edit-collection-page/edit-collection-page.module.ts # src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts # src/app/collection-page/edit-item-template-page/edit-item-template-page.component.spec.ts # src/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts # src/app/community-list-page/community-list-page.component.spec.ts # src/app/community-list-page/community-list-page.module.ts # src/app/community-list-page/community-list-page.routing.module.ts # src/app/community-list-page/community-list/community-list.component.spec.ts # src/app/community-list-page/community-list/community-list.component.ts # src/app/community-page/community-form/community-form.component.ts # src/app/community-page/community-form/community-form.module.ts # src/app/community-page/community-page-routing.module.ts # src/app/community-page/community-page.component.ts # src/app/community-page/community-page.module.ts # src/app/community-page/create-community-page/create-community-page.component.spec.ts # src/app/community-page/create-community-page/create-community-page.component.ts # src/app/community-page/delete-community-page/delete-community-page.component.spec.ts # src/app/community-page/delete-community-page/delete-community-page.component.ts # src/app/community-page/edit-community-page/community-access-control/community-access-control.component.spec.ts # src/app/community-page/edit-community-page/community-access-control/community-access-control.component.ts # src/app/community-page/edit-community-page/community-authorizations/community-authorizations.component.spec.ts # src/app/community-page/edit-community-page/community-curate/community-curate.component.spec.ts # src/app/community-page/edit-community-page/community-metadata/community-metadata.component.spec.ts # src/app/community-page/edit-community-page/community-roles/community-roles.component.spec.ts # src/app/community-page/edit-community-page/community-roles/community-roles.component.ts # src/app/community-page/edit-community-page/edit-community-page.component.spec.ts # src/app/community-page/edit-community-page/edit-community-page.component.ts # src/app/community-page/edit-community-page/edit-community-page.module.ts # src/app/community-page/edit-community-page/edit-community-page.routing.module.ts # src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts # src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.ts # src/app/community-page/sections/sub-com-col-section/sub-com-col-section.component.ts # src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts # src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.ts # src/app/core/auth/auth.service.spec.ts # src/app/core/browse/browse-definition-data.service.ts # src/app/core/cache/builders/link.service.spec.ts # src/app/core/cache/builders/link.service.ts # src/app/core/coar-notify/notify-info/notify-info.component.spec.ts # src/app/core/coar-notify/notify-info/notify-info.component.ts # src/app/core/coar-notify/notify-info/notify-info.service.ts # src/app/core/config/bulk-access-config-data.service.ts # src/app/core/config/submission-accesses-config-data.service.ts # src/app/core/config/submission-uploads-config-data.service.ts # src/app/core/core.module.ts # src/app/core/data/access-status-data.service.ts # src/app/core/data/bitstream-data.service.ts # src/app/core/data/bitstream-format-data.service.ts # src/app/core/data/bundle-data.service.ts # src/app/core/data/collection-data.service.ts # src/app/core/data/community-data.service.ts # src/app/core/data/configuration-data.service.ts # src/app/core/data/dspace-object-data.service.ts # src/app/core/data/feature-authorization/authorization-data.service.ts # src/app/core/data/feature-authorization/feature-authorization-guard/site-administrator.guard.ts # src/app/core/data/feature-authorization/feature-authorization-guard/site-register.guard.ts # src/app/core/data/feature-authorization/feature-data.service.ts # src/app/core/data/href-only-data.service.ts # src/app/core/data/identifier-data.service.ts # src/app/core/data/item-data.service.spec.ts # src/app/core/data/item-data.service.ts # src/app/core/data/metadata-field-data.service.ts # src/app/core/data/metadata-schema-data.service.ts # src/app/core/data/processes/process-data.service.ts # src/app/core/data/processes/script-data.service.ts # src/app/core/data/relationship-data.service.ts # src/app/core/data/relationship-type-data.service.ts # src/app/core/data/root-data.service.ts # src/app/core/data/site-data.service.ts # src/app/core/data/system-wide-alert-data.service.ts # src/app/core/data/version-data.service.ts # src/app/core/data/version-history-data.service.ts # src/app/core/data/workflow-action-data.service.ts # src/app/core/eperson/eperson-data.service.spec.ts # src/app/core/eperson/eperson-data.service.ts # src/app/core/eperson/group-data.service.spec.ts # src/app/core/eperson/group-data.service.ts # src/app/core/feedback/feedback-data.service.ts # src/app/core/google-recaptcha/google-recaptcha.module.ts # src/app/core/orcid/orcid-history-data.service.ts # src/app/core/orcid/orcid-queue-data.service.ts # src/app/core/profile/researcher-profile-data.service.ts # src/app/core/registry/registry.service.spec.ts # src/app/core/resource-policy/resource-policy-data.service.ts # src/app/core/shared/non-hierarchical-browse-definition.ts # src/app/core/shared/search/search.service.spec.ts # src/app/core/statistics/usage-report-data.service.ts # src/app/core/submission/submission-cc-license-data.service.ts # src/app/core/submission/submission-cc-license-url-data.service.ts # src/app/core/submission/vocabularies/vocabulary-entry-details.data.service.ts # src/app/core/submission/workflowitem-data.service.ts # src/app/core/submission/workspaceitem-data.service.ts # src/app/core/supervision-order/supervision-order-data.service.ts # src/app/core/tasks/claimed-task-data.service.ts # src/app/core/tasks/pool-task-data.service.ts # src/app/curation-form/curation-form.component.spec.ts # src/app/curation-form/curation-form.component.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.spec.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-field-values/dso-edit-metadata-field-values.component.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.spec.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-headers/dso-edit-metadata-headers.component.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value-headers/dso-edit-metadata-value-headers.component.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.spec.ts # src/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts # src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.spec.ts # src/app/dso-shared/dso-edit-metadata/metadata-field-selector/metadata-field-selector.component.ts # src/app/dso-shared/dso-shared.module.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.spec.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal-issue/journal-issue-grid-element.component.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.spec.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal-volume/journal-volume-grid-element.component.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.spec.ts # src/app/entity-groups/journal-entities/item-grid-elements/journal/journal-grid-element.component.ts # src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.ts # src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts # src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/journal-issue/journal-issue-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/journal-volume/journal-volume-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/journal/journal-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.spec.ts # src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-issue/journal-issue-sidebar-search-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal-volume/journal-volume-sidebar-search-list-element.component.ts # src/app/entity-groups/journal-entities/item-list-elements/sidebar-search-list-elements/journal/journal-sidebar-search-list-element.component.ts # src/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts # src/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts # src/app/entity-groups/journal-entities/item-pages/journal/journal.component.spec.ts # src/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts # src/app/entity-groups/journal-entities/journal-entities.module.ts # src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.spec.ts # src/app/entity-groups/research-entities/item-grid-elements/org-unit/org-unit-grid-element.component.ts # src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.spec.ts # src/app/entity-groups/research-entities/item-grid-elements/person/person-grid-element.component.ts # src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.spec.ts # src/app/entity-groups/research-entities/item-grid-elements/project/project-grid-element.component.ts # src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.ts # src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.ts # src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/org-unit/org-unit-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/person/person-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/project/project-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.spec.ts # src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/project/project-search-result-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts # src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/project/project-sidebar-search-list-element.component.ts # src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.ts # src/app/entity-groups/research-entities/item-pages/person/person.component.ts # src/app/entity-groups/research-entities/item-pages/project/project.component.ts # src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.spec.ts # src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts # src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.spec.ts # src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts # src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.spec.ts # src/app/entity-groups/research-entities/metadata-representations/project/project-item-metadata-list-element.component.ts # src/app/entity-groups/research-entities/research-entities.module.ts # src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.spec.ts # src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.ts # src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.spec.ts # src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts # src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.spec.ts # src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.ts # src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.spec.ts # src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts # src/app/entity-groups/research-entities/submission/item-list-elements/person/person-suggestions/person-input-suggestions.component.ts # src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.spec.ts # src/app/entity-groups/research-entities/submission/name-variant-modal/name-variant-modal.component.ts # src/app/footer/footer.component.spec.ts # src/app/footer/footer.component.ts # src/app/forbidden/forbidden.component.ts # src/app/forgot-password/forgot-password-email/forgot-email.component.spec.ts # src/app/forgot-password/forgot-password-email/forgot-email.component.ts # src/app/forgot-password/forgot-password-email/themed-forgot-email.component.ts # src/app/forgot-password/forgot-password-form/forgot-password-form.component.spec.ts # src/app/forgot-password/forgot-password-form/forgot-password-form.component.ts # src/app/forgot-password/forgot-password-form/themed-forgot-password-form.component.ts # src/app/forgot-password/forgot-password-routing.module.ts # src/app/forgot-password/forgot-password.module.ts # src/app/header-nav-wrapper/header-navbar-wrapper.component.ts # src/app/header/context-help-toggle/context-help-toggle.component.spec.ts # src/app/header/context-help-toggle/context-help-toggle.component.ts # src/app/header/header.component.spec.ts # src/app/header/header.component.ts # src/app/health-page/health-info/health-info-component/health-info-component.component.spec.ts # src/app/health-page/health-info/health-info-component/health-info-component.component.ts # src/app/health-page/health-info/health-info.component.spec.ts # src/app/health-page/health-info/health-info.component.ts # src/app/health-page/health-page.component.spec.ts # src/app/health-page/health-page.component.ts # src/app/health-page/health-page.module.ts # src/app/health-page/health-page.routing.module.ts # src/app/health-page/health-panel/health-component/health-component.component.spec.ts # src/app/health-page/health-panel/health-component/health-component.component.ts # src/app/health-page/health-panel/health-panel.component.spec.ts # src/app/health-page/health-panel/health-panel.component.ts # src/app/health-page/health-panel/health-status/health-status.component.spec.ts # src/app/health-page/health-panel/health-status/health-status.component.ts # src/app/home-page/home-news/home-news.component.ts # src/app/home-page/home-page-routing.module.ts # src/app/home-page/home-page.component.ts # src/app/home-page/home-page.module.ts # src/app/home-page/recent-item-list/recent-item-list.component.spec.ts # src/app/home-page/recent-item-list/recent-item-list.component.ts # src/app/home-page/top-level-community-list/top-level-community-list.component.spec.ts # src/app/home-page/top-level-community-list/top-level-community-list.component.ts # src/app/import-external-page/import-external-page.component.spec.ts # src/app/import-external-page/import-external-page.component.ts # src/app/import-external-page/import-external-page.module.ts # src/app/import-external-page/import-external-routing.module.ts # src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.spec.ts # src/app/info/end-user-agreement/end-user-agreement-content/end-user-agreement-content.component.ts # src/app/info/end-user-agreement/end-user-agreement.component.spec.ts # src/app/info/end-user-agreement/end-user-agreement.component.ts # src/app/info/feedback/feedback-form/feedback-form.component.spec.ts # src/app/info/feedback/feedback-form/feedback-form.component.ts # src/app/info/feedback/feedback.component.spec.ts # src/app/info/feedback/feedback.component.ts # src/app/info/info-routing.module.ts # src/app/info/info.module.ts # src/app/info/privacy/privacy-content/privacy-content.component.spec.ts # src/app/info/privacy/privacy-content/privacy-content.component.ts # src/app/info/privacy/privacy.component.spec.ts # src/app/info/privacy/privacy.component.ts # src/app/init.service.ts # src/app/item-page/alerts/item-alerts.component.spec.ts # src/app/item-page/alerts/item-alerts.component.ts # src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.spec.ts # src/app/item-page/bitstreams/request-a-copy/bitstream-request-a-copy-page.component.ts # src/app/item-page/bitstreams/upload/upload-bitstream.component.spec.ts # src/app/item-page/bitstreams/upload/upload-bitstream.component.ts # src/app/item-page/edit-item-page/abstract-item-update/abstract-item-update.component.ts # src/app/item-page/edit-item-page/edit-item-page.component.spec.ts # src/app/item-page/edit-item-page/edit-item-page.component.ts # src/app/item-page/edit-item-page/edit-item-page.module.ts # src/app/item-page/edit-item-page/edit-item-page.routing.module.ts # src/app/item-page/edit-item-page/item-access-control/item-access-control.component.spec.ts # src/app/item-page/edit-item-page/item-access-control/item-access-control.component.ts # src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.spec.ts # src/app/item-page/edit-item-page/item-authorizations/item-authorizations.component.ts # src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.spec.ts # src/app/item-page/edit-item-page/item-bitstreams/item-bitstreams.component.ts # src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.spec.ts # src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.ts # 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 # 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 # src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component.ts # src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.spec.ts # src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream/item-edit-bitstream.component.ts # src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.spec.ts # src/app/item-page/edit-item-page/item-collection-mapper/item-collection-mapper.component.ts # src/app/item-page/edit-item-page/item-curate/item-curate.component.spec.ts # src/app/item-page/edit-item-page/item-curate/item-curate.component.ts # src/app/item-page/edit-item-page/item-delete/item-delete.component.spec.ts # src/app/item-page/edit-item-page/item-delete/item-delete.component.ts # src/app/item-page/edit-item-page/item-move/item-move.component.spec.ts # src/app/item-page/edit-item-page/item-move/item-move.component.ts # src/app/item-page/edit-item-page/item-operation/item-operation.component.spec.ts # src/app/item-page/edit-item-page/item-operation/item-operation.component.ts # src/app/item-page/edit-item-page/item-private/item-private.component.spec.ts # src/app/item-page/edit-item-page/item-private/item-private.component.ts # src/app/item-page/edit-item-page/item-public/item-public.component.spec.ts # src/app/item-page/edit-item-page/item-public/item-public.component.ts # src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.spec.ts # src/app/item-page/edit-item-page/item-register-doi/item-register-doi.component.ts # src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts # src/app/item-page/edit-item-page/item-reinstate/item-reinstate.component.ts # src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.spec.ts # src/app/item-page/edit-item-page/item-relationships/edit-relationship-list/edit-relationship-list.component.ts # src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.spec.ts # src/app/item-page/edit-item-page/item-relationships/edit-relationship/edit-relationship.component.ts # src/app/item-page/edit-item-page/item-relationships/item-relationships.component.spec.ts # src/app/item-page/edit-item-page/item-relationships/item-relationships.component.ts # src/app/item-page/edit-item-page/item-status/item-status.component.ts # src/app/item-page/edit-item-page/item-version-history/item-version-history.component.spec.ts # src/app/item-page/edit-item-page/item-version-history/item-version-history.component.ts # src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts # src/app/item-page/edit-item-page/item-withdraw/item-withdraw.component.ts # src/app/item-page/edit-item-page/modify-item-overview/modify-item-overview.component.ts # src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.spec.ts # src/app/item-page/edit-item-page/simple-item-action/abstract-simple-item-action.component.ts # src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.spec.ts # src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts # src/app/item-page/field-components/collections/collections.component.spec.ts # src/app/item-page/field-components/collections/collections.component.ts # src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.spec.ts # src/app/item-page/field-components/metadata-uri-values/metadata-uri-values.component.ts # src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts # src/app/item-page/field-components/metadata-values/metadata-values.component.ts # src/app/item-page/full/field-components/file-section/full-file-section.component.spec.ts # src/app/item-page/full/field-components/file-section/full-file-section.component.ts # src/app/item-page/full/full-item-page.component.spec.ts # src/app/item-page/full/full-item-page.component.ts # src/app/item-page/item-page-routing.module.ts # src/app/item-page/item-page.module.ts # src/app/item-page/item-shared.module.ts # src/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts # src/app/item-page/media-viewer/media-viewer.component.spec.ts # src/app/item-page/media-viewer/media-viewer.component.ts # src/app/item-page/mirador-viewer/mirador-viewer.component.spec.ts # src/app/item-page/mirador-viewer/mirador-viewer.component.ts # src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.spec.ts # src/app/item-page/orcid-page/orcid-auth/orcid-auth.component.ts # src/app/item-page/orcid-page/orcid-page.component.html # src/app/item-page/orcid-page/orcid-page.component.spec.ts # src/app/item-page/orcid-page/orcid-page.component.ts # src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.spec.ts # src/app/item-page/orcid-page/orcid-queue/orcid-queue.component.ts # src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.spec.ts # src/app/item-page/orcid-page/orcid-sync-settings/orcid-sync-settings.component.ts # src/app/item-page/simple/field-components/file-section/file-section.component.spec.ts # src/app/item-page/simple/field-components/file-section/file-section.component.ts # src/app/item-page/simple/field-components/file-section/themed-file-section.component.ts # src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/abstract/item-page-abstract-field.component.ts # src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/author/item-page-author-field.component.ts # src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/date/item-page-date-field.component.ts # src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts # src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts # src/app/item-page/simple/field-components/specific-field/item-page-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts # src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts # src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.spec.ts # src/app/item-page/simple/field-components/specific-field/uri/item-page-uri-field.component.ts # src/app/item-page/simple/item-page.component.spec.ts # src/app/item-page/simple/item-page.component.ts # src/app/item-page/simple/item-types/publication/publication.component.spec.ts # src/app/item-page/simple/item-types/shared/item.component.spec.ts # src/app/item-page/simple/item-types/shared/item.component.ts # src/app/item-page/simple/item-types/untyped-item/untyped-item.component.spec.ts # src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.spec.ts # src/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts # src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.spec.ts # src/app/item-page/simple/notify-requests-status/notify-requests-status-component/notify-requests-status.component.ts # src/app/item-page/simple/qa-event-notification/qa-event-notification.component.spec.ts # src/app/item-page/simple/qa-event-notification/qa-event-notification.component.ts # src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.spec.ts # src/app/item-page/simple/related-entities/related-entities-search/related-entities-search.component.ts # src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.spec.ts # src/app/item-page/simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component.ts # src/app/item-page/simple/related-items/related-items-component.ts # src/app/item-page/simple/related-items/related-items.component.spec.ts # src/app/item-page/version-page/version-page/version-page.component.ts # src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.spec.ts # src/app/item-page/versions/item-versions-delete-modal/item-versions-delete-modal.component.ts # src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.spec.ts # src/app/item-page/versions/item-versions-summary-modal/item-versions-summary-modal.component.ts # src/app/item-page/versions/item-versions.component.spec.ts # src/app/item-page/versions/item-versions.component.ts # src/app/item-page/versions/item-versions.module.ts # src/app/item-page/versions/notice/item-versions-notice.component.spec.ts # src/app/item-page/versions/notice/item-versions-notice.component.ts # src/app/login-page/login-page-routing.module.ts # src/app/login-page/login-page.component.spec.ts # src/app/login-page/login-page.component.ts # src/app/login-page/login-page.module.ts # src/app/login-page/themed-login-page.component.ts # src/app/logout-page/logout-page-routing.module.ts # src/app/logout-page/logout-page.component.spec.ts # src/app/logout-page/logout-page.component.ts # src/app/logout-page/logout-page.module.ts # src/app/logout-page/themed-logout-page.component.ts # src/app/lookup-by-id/lookup-by-id-routes.ts # src/app/lookup-by-id/lookup-by-id.module.ts # src/app/lookup-by-id/objectnotfound/objectnotfound.component.spec.ts # src/app/lookup-by-id/objectnotfound/objectnotfound.component.ts # src/app/menu.resolver.spec.ts # src/app/menu.resolver.ts # src/app/my-dspace-page/collection-selector/collection-selector.component.spec.ts # src/app/my-dspace-page/collection-selector/collection-selector.component.ts # src/app/my-dspace-page/my-dspace-configuration.service.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.spec.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.spec.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission-dropdown/my-dspace-new-submission-dropdown.component.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.spec.ts # src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-submission.component.ts # src/app/my-dspace-page/my-dspace-page-routing.module.ts # src/app/my-dspace-page/my-dspace-page.component.spec.ts # src/app/my-dspace-page/my-dspace-page.component.ts # src/app/my-dspace-page/my-dspace-page.module.ts # src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.spec.ts # src/app/my-dspace-page/my-dspace-qa-events-notifications/my-dspace-qa-events-notifications.component.ts # src/app/my-dspace-page/my-dspace-search.module.ts # src/app/my-dspace-page/themed-my-dspace-page.component.ts # src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.spec.ts # src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts # src/app/navbar/navbar-section/navbar-section.component.spec.ts # src/app/navbar/navbar-section/navbar-section.component.ts # src/app/navbar/navbar.component.spec.ts # src/app/navbar/navbar.component.ts # src/app/navbar/navbar.module.ts # src/app/notifications/notifications.module.ts # src/app/notifications/qa/events/ePerson-data/ePerson-data.component.spec.ts # src/app/notifications/qa/events/ePerson-data/ePerson-data.component.ts # src/app/notifications/qa/events/quality-assurance-events.component.spec.ts # src/app/notifications/qa/events/quality-assurance-events.component.ts # src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.spec.ts # src/app/notifications/qa/project-entry-import-modal/project-entry-import-modal.component.ts # src/app/notifications/qa/source/quality-assurance-source.component.spec.ts # src/app/notifications/qa/source/quality-assurance-source.component.ts # src/app/notifications/qa/topics/quality-assurance-topics.component.spec.ts # src/app/notifications/qa/topics/quality-assurance-topics.component.ts # src/app/notifications/suggestion-actions/suggestion-actions.component.ts # src/app/notifications/suggestion-list-element/suggestion-evidences/suggestion-evidences.component.ts # src/app/notifications/suggestion-list-element/suggestion-list-element.component.spec.ts # src/app/notifications/suggestion-list-element/suggestion-list-element.component.ts # src/app/notifications/suggestion-targets/publication-claim/publication-claim.component.ts # src/app/notifications/suggestions-notification/suggestions-notification.component.ts # src/app/notifications/suggestions-popup/suggestions-popup.component.spec.ts # src/app/notifications/suggestions-popup/suggestions-popup.component.ts # src/app/page-error/page-error.component.spec.ts # src/app/page-error/page-error.component.ts # src/app/page-internal-server-error/page-internal-server-error.component.ts # src/app/pagenotfound/pagenotfound.component.ts # src/app/process-page/detail/process-detail-field/process-detail-field.component.spec.ts # src/app/process-page/detail/process-detail-field/process-detail-field.component.ts # src/app/process-page/detail/process-detail.component.spec.ts # src/app/process-page/detail/process-detail.component.ts # src/app/process-page/form/process-form.component.spec.ts # src/app/process-page/form/process-form.component.ts # src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.spec.ts # src/app/process-page/form/process-parameters/parameter-select/parameter-select.component.ts # src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.spec.ts # src/app/process-page/form/process-parameters/parameter-value-input/boolean-value-input/boolean-value-input.component.ts # src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.spec.ts # src/app/process-page/form/process-parameters/parameter-value-input/date-value-input/date-value-input.component.ts # src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.spec.ts # src/app/process-page/form/process-parameters/parameter-value-input/file-value-input/file-value-input.component.ts # src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.spec.ts # src/app/process-page/form/process-parameters/parameter-value-input/parameter-value-input.component.ts # src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.spec.ts # src/app/process-page/form/process-parameters/parameter-value-input/string-value-input/string-value-input.component.ts # src/app/process-page/form/process-parameters/process-parameters.component.spec.ts # src/app/process-page/form/process-parameters/process-parameters.component.ts # src/app/process-page/form/script-help/script-help.component.spec.ts # src/app/process-page/form/script-help/script-help.component.ts # src/app/process-page/form/scripts-select/scripts-select.component.spec.ts # src/app/process-page/form/scripts-select/scripts-select.component.ts # src/app/process-page/new/new-process.component.spec.ts # src/app/process-page/overview/process-overview.component.spec.ts # src/app/process-page/overview/process-overview.component.ts # src/app/process-page/overview/table/process-overview-table.component.ts # src/app/process-page/process-page-routing.module.ts # src/app/process-page/process-page-shared.module.ts # src/app/process-page/process-page.module.ts # src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.spec.ts # src/app/profile-page/profile-claim-item-modal/profile-claim-item-modal.component.ts # src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.spec.ts # src/app/profile-page/profile-page-metadata-form/profile-page-metadata-form.component.ts # src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.spec.ts # src/app/profile-page/profile-page-researcher-form/profile-page-researcher-form.component.ts # src/app/profile-page/profile-page-routing.module.ts # src/app/profile-page/profile-page-security-form/profile-page-security-form.component.spec.ts # src/app/profile-page/profile-page-security-form/profile-page-security-form.component.ts # src/app/profile-page/profile-page.component.spec.ts # src/app/profile-page/profile-page.component.ts # src/app/profile-page/profile-page.module.ts # src/app/profile-page/themed-profile-page.component.ts # src/app/quality-assurance-notifications-pages/notifications-pages-routing.module.ts # src/app/quality-assurance-notifications-pages/notifications-pages.module.ts # src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.spec.ts # src/app/quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component.ts # src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.spec.ts # src/app/quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component.ts # src/app/quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component.spec.ts # src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.spec.ts # src/app/quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component.ts # src/app/register-email-form/register-email-form.component.spec.ts # src/app/register-email-form/register-email-form.component.ts # src/app/register-email-form/register-email-form.module.ts # src/app/register-page/create-profile/create-profile.component.spec.ts # src/app/register-page/create-profile/create-profile.component.ts # src/app/register-page/create-profile/themed-create-profile.component.ts # src/app/register-page/register-email/register-email.component.spec.ts # src/app/register-page/register-email/register-email.component.ts # src/app/register-page/register-page-routing.module.ts # src/app/register-page/register-page.module.ts # src/app/request-copy/deny-request-copy/deny-request-copy.component.spec.ts # src/app/request-copy/deny-request-copy/deny-request-copy.component.ts # src/app/request-copy/email-request-copy/email-request-copy.component.spec.ts # src/app/request-copy/email-request-copy/email-request-copy.component.ts # src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.spec.ts # src/app/request-copy/grant-deny-request-copy/grant-deny-request-copy.component.ts # src/app/request-copy/grant-request-copy/grant-request-copy.component.spec.ts # src/app/request-copy/grant-request-copy/grant-request-copy.component.ts # src/app/request-copy/request-copy-routing.module.ts # src/app/request-copy/request-copy.module.ts # src/app/root.module.ts # src/app/root/root.component.spec.ts # src/app/root/root.component.ts # src/app/search-navbar/search-navbar.component.spec.ts # src/app/search-navbar/search-navbar.component.ts # src/app/search-page/configuration-search-page.component.ts # src/app/search-page/search-page-routing.module.ts # src/app/search-page/search-page.component.ts # src/app/search-page/search-page.module.ts # src/app/shared/abstract-component-loader/dynamic-component-loader.directive.ts # src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.spec.ts # src/app/shared/access-control-form-container/access-control-array-form/access-control-array-form.component.ts # src/app/shared/access-control-form-container/access-control-array-form/to-date.pipe.ts # src/app/shared/access-control-form-container/access-control-form-container.component.spec.ts # src/app/shared/access-control-form-container/access-control-form-container.component.ts # src/app/shared/access-control-form-container/access-control-form.module.ts # src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.spec.ts # src/app/shared/access-control-form-container/item-access-control-select-bitstreams-modal/item-access-control-select-bitstreams-modal.component.ts # src/app/shared/alert/alert.component.spec.ts # src/app/shared/alert/alert.component.ts # src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts # src/app/shared/auth-nav-menu/auth-nav-menu.component.ts # src/app/shared/auth-nav-menu/user-menu/themed-user-menu.component.ts # src/app/shared/auth-nav-menu/user-menu/user-menu.component.spec.ts # src/app/shared/auth-nav-menu/user-menu/user-menu.component.ts # src/app/shared/browse-by/browse-by.component.spec.ts # src/app/shared/browse-by/browse-by.component.ts # src/app/shared/browse-by/shared-browse-by.module.ts # src/app/shared/browse-by/themed-browse-by.component.ts # src/app/shared/collection-dropdown/collection-dropdown.component.spec.ts # src/app/shared/collection-dropdown/collection-dropdown.component.ts # src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.spec.ts # src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.ts # src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.spec.ts # src/app/shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component.ts # src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.spec.ts # src/app/shared/comcol/comcol-forms/delete-comcol-page/delete-comcol-page.component.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.spec.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.spec.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/comcol-role/comcol-role.component.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.spec.ts # src/app/shared/comcol/comcol-forms/edit-comcol-page/edit-comcol-page.component.ts # src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts # src/app/shared/comcol/comcol-page-content/comcol-page-content.component.ts # src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.spec.ts # src/app/shared/comcol/comcol-page-handle/comcol-page-handle.component.ts # src/app/shared/comcol/comcol-page-header/comcol-page-header.component.ts # src/app/shared/comcol/comcol.module.ts # src/app/shared/comcol/sections/comcol-search-section/comcol-search-section.component.ts # src/app/shared/confirmation-modal/confirmation-modal.component.spec.ts # src/app/shared/context-help-wrapper/context-help-wrapper.component.spec.ts # src/app/shared/context-help-wrapper/context-help-wrapper.component.ts # src/app/shared/context-help.directive.spec.ts # src/app/shared/correction-suggestion/withdrawn-reinstate-modal.component.ts # src/app/shared/ds-select/ds-select.component.ts # src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.spec.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-expandable-menu-section/dso-edit-menu-expandable-section.component.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.spec.ts # src/app/shared/dso-page/dso-edit-menu/dso-edit-menu.component.ts # src/app/shared/dso-page/dso-page.module.ts # src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.spec.ts # src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts # src/app/shared/dso-selector/dso-selector/dso-selector.component.spec.ts # src/app/shared/dso-selector/dso-selector/dso-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/themed-create-collection-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/themed-create-community-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/themed-create-item-parent-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/themed-edit-collection-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/edit-community-selector/themed-edit-community-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/edit-item-selector/themed-edit-item-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/export-batch-selector/export-batch-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/export-metadata-selector/export-metadata-selector.component.ts # src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.spec.ts # src/app/shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component.ts # src/app/shared/entity-dropdown/entity-dropdown.component.spec.ts # src/app/shared/entity-dropdown/entity-dropdown.component.ts # src/app/shared/eperson-group-list/eperson-group-list.component.spec.ts # src/app/shared/eperson-group-list/eperson-group-list.component.ts # src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.spec.ts # src/app/shared/eperson-group-list/eperson-search-box/eperson-search-box.component.ts # src/app/shared/eperson-group-list/group-search-box/group-search-box.component.spec.ts # src/app/shared/eperson-group-list/group-search-box/group-search-box.component.ts # src/app/shared/error/error.component.spec.ts # src/app/shared/error/error.component.ts # src/app/shared/file-download-link/file-download-link.component.spec.ts # src/app/shared/file-download-link/file-download-link.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/existing-relation-list-element/existing-relation-list-element.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/array-group/dynamic-form-array.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker-inline/dynamic-date-picker-inline.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/date-picker/date-picker.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/disabled/dynamic-disabled.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/form-group/dynamic-form-group.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.components.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/models/tag/dynamic-tag.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts # 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 # 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 # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.spec.ts # src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/selection-tab/dynamic-lookup-relation-selection-tab.component.ts # src/app/shared/form/chips/chips.component.spec.ts # src/app/shared/form/chips/chips.component.ts # src/app/shared/form/directives/authority-confidence-state.directive.ts # src/app/shared/form/form.component.spec.ts # src/app/shared/form/form.component.ts # src/app/shared/form/form.module.ts # src/app/shared/form/number-picker/number-picker.component.spec.ts # src/app/shared/form/number-picker/number-picker.component.ts # src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.spec.ts # src/app/shared/form/vocabulary-treeview-modal/vocabulary-treeview-modal.component.ts # src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.spec.ts # src/app/shared/form/vocabulary-treeview/vocabulary-treeview.component.ts # src/app/shared/google-recaptcha/google-recaptcha.component.spec.ts # src/app/shared/hover-class.directive.spec.ts # src/app/shared/hover-class.directive.ts # src/app/shared/idle-modal/idle-modal.component.spec.ts # src/app/shared/idle-modal/idle-modal.component.ts # src/app/shared/impersonate-navbar/impersonate-navbar.component.spec.ts # src/app/shared/impersonate-navbar/impersonate-navbar.component.ts # src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.spec.ts # src/app/shared/input-suggestions/dso-input-suggestions/dso-input-suggestions.component.ts # src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.spec.ts # src/app/shared/input-suggestions/filter-suggestions/filter-input-suggestions.component.ts # src/app/shared/input-suggestions/input-suggestions.component.spec.ts # src/app/shared/input-suggestions/input-suggestions.component.ts # src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.spec.ts # src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.ts # src/app/shared/lang-switch/lang-switch.component.spec.ts # src/app/shared/lang-switch/lang-switch.component.ts # src/app/shared/loading/loading.component.spec.ts # src/app/shared/loading/loading.component.ts # src/app/shared/log-in/container/log-in-container.component.spec.ts # src/app/shared/log-in/container/log-in-container.component.ts # src/app/shared/log-in/log-in.component.spec.ts # src/app/shared/log-in/log-in.component.ts # src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.spec.ts # src/app/shared/log-in/methods/log-in-external-provider/log-in-external-provider.component.ts # src/app/shared/log-in/methods/log-in.methods-decorator.ts # src/app/shared/log-in/methods/password/log-in-password.component.spec.ts # src/app/shared/log-in/methods/password/log-in-password.component.ts # src/app/shared/log-in/themed-log-in.component.ts # src/app/shared/log-out/log-out.component.spec.ts # src/app/shared/log-out/log-out.component.ts # src/app/shared/menu/menu-item/external-link-menu-item.component.spec.ts # src/app/shared/menu/menu-item/external-link-menu-item.component.ts # src/app/shared/menu/menu-item/link-menu-item.component.spec.ts # src/app/shared/menu/menu-item/link-menu-item.component.ts # src/app/shared/menu/menu-item/onclick-menu-item.component.spec.ts # src/app/shared/menu/menu-item/onclick-menu-item.component.ts # src/app/shared/menu/menu-item/text-menu-item.component.spec.ts # src/app/shared/menu/menu-item/text-menu-item.component.ts # src/app/shared/menu/menu-section.decorator.ts # src/app/shared/menu/menu-section/menu-section.component.spec.ts # src/app/shared/menu/menu-section/menu-section.component.ts # src/app/shared/menu/menu.component.ts # src/app/shared/menu/menu.module.ts # src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.spec.ts # src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.ts # src/app/shared/metadata-representation/metadata-representation-loader.component.spec.ts # src/app/shared/metadata-representation/metadata-representation-loader.component.ts # src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/approve/claimed-task-actions-approve.component.ts # src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.ts # src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/decline-task/claimed-task-actions-decline-task.component.ts # src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/edit-metadata/claimed-task-actions-edit-metadata.component.ts # src/app/shared/mydspace-actions/claimed-task/rating/advanced-claimed-task-action-rating.component.ts # src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/reject/claimed-task-actions-reject.component.ts # src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component.ts # src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/select-reviewer/advanced-claimed-task-action-select-reviewer.component.ts # src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-decorator.spec.ts # src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.spec.ts # src/app/shared/mydspace-actions/claimed-task/switcher/claimed-task-actions-loader.component.ts # src/app/shared/mydspace-actions/item/item-actions.component.spec.ts # src/app/shared/mydspace-actions/item/item-actions.component.ts # src/app/shared/mydspace-actions/mydspace-actions.module.ts # src/app/shared/mydspace-actions/mydspace-reloadable-actions.spec.ts # src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.spec.ts # src/app/shared/mydspace-actions/pool-task/pool-task-actions.component.ts # src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.spec.ts # src/app/shared/mydspace-actions/workflowitem/workflowitem-actions.component.ts # src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts # src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts # src/app/shared/notifications/notification/notification.component.spec.ts # src/app/shared/notifications/notification/notification.component.ts # src/app/shared/notifications/notifications-board/notifications-board.component.spec.ts # src/app/shared/notifications/notifications-board/notifications-board.component.ts # src/app/shared/notifications/notifications.reducers.spec.ts # src/app/shared/notifications/notifications.service.spec.ts # src/app/shared/object-collection/object-collection.component.spec.ts # src/app/shared/object-collection/object-collection.component.ts # src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.spec.ts # src/app/shared/object-collection/shared/badges/access-status-badge/access-status-badge.component.ts # src/app/shared/object-collection/shared/badges/badges.component.spec.ts # src/app/shared/object-collection/shared/badges/badges.component.ts # src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.spec.ts # src/app/shared/object-collection/shared/badges/my-dspace-status-badge/my-dspace-status-badge.component.ts # src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.spec.ts # src/app/shared/object-collection/shared/badges/status-badge/status-badge.component.ts # src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.spec.ts # src/app/shared/object-collection/shared/badges/type-badge/type-badge.component.ts # src/app/shared/object-collection/shared/importable-list-item-control/importable-list-item-control.component.ts # src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts # src/app/shared/object-collection/shared/mydspace-item-collection/item-collection.component.ts # src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.spec.ts # src/app/shared/object-collection/shared/mydspace-item-submitter/item-submitter.component.ts # src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.spec.ts # src/app/shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/claimed-task-search-result/claimed-task-search-result-detail-element.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/item-search-result/item-search-result-detail-element.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/pool-search-result/pool-search-result-detail-element.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/search-result-detail-element.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/workflow-item-search-result/workflow-item-search-result-detail-element.component.ts # src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.spec.ts # src/app/shared/object-detail/my-dspace-result-detail-element/workspace-item-search-result/workspace-item-search-result-detail-element.component.ts # src/app/shared/object-detail/object-detail.component.spec.ts # src/app/shared/object-detail/object-detail.component.ts # src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.spec.ts # src/app/shared/object-grid/collection-grid-element/collection-grid-element.component.ts # src/app/shared/object-grid/community-grid-element/community-grid-element.component.spec.ts # src/app/shared/object-grid/community-grid-element/community-grid-element.component.ts # src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.spec.ts # src/app/shared/object-grid/item-grid-element/item-types/item/item-grid-element.component.ts # src/app/shared/object-grid/object-grid.component.ts # src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.spec.ts # src/app/shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component.ts # src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.spec.ts # src/app/shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component.ts # src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.spec.ts # src/app/shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component.ts # src/app/shared/object-grid/search-result-grid-element/search-result-grid-element.component.ts # src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.spec.ts # src/app/shared/object-list/bitstream-list-item/bitstream-list-item.component.ts # src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.spec.ts # src/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts # src/app/shared/object-list/bundle-list-element/bundle-list-element.component.ts # src/app/shared/object-list/collection-list-element/collection-list-element.component.spec.ts # src/app/shared/object-list/collection-list-element/collection-list-element.component.ts # src/app/shared/object-list/community-list-element/community-list-element.component.spec.ts # src/app/shared/object-list/community-list-element/community-list-element.component.ts # src/app/shared/object-list/identifier-data/identifier-data.component.ts # src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.spec.ts # src/app/shared/object-list/item-list-element/item-types/item/item-list-element.component.ts # src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.spec.ts # src/app/shared/object-list/metadata-representation-list-element/browse-link/browse-link-metadata-list-element.component.ts # src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.spec.ts # src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-list-element.component.ts # src/app/shared/object-list/metadata-representation-list-element/item/item-metadata-representation-list-element.component.ts # src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.spec.ts # src/app/shared/object-list/metadata-representation-list-element/metadata-representation-list-element.component.ts # src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts # src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts # 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 # 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 # 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 # 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 # 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 # 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 # src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/themed-item-list-preview.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/item-search-result/item-search-result-list-element-submission.component.ts # src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/pool-search-result/pool-search-result-list-element.component.ts # src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/workflow-item-search-result/workflow-item-search-result-list-element.component.ts # src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.spec.ts # src/app/shared/object-list/my-dspace-result-list-element/workspace-item-search-result/workspace-item-search-result-list-element.component.ts # src/app/shared/object-list/object-list.component.spec.ts # src/app/shared/object-list/object-list.component.ts # src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts # src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.ts # src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.spec.ts # src/app/shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component.ts # src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.spec.ts # src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts # src/app/shared/object-list/search-result-list-element/search-result-list-element.component.ts # src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts # src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts # src/app/shared/object-list/sidebar-search-list-element/item-types/publication/publication-sidebar-search-list-element.component.ts # src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts # src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts # src/app/shared/object-select/collection-select/collection-select.component.spec.ts # src/app/shared/object-select/collection-select/collection-select.component.ts # src/app/shared/object-select/item-select/item-select.component.spec.ts # src/app/shared/object-select/item-select/item-select.component.ts # src/app/shared/page-size-selector/page-size-selector.component.spec.ts # src/app/shared/page-size-selector/page-size-selector.component.ts # src/app/shared/pagination/pagination.component.spec.ts # src/app/shared/pagination/pagination.component.ts # src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts # src/app/shared/resource-policies/create/resource-policy-create.component.ts # src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts # src/app/shared/resource-policies/edit/resource-policy-edit.component.ts # src/app/shared/resource-policies/entry/resource-policy-entry.component.spec.ts # src/app/shared/resource-policies/entry/resource-policy-entry.component.ts # src/app/shared/resource-policies/form/resource-policy-form.component.spec.ts # src/app/shared/resource-policies/form/resource-policy-form.component.ts # src/app/shared/resource-policies/resource-policies.component.spec.ts # src/app/shared/resource-policies/resource-policies.component.ts # src/app/shared/resource-policies/resource-policies.module.ts # src/app/shared/results-back-button/results-back-button.component.spec.ts # src/app/shared/results-back-button/results-back-button.component.ts # src/app/shared/results-back-button/results-back-button.module.ts # src/app/shared/roles/role.directive.ts # src/app/shared/rss-feed/rss.component.spec.ts # src/app/shared/rss-feed/rss.component.ts # src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.spec.ts # src/app/shared/search-form/scope-selector-modal/scope-selector-modal.component.ts # src/app/shared/search-form/search-form.component.spec.ts # src/app/shared/search-form/search-form.component.ts # src/app/shared/search/advanced-search/advanced-search.component.spec.ts # src/app/shared/search/advanced-search/advanced-search.component.ts # src/app/shared/search/search-export-csv/search-export-csv.component.spec.ts # src/app/shared/search/search-export-csv/search-export-csv.component.ts # src/app/shared/search/search-filters/search-filter/search-authority-filter/search-authority-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-boolean-filter/search-boolean-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-option/search-facet-option.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-range-option/search-facet-range-option.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-options/search-facet-selected-option/search-facet-selected-option.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter-wrapper/search-facet-filter-wrapper.component.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-filter.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-hierarchy-filter/search-hierarchy-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.spec.ts # src/app/shared/search/search-filters/search-filter/search-range-filter/search-range-filter.component.ts # src/app/shared/search/search-filters/search-filter/search-text-filter/search-text-filter.component.ts # src/app/shared/search/search-filters/search-filters.component.spec.ts # src/app/shared/search/search-filters/search-filters.component.ts # src/app/shared/search/search-labels/search-label/search-label.component.spec.ts # src/app/shared/search/search-labels/search-label/search-label.component.ts # src/app/shared/search/search-labels/search-labels.component.spec.ts # src/app/shared/search/search-labels/search-labels.component.ts # src/app/shared/search/search-results/search-results.component.spec.ts # src/app/shared/search/search-results/search-results.component.ts # src/app/shared/search/search-settings/search-settings.component.spec.ts # src/app/shared/search/search-settings/search-settings.component.ts # src/app/shared/search/search-sidebar/search-sidebar.component.spec.ts # src/app/shared/search/search-sidebar/search-sidebar.component.ts # src/app/shared/search/search-switch-configuration/search-switch-configuration.component.spec.ts # src/app/shared/search/search-switch-configuration/search-switch-configuration.component.ts # src/app/shared/search/search.component.spec.ts # src/app/shared/search/search.component.ts # src/app/shared/search/search.module.ts # src/app/shared/shared.module.ts # src/app/shared/sidebar/page-with-sidebar.component.spec.ts # src/app/shared/sidebar/sidebar-dropdown.component.ts # src/app/shared/starts-with/date/starts-with-date.component.spec.ts # src/app/shared/starts-with/date/starts-with-date.component.ts # src/app/shared/starts-with/starts-with-abstract.component.ts # src/app/shared/starts-with/starts-with-decorator.spec.ts # src/app/shared/starts-with/starts-with-loader.component.spec.ts # src/app/shared/starts-with/starts-with-loader.component.ts # src/app/shared/starts-with/text/starts-with-text.component.spec.ts # src/app/shared/starts-with/text/starts-with-text.component.ts # src/app/shared/subscriptions/subscription-modal/subscription-modal.component.spec.ts # src/app/shared/subscriptions/subscription-modal/subscription-modal.component.ts # src/app/shared/subscriptions/subscription-view/subscription-view.component.spec.ts # src/app/shared/subscriptions/subscription-view/subscription-view.component.ts # src/app/shared/subscriptions/subscriptions-data.service.ts # src/app/shared/subscriptions/subscriptions.module.ts # src/app/shared/testing/browser-only-mock.pipe.ts # src/app/shared/testing/dynamic-form-mock-services.ts # src/app/shared/testing/route-service.stub.ts # src/app/shared/testing/test-module.ts # src/app/shared/testing/utils.test.ts # src/app/shared/theme-support/themed.component.spec.ts # src/app/shared/trackable/abstract-trackable.component.spec.ts # src/app/shared/trackable/abstract-trackable.component.ts # src/app/shared/truncatable/truncatable-part/truncatable-part.component.spec.ts # src/app/shared/truncatable/truncatable-part/truncatable-part.component.ts # src/app/shared/truncatable/truncatable.component.spec.ts # src/app/shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component.ts # src/app/shared/upload/upload.module.ts # src/app/shared/upload/uploader/uploader.component.spec.ts # src/app/shared/upload/uploader/uploader.component.ts # src/app/shared/utils/auto-focus.directive.ts # src/app/shared/utils/browser-only.pipe.ts # src/app/shared/utils/capitalize.pipe.ts # src/app/shared/utils/click-outside.directive.ts # src/app/shared/utils/console.pipe.ts # src/app/shared/utils/drag-click.directive.ts # src/app/shared/utils/file-value-accessor.directive.ts # src/app/shared/utils/in-list-validator.directive.ts # src/app/shared/utils/markdown.pipe.ts # src/app/shared/utils/metadatafield-validator.directive.ts # src/app/shared/utils/object-keys-pipe.ts # src/app/shared/utils/object-ngfor.pipe.ts # src/app/shared/utils/object-values-pipe.ts # src/app/shared/utils/require-file.validator.ts # src/app/shared/utils/short-number.pipe.ts # src/app/shared/utils/split.pipe.ts # src/app/shared/utils/truncate.pipe.ts # src/app/shared/view-mode-switch/view-mode-switch.component.spec.ts # src/app/shared/view-mode-switch/view-mode-switch.component.ts # src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.spec.ts # src/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts # src/app/statistics-page/community-statistics-page/community-statistics-page.component.spec.ts # src/app/statistics-page/community-statistics-page/community-statistics-page.component.ts # src/app/statistics-page/item-statistics-page/item-statistics-page.component.spec.ts # src/app/statistics-page/item-statistics-page/item-statistics-page.component.ts # src/app/statistics-page/site-statistics-page/site-statistics-page.component.spec.ts # src/app/statistics-page/site-statistics-page/site-statistics-page.component.ts # src/app/statistics-page/statistics-page-routing.module.ts # src/app/statistics-page/statistics-page.module.ts # src/app/statistics-page/statistics-page/statistics-page.directive.ts # src/app/statistics-page/statistics-table/statistics-table.component.spec.ts # src/app/statistics-page/statistics-table/statistics-table.component.ts # src/app/statistics/statistics.module.ts # src/app/submission/edit/submission-edit.component.spec.ts # src/app/submission/edit/submission-edit.component.ts # src/app/submission/edit/themed-submission-edit.component.ts # src/app/submission/form/collection/submission-form-collection.component.spec.ts # src/app/submission/form/collection/submission-form-collection.component.ts # src/app/submission/form/footer/submission-form-footer.component.spec.ts # src/app/submission/form/footer/submission-form-footer.component.ts # src/app/submission/form/section-add/submission-form-section-add.component.spec.ts # src/app/submission/form/section-add/submission-form-section-add.component.ts # src/app/submission/form/submission-form.component.spec.ts # src/app/submission/form/submission-form.component.ts # src/app/submission/form/submission-upload-files/submission-upload-files.component.spec.ts # src/app/submission/form/submission-upload-files/submission-upload-files.component.ts # src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.spec.ts # src/app/submission/import-external/import-external-collection/submission-import-external-collection.component.ts # src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.spec.ts # src/app/submission/import-external/import-external-preview/submission-import-external-preview.component.ts # src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.spec.ts # src/app/submission/import-external/import-external-searchbar/submission-import-external-searchbar.component.ts # src/app/submission/import-external/submission-import-external.component.spec.ts # src/app/submission/import-external/submission-import-external.component.ts # src/app/submission/import-external/themed-submission-import-external.component.ts # src/app/submission/sections/accesses/section-accesses.component.spec.ts # src/app/submission/sections/accesses/section-accesses.component.ts # src/app/submission/sections/cc-license/submission-section-cc-licenses.component.spec.ts # src/app/submission/sections/cc-license/submission-section-cc-licenses.component.ts # src/app/submission/sections/container/section-container.component.spec.ts # src/app/submission/sections/container/section-container.component.ts # src/app/submission/sections/form/section-form-operations.service.spec.ts # src/app/submission/sections/form/section-form.component.spec.ts # src/app/submission/sections/form/section-form.component.ts # src/app/submission/sections/identifiers/section-identifiers.component.spec.ts # src/app/submission/sections/identifiers/section-identifiers.component.ts # src/app/submission/sections/license/section-license.component.spec.ts # src/app/submission/sections/license/section-license.component.ts # src/app/submission/sections/section-coar-notify/section-coar-notify.component.ts # src/app/submission/sections/sections.directive.ts # src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.spec.ts # src/app/submission/sections/sherpa-policies/content-accordion/content-accordion.component.ts # src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.spec.ts # src/app/submission/sections/sherpa-policies/metadata-information/metadata-information.component.ts # src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.spec.ts # src/app/submission/sections/sherpa-policies/publication-information/publication-information.component.ts # src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.spec.ts # src/app/submission/sections/sherpa-policies/publisher-policy/publisher-policy.component.ts # src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.spec.ts # src/app/submission/sections/sherpa-policies/section-sherpa-policies.component.ts # src/app/submission/sections/upload/accessConditions/submission-section-upload-access-conditions.component.ts # src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.spec.ts # src/app/submission/sections/upload/file/edit/section-upload-file-edit.component.ts # src/app/submission/sections/upload/file/section-upload-file.component.spec.ts # src/app/submission/sections/upload/file/section-upload-file.component.ts # src/app/submission/sections/upload/file/themed-section-upload-file.component.ts # src/app/submission/sections/upload/file/view/section-upload-file-view.component.spec.ts # src/app/submission/sections/upload/file/view/section-upload-file-view.component.ts # src/app/submission/sections/upload/section-upload.component.spec.ts # src/app/submission/sections/upload/section-upload.component.ts # src/app/submission/submission.module.ts # src/app/submission/submit/submission-submit.component.spec.ts # src/app/submission/submit/submission-submit.component.ts # src/app/submission/submit/themed-submission-submit.component.ts # src/app/submit-page/submit-page-routing.module.ts # src/app/submit-page/submit-page.module.ts # src/app/subscriptions-page/subscriptions-page-routing.module.ts # src/app/subscriptions-page/subscriptions-page.component.spec.ts # src/app/subscriptions-page/subscriptions-page.component.ts # src/app/subscriptions-page/subscriptions-page.module.ts # src/app/suggestions-page/suggestions-page-routing.module.ts # src/app/suggestions-page/suggestions-page.component.spec.ts # src/app/suggestions-page/suggestions-page.component.ts # src/app/suggestions-page/suggestions-page.module.ts # src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.spec.ts # src/app/system-wide-alert/alert-banner/system-wide-alert-banner.component.ts # src/app/system-wide-alert/alert-form/system-wide-alert-form.component.spec.ts # src/app/system-wide-alert/alert-form/system-wide-alert-form.component.ts # src/app/system-wide-alert/system-wide-alert-routing.module.ts # src/app/system-wide-alert/system-wide-alert.module.ts # src/app/thumbnail/thumbnail.component.spec.ts # src/app/thumbnail/thumbnail.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-page/advanced-workflow-action-page.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-rating/advanced-workflow-action-rating.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/advanced-workflow-action-select-reviewer.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.spec.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action-select-reviewer/reviewers-list/reviewers-list.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.spec.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-action/advanced-workflow-action.component.ts # src/app/workflowitems-edit-page/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.spec.ts # src/app/workflowitems-edit-page/workflow-item-action-page.component.spec.ts # src/app/workflowitems-edit-page/workflow-item-action-page.component.ts # src/app/workflowitems-edit-page/workflow-item-delete/themed-workflow-item-delete.component.ts # src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.spec.ts # src/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts # src/app/workflowitems-edit-page/workflow-item-send-back/themed-workflow-item-send-back.component.ts # src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.spec.ts # src/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts # src/app/workflowitems-edit-page/workflowitems-edit-page-routing.module.ts # src/app/workflowitems-edit-page/workflowitems-edit-page.module.ts # src/app/workspaceitems-edit-page/workspaceitems-delete-page/themed-workspaceitems-delete-page.component.ts # src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.spec.ts # src/app/workspaceitems-edit-page/workspaceitems-delete-page/workspaceitems-delete-page.component.ts # src/app/workspaceitems-edit-page/workspaceitems-edit-page-routing.module.ts # src/app/workspaceitems-edit-page/workspaceitems-edit-page.module.ts # src/config/app-config.interface.ts # src/modules/app/browser-app.module.ts # src/modules/app/server-app.module.ts # src/test.ts # src/themes/custom/app/admin/admin-sidebar/admin-sidebar.component.ts # src/themes/custom/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts # src/themes/custom/app/breadcrumbs/breadcrumbs.component.ts # src/themes/custom/app/browse-by/browse-by-title/browse-by-title.component.ts # src/themes/custom/app/collection-page/collection-page.component.ts # src/themes/custom/app/collection-page/edit-item-template-page/edit-item-template-page.component.ts # src/themes/custom/app/community-list-page/community-list-page.component.ts # src/themes/custom/app/community-list-page/community-list/community-list.component.ts # src/themes/custom/app/community-page/community-page.component.ts # src/themes/custom/app/dso-shared/dso-edit-metadata/dso-edit-metadata.component.ts # src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-issue/journal-issue.component.ts # src/themes/custom/app/entity-groups/journal-entities/item-pages/journal-volume/journal-volume.component.ts # src/themes/custom/app/entity-groups/journal-entities/item-pages/journal/journal.component.ts # src/themes/custom/app/entity-groups/research-entities/item-pages/person/person.component.ts # src/themes/custom/app/footer/footer.component.ts # src/themes/custom/app/forbidden/forbidden.component.ts # src/themes/custom/app/forgot-password/forgot-password-email/forgot-email.component.ts # src/themes/custom/app/forgot-password/forgot-password-form/forgot-password-form.component.ts # src/themes/custom/app/header-nav-wrapper/header-navbar-wrapper.component.ts # src/themes/custom/app/home-page/home-news/home-news.component.ts # src/themes/custom/app/home-page/home-page.component.ts # src/themes/custom/app/home-page/top-level-community-list/top-level-community-list.component.ts # src/themes/custom/app/info/end-user-agreement/end-user-agreement.component.ts # src/themes/custom/app/info/feedback/feedback-form/feedback-form.component.ts # src/themes/custom/app/info/feedback/feedback.component.ts # src/themes/custom/app/info/privacy/privacy.component.ts # src/themes/custom/app/item-page/edit-item-page/item-status/item-status.component.ts # src/themes/custom/app/item-page/full/field-components/file-section/full-file-section.component.ts # src/themes/custom/app/item-page/full/full-item-page.component.ts # src/themes/custom/app/item-page/media-viewer/media-viewer-image/media-viewer-image.component.ts # src/themes/custom/app/item-page/media-viewer/media-viewer-video/media-viewer-video.component.ts # src/themes/custom/app/item-page/media-viewer/media-viewer.component.ts # src/themes/custom/app/item-page/simple/field-components/file-section/file-section.component.ts # src/themes/custom/app/item-page/simple/field-components/specific-field/title/item-page-title-field.component.ts # src/themes/custom/app/item-page/simple/item-page.component.ts # src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts # src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts # src/themes/custom/app/item-page/simple/metadata-representation-list/metadata-representation-list.component.ts # src/themes/custom/app/login-page/login-page.component.ts # src/themes/custom/app/logout-page/logout-page.component.ts # src/themes/custom/app/lookup-by-id/objectnotfound/objectnotfound.component.ts # src/themes/custom/app/my-dspace-page/my-dspace-page.component.ts # src/themes/custom/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts # src/themes/custom/app/navbar/navbar.component.ts # src/themes/custom/app/pagenotfound/pagenotfound.component.ts # src/themes/custom/app/profile-page/profile-page.component.ts # src/themes/custom/app/register-email-form/register-email-form.component.ts # src/themes/custom/app/register-page/create-profile/create-profile.component.ts # src/themes/custom/app/register-page/register-email/register-email.component.ts # src/themes/custom/app/request-copy/deny-request-copy/deny-request-copy.component.ts # src/themes/custom/app/request-copy/email-request-copy/email-request-copy.component.ts # src/themes/custom/app/request-copy/grant-request-copy/grant-request-copy.component.ts # src/themes/custom/app/root/root.component.ts # src/themes/custom/app/search-navbar/search-navbar.component.ts # src/themes/custom/app/search-page/configuration-search-page.component.ts # src/themes/custom/app/search-page/search-page.component.ts # src/themes/custom/app/shared/auth-nav-menu/auth-nav-menu.component.ts # src/themes/custom/app/shared/comcol-page-browse-by/comcol-page-browse-by.component.ts # src/themes/custom/app/shared/comcol-page-handle/comcol-page-handle.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/create-item-parent-selector/create-item-parent-selector.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts # src/themes/custom/app/shared/dso-selector/modal-wrappers/edit-item-selector/edit-item-selector.component.ts # src/themes/custom/app/shared/file-download-link/file-download-link.component.ts # src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/external-source-tab/dynamic-lookup-relation-external-source-tab.component.ts # src/themes/custom/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/search-tab/dynamic-lookup-relation-search-tab.component.ts # src/themes/custom/app/shared/loading/loading.component.ts # src/themes/custom/app/shared/object-list/browse-entry-list-element/browse-entry-list-element.component.ts # src/themes/custom/app/shared/object-list/collection-list-element/collection-list-element.component.ts # src/themes/custom/app/shared/object-list/community-list-element/community-list-element.component.ts # src/themes/custom/app/shared/object-list/object-list.component.ts # src/themes/custom/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts # src/themes/custom/app/shared/object-list/sidebar-search-list-element/item-types/publication-sidebar-search-list-element.component.ts # src/themes/custom/app/shared/results-back-button/results-back-button.component.ts # src/themes/custom/app/shared/search-form/search-form.component.ts # src/themes/custom/app/shared/search/search-filters/search-filters.component.ts # src/themes/custom/app/shared/search/search-results/search-results.component.ts # src/themes/custom/app/shared/search/search-settings/search-settings.component.ts # src/themes/custom/app/shared/search/search-sidebar/search-sidebar.component.ts # src/themes/custom/app/shared/starts-with/date/starts-with-date.component.ts # src/themes/custom/app/shared/starts-with/text/starts-with-text.component.ts # src/themes/custom/app/statistics-page/collection-statistics-page/collection-statistics-page.component.ts # src/themes/custom/app/statistics-page/community-statistics-page/community-statistics-page.component.ts # src/themes/custom/app/statistics-page/item-statistics-page/item-statistics-page.component.ts # src/themes/custom/app/statistics-page/site-statistics-page/site-statistics-page.component.ts # src/themes/custom/app/submission/edit/submission-edit.component.ts # src/themes/custom/app/submission/import-external/submission-import-external.component.ts # src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts # src/themes/custom/app/submission/submit/submission-submit.component.ts # src/themes/custom/app/workflowitems-edit-page/workflow-item-delete/workflow-item-delete.component.ts # src/themes/custom/app/workflowitems-edit-page/workflow-item-send-back/workflow-item-send-back.component.ts # src/themes/custom/app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component.ts # src/themes/custom/eager-theme.module.ts # src/themes/custom/lazy-theme.module.ts # src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.ts # src/themes/dspace/app/header/header.component.ts # src/themes/dspace/app/home-page/home-news/home-news.component.ts # src/themes/dspace/app/navbar/navbar.component.ts # src/themes/dspace/eager-theme.module.ts # src/themes/dspace/lazy-theme.module.ts
This commit is contained in:
@@ -8,7 +8,10 @@
|
||||
"eslint-plugin-deprecation",
|
||||
"unused-imports",
|
||||
"eslint-plugin-lodash",
|
||||
"eslint-plugin-jsonc"
|
||||
"eslint-plugin-jsonc",
|
||||
"eslint-plugin-rxjs",
|
||||
"eslint-plugin-simple-import-sort",
|
||||
"eslint-plugin-import-newlines"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
@@ -27,17 +30,29 @@
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
"plugin:@angular-eslint/template/process-inline-templates",
|
||||
"plugin:rxjs/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2,
|
||||
{
|
||||
"SwitchCase": 1
|
||||
}
|
||||
],
|
||||
"max-classes-per-file": [
|
||||
"error",
|
||||
1
|
||||
],
|
||||
"comma-dangle": [
|
||||
"off",
|
||||
"error",
|
||||
"always-multiline"
|
||||
],
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"eol-last": [
|
||||
"error",
|
||||
"always"
|
||||
@@ -104,15 +119,13 @@
|
||||
"allowTernary": true
|
||||
}
|
||||
],
|
||||
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
|
||||
"prefer-const": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"prefer-spread": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
|
||||
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
|
||||
"no-prototype-builtins": "off",
|
||||
"no-useless-escape": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
@@ -182,7 +195,7 @@
|
||||
],
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"@typescript-eslint/unified-signatures": "error",
|
||||
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
|
||||
"@typescript-eslint/ban-types": "error",
|
||||
"@typescript-eslint/no-floating-promises": "warn",
|
||||
"@typescript-eslint/no-misused-promises": "warn",
|
||||
"@typescript-eslint/restrict-plus-operands": "warn",
|
||||
@@ -202,14 +215,45 @@
|
||||
|
||||
"deprecation/deprecation": "warn",
|
||||
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error",
|
||||
"import/order": "off",
|
||||
"import/first": "error",
|
||||
"import/newline-after-import": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/no-deprecated": "warn",
|
||||
"import/no-namespace": "error",
|
||||
"import-newlines/enforce": [
|
||||
"error",
|
||||
{
|
||||
"items": 1,
|
||||
"semi": true,
|
||||
"forceSingleLine": true
|
||||
}
|
||||
],
|
||||
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"lodash/import-scope": [
|
||||
"error",
|
||||
"method"
|
||||
]
|
||||
],
|
||||
|
||||
"rxjs/no-nested-subscribe": "off" // todo: go over _all_ cases
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.spec.ts"
|
||||
],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"./tsconfig.json",
|
||||
"./cypress/tsconfig.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"prefer-const": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -218,12 +262,7 @@
|
||||
],
|
||||
"extends": [
|
||||
"plugin:@angular-eslint/template/recommended"
|
||||
],
|
||||
"rules": {
|
||||
// todo: re-enable & fix errors
|
||||
"@angular-eslint/template/no-negated-async": "off",
|
||||
"@angular-eslint/template/eqeqeq": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
|
@@ -131,6 +131,10 @@ submission:
|
||||
# NOTE: after how many time (milliseconds) submission is saved automatically
|
||||
# eg. timer: 5 * (1000 * 60); // 5 minutes
|
||||
timer: 0
|
||||
# Always show the duplicate detection section if enabled, even if there are no potential duplicates detected
|
||||
# (a message will be displayed to indicate no matches were found)
|
||||
duplicateDetection:
|
||||
alwaysShowSection: false
|
||||
icons:
|
||||
metadata:
|
||||
# NOTE: example of configuration
|
||||
@@ -433,3 +437,61 @@ search:
|
||||
enabled: false
|
||||
# List of filters to enable in "Advanced Search" dropdown
|
||||
filter: [ 'title', 'author', 'subject', 'entityType' ]
|
||||
|
||||
|
||||
# Notify metrics
|
||||
# Configuration for Notify Admin Dashboard for metrics visualization
|
||||
notifyMetrics:
|
||||
# Configuration for received messages
|
||||
- title: 'admin-notify-dashboard.received-ldn'
|
||||
boxes:
|
||||
- color: '#B8DAFF'
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.accepted'
|
||||
config: 'NOTIFY.incoming.accepted'
|
||||
description: 'admin-notify-dashboard.NOTIFY.incoming.accepted.description'
|
||||
- color: '#D4EDDA'
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.processed'
|
||||
config: 'NOTIFY.incoming.processed'
|
||||
description: 'admin-notify-dashboard.NOTIFY.incoming.processed.description'
|
||||
- color: '#FDBBC7'
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.failure'
|
||||
config: 'NOTIFY.incoming.failure'
|
||||
description: 'admin-notify-dashboard.NOTIFY.incoming.failure.description'
|
||||
- color: '#FDBBC7'
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.untrusted'
|
||||
config: 'NOTIFY.incoming.untrusted'
|
||||
description: 'admin-notify-dashboard.NOTIFY.incoming.untrusted.description'
|
||||
- color: '#43515F'
|
||||
title: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems'
|
||||
textColor: '#fff'
|
||||
config: 'NOTIFY.incoming.involvedItems'
|
||||
description: 'admin-notify-dashboard.NOTIFY.incoming.involvedItems.description'
|
||||
# Configuration for outgoing messages
|
||||
- title: 'admin-notify-dashboard.generated-ldn'
|
||||
boxes:
|
||||
- color: '#B8DAFF'
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued'
|
||||
config: 'NOTIFY.outgoing.queued'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued.description'
|
||||
- color: '#FDEEBB'
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry'
|
||||
config: 'NOTIFY.outgoing.queued_for_retry'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.queued_for_retry.description'
|
||||
- color: '#FDBBC7'
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.failure'
|
||||
config: 'NOTIFY.outgoing.failure'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.failure.description'
|
||||
- color: '#43515F'
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems'
|
||||
textColor: '#fff'
|
||||
config: 'NOTIFY.outgoing.involvedItems'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.involvedItems.description'
|
||||
- color: '#D4EDDA'
|
||||
title: 'admin-notify-dashboard.NOTIFY.outgoing.delivered'
|
||||
config: 'NOTIFY.outgoing.delivered'
|
||||
description: 'admin-notify-dashboard.NOTIFY.outgoing.delivered.description'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -21,7 +21,6 @@ import './commands';
|
||||
import 'cypress-axe';
|
||||
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
||||
|
||||
|
||||
// Runs once before all tests
|
||||
before(() => {
|
||||
// Cypress doesn't have access to the running application in Node.js.
|
||||
|
@@ -15,7 +15,10 @@ module.exports = function (config) {
|
||||
],
|
||||
client: {
|
||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||
captureConsole: false
|
||||
captureConsole: false,
|
||||
jasmine: {
|
||||
failSpecWithNoExpectations: true
|
||||
}
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, './coverage/dspace-angular'),
|
||||
|
@@ -128,7 +128,7 @@
|
||||
"react-copy-to-clipboard": "^5.1.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rxjs": "^7.8.0",
|
||||
"sanitize-html": "^2.10.0",
|
||||
"sanitize-html": "^2.12.1",
|
||||
"sortablejs": "1.15.0",
|
||||
"uuid": "^8.3.2",
|
||||
"webfontloader": "1.6.28",
|
||||
@@ -170,9 +170,12 @@
|
||||
"eslint": "^8.39.0",
|
||||
"eslint-plugin-deprecation": "^1.4.1",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-import-newlines": "^1.3.1",
|
||||
"eslint-plugin-jsdoc": "^45.0.0",
|
||||
"eslint-plugin-jsonc": "^2.6.0",
|
||||
"eslint-plugin-lodash": "^7.4.0",
|
||||
"eslint-plugin-rxjs": "^5.0.3",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"express-static-gzip": "^2.1.7",
|
||||
"jasmine-core": "^3.8.0",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||
import { getAccessControlModuleRoute } from '../app-routing-paths';
|
||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||
|
||||
export const EPERSON_PATH = 'epeople';
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AbstractControl } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
||||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
||||
@@ -47,9 +48,9 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
||||
providers: [
|
||||
{
|
||||
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||
useValue: ValidateEmailErrorStateMatcher
|
||||
useValue: ValidateEmailErrorStateMatcher,
|
||||
},
|
||||
]
|
||||
],
|
||||
})
|
||||
/**
|
||||
* This module handles all components related to the access control pages
|
||||
|
@@ -1,16 +1,22 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
|
||||
import { of } from 'rxjs';
|
||||
import { NgbAccordionModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import {
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||
import { ThemeService } from '../../../shared/theme-support/theme.service';
|
||||
import { getMockThemeService } from '../../../shared/mocks/theme-service.mock';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
@@ -49,8 +55,8 @@ describe('BulkAccessBrowseComponent', () => {
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
],
|
||||
schemas: [
|
||||
NO_ERRORS_SCHEMA
|
||||
]
|
||||
NO_ERRORS_SCHEMA,
|
||||
],
|
||||
})
|
||||
.overrideComponent(BulkAccessBrowseComponent, {
|
||||
remove: {
|
||||
@@ -96,7 +102,7 @@ describe('BulkAccessBrowseComponent', () => {
|
||||
'elementsPerPage': 5,
|
||||
'totalElements': 2,
|
||||
'totalPages': 1,
|
||||
'currentPage': 1
|
||||
'currentPage': 1,
|
||||
}), [selected1, selected2]);
|
||||
const rd = createSuccessfulRemoteDataObject(list);
|
||||
|
||||
|
@@ -1,4 +1,17 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
map,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
@@ -6,12 +19,14 @@ import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
@@ -27,6 +42,11 @@ import {
|
||||
ListableObjectComponentLoaderComponent
|
||||
} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access-browse',
|
||||
@@ -77,7 +97,7 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
paginationOptions$: BehaviorSubject<PaginationComponentOptions> = new BehaviorSubject<PaginationComponentOptions>(Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'bas',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}));
|
||||
|
||||
/**
|
||||
@@ -95,20 +115,20 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
this.subs.push(
|
||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)),
|
||||
).subscribe(this.objectsSelected$),
|
||||
);
|
||||
}
|
||||
|
||||
pageNext() {
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: this.paginationOptions$.value.currentPage + 1
|
||||
currentPage: this.paginationOptions$.value.currentPage + 1,
|
||||
}));
|
||||
}
|
||||
|
||||
pagePrev() {
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: this.paginationOptions$.value.currentPage - 1
|
||||
currentPage: this.paginationOptions$.value.currentPage - 1,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -127,12 +147,12 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
elementsPerPage: this.paginationOptions$.value.pageSize,
|
||||
totalElements: list?.selection.length,
|
||||
totalPages: this.calculatePageCount(this.paginationOptions$.value.pageSize, list?.selection.length),
|
||||
currentPage: this.paginationOptions$.value.currentPage
|
||||
currentPage: this.paginationOptions$.value.currentPage,
|
||||
});
|
||||
if (pageInfo.currentPage > pageInfo.totalPages) {
|
||||
pageInfo.currentPage = pageInfo.totalPages;
|
||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||
currentPage: pageInfo.currentPage
|
||||
currentPage: pageInfo.currentPage,
|
||||
}));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject(buildPaginatedList(pageInfo, list?.selection || []));
|
||||
|
@@ -1,21 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { BulkAccessComponent } from './bulk-access.component';
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
import { BulkAccessComponent } from './bulk-access.component';
|
||||
|
||||
describe('BulkAccessComponent', () => {
|
||||
let component: BulkAccessComponent;
|
||||
@@ -34,35 +36,35 @@ describe('BulkAccessComponent', () => {
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
'day': 31,
|
||||
},
|
||||
'endDate': null
|
||||
}
|
||||
'endDate': null,
|
||||
},
|
||||
],
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
'accessMode': 'replace',
|
||||
},
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
'selectedBitstreams': [],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const mockFile = {
|
||||
'uuids': [
|
||||
'1234', '5678'
|
||||
'1234', '5678',
|
||||
],
|
||||
'file': { }
|
||||
'file': { },
|
||||
};
|
||||
|
||||
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
getValue: jasmine.createSpy('getValue'),
|
||||
reset: jasmine.createSpy('reset')
|
||||
reset: jasmine.createSpy('reset'),
|
||||
});
|
||||
const selection: any[] = [{ indexableObject: { uuid: '1234' } }, { indexableObject: { uuid: '5678' } }];
|
||||
const selectableListState: SelectableListState = { id: 'test', selection };
|
||||
@@ -83,7 +85,7 @@ describe('BulkAccessComponent', () => {
|
||||
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BulkAccessComponent, {
|
||||
remove: {
|
||||
|
@@ -1,14 +1,23 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
map,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
|
||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component';
|
||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access',
|
||||
@@ -45,7 +54,7 @@ export class BulkAccessComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private bulkAccessControlService: BulkAccessControlService,
|
||||
private selectableListService: SelectableListService
|
||||
private selectableListService: SelectableListService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -53,8 +62,8 @@ export class BulkAccessComponent implements OnInit {
|
||||
this.subs.push(
|
||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||
distinctUntilChanged(),
|
||||
map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
|
||||
).subscribe(this.objectsSelected$)
|
||||
map((list: SelectableListState) => this.generateIdListBySelectedElements(list)),
|
||||
).subscribe(this.objectsSelected$),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,12 +91,12 @@ export class BulkAccessComponent implements OnInit {
|
||||
const { file } = this.bulkAccessControlService.createPayloadFile({
|
||||
bitstreamAccess,
|
||||
itemAccess,
|
||||
state: settings.state
|
||||
state: settings.state,
|
||||
});
|
||||
|
||||
this.bulkAccessControlService.executeScript(
|
||||
this.objectsSelected$.value || [],
|
||||
file
|
||||
file,
|
||||
).subscribe();
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,11 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
@@ -18,28 +23,28 @@ describe('BulkAccessSettingsComponent', () => {
|
||||
'startDate': {
|
||||
'year': 2026,
|
||||
'month': 5,
|
||||
'day': 31
|
||||
'day': 31,
|
||||
},
|
||||
'endDate': null
|
||||
}
|
||||
'endDate': null,
|
||||
},
|
||||
],
|
||||
'state': {
|
||||
'item': {
|
||||
'toggleStatus': true,
|
||||
'accessMode': 'replace'
|
||||
'accessMode': 'replace',
|
||||
},
|
||||
'bitstream': {
|
||||
'toggleStatus': false,
|
||||
'accessMode': '',
|
||||
'changesLimit': '',
|
||||
'selectedBitstreams': []
|
||||
}
|
||||
}
|
||||
'selectedBitstreams': [],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||
getFormValue: jasmine.createSpy('getFormValue'),
|
||||
reset: jasmine.createSpy('reset')
|
||||
reset: jasmine.createSpy('reset'),
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import {
|
||||
AccessControlFormContainerComponent
|
||||
} from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||
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';
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { Action } from '@ngrx/store';
|
||||
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { type } from '../../shared/ngrx/type';
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
|
||||
<ds-themed-loading *ngIf="searching$ | async"></ds-themed-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(searching$ | async)"
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="pageInfoState$"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{labelPrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,31 +1,61 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import {
|
||||
DebugElement,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
TestBed,
|
||||
tick,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import {
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
} from '@angular/forms';
|
||||
import {
|
||||
BrowserModule,
|
||||
By,
|
||||
} from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import {
|
||||
NgbModal,
|
||||
NgbModule,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||
import {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { EPeopleRegistryComponent } from './epeople-registry.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../shared/testing/eperson.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { getMockFormBuilderService } from '../../shared/mocks/form-builder-service.mock';
|
||||
import { getMockTranslateService } from '../../shared/mocks/translate.service.mock';
|
||||
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import {
|
||||
EPersonMock,
|
||||
EPersonMock2,
|
||||
} from '../../shared/testing/eperson.mock';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||
import { RouterStub } from '../../shared/testing/router.stub';
|
||||
import { EPeopleRegistryComponent } from './epeople-registry.component';
|
||||
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
@@ -35,17 +65,15 @@ import { RouterMock } from '../../shared/mocks/router.mock';
|
||||
describe('EPeopleRegistryComponent', () => {
|
||||
let component: EPeopleRegistryComponent;
|
||||
let fixture: ComponentFixture<EPeopleRegistryComponent>;
|
||||
let translateService: TranslateService;
|
||||
let builderService: FormBuilderService;
|
||||
|
||||
let mockEPeople;
|
||||
let mockEPeople: EPerson[];
|
||||
let ePersonDataServiceStub: any;
|
||||
let authorizationService: AuthorizationDataService;
|
||||
let modalService;
|
||||
let modalService: NgbModal;
|
||||
let paginationService: PaginationServiceStub;
|
||||
|
||||
let paginationService;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
beforeEach(waitForAsync(async () => {
|
||||
jasmine.getEnv().allowRespy(true);
|
||||
mockEPeople = [EPersonMock, EPersonMock2];
|
||||
ePersonDataServiceStub = {
|
||||
@@ -56,7 +84,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
elementsPerPage: this.allEpeople.length,
|
||||
totalElements: this.allEpeople.length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), this.allEpeople));
|
||||
},
|
||||
getActiveEPerson(): Observable<EPerson> {
|
||||
@@ -71,7 +99,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
elementsPerPage: [result].length,
|
||||
totalElements: [result].length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), [result]));
|
||||
}
|
||||
if (scope === 'metadata') {
|
||||
@@ -80,7 +108,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
elementsPerPage: this.allEpeople.length,
|
||||
totalElements: this.allEpeople.length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), this.allEpeople));
|
||||
}
|
||||
const result = this.allEpeople.find((ePerson: EPerson) => {
|
||||
@@ -90,20 +118,20 @@ describe('EPeopleRegistryComponent', () => {
|
||||
elementsPerPage: [result].length,
|
||||
totalElements: [result].length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), [result]));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||
elementsPerPage: this.allEpeople.length,
|
||||
totalElements: this.allEpeople.length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), this.allEpeople));
|
||||
},
|
||||
deleteEPerson(ePerson: EPerson): Observable<boolean> {
|
||||
this.allEpeople = this.allEpeople.filter((ePerson2: EPerson) => {
|
||||
return (ePerson2.uuid !== ePerson.uuid);
|
||||
});
|
||||
});
|
||||
return observableOf(true);
|
||||
},
|
||||
editEPerson(ePerson: EPerson) {
|
||||
@@ -117,23 +145,17 @@ describe('EPeopleRegistryComponent', () => {
|
||||
},
|
||||
getEPeoplePageRouterLink(): string {
|
||||
return '/access-control/epeople';
|
||||
}
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true)
|
||||
isAuthorized: observableOf(true),
|
||||
});
|
||||
builderService = getMockFormBuilderService();
|
||||
translateService = getMockTranslateService();
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
TestBed.configureTestingModule({
|
||||
awaitTestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
}), EPeopleRegistryComponent],
|
||||
TranslateModule.forRoot(), EPeopleRegistryComponent],
|
||||
providers: [
|
||||
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
||||
@@ -141,9 +163,9 @@ describe('EPeopleRegistryComponent', () => {
|
||||
{provide: FormBuilderService, useValue: builderService},
|
||||
{provide: Router, useValue: new RouterMock()},
|
||||
{provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
|
||||
{provide: PaginationService, useValue: paginationService}
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(EPeopleRegistryComponent, {
|
||||
remove: {
|
||||
@@ -160,7 +182,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EPeopleRegistryComponent);
|
||||
component = fixture.componentInstance;
|
||||
modalService = (component as any).modalService;
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -170,10 +192,10 @@ describe('EPeopleRegistryComponent', () => {
|
||||
});
|
||||
|
||||
it('should display list of ePeople', () => {
|
||||
const ePeopleIdsFound = fixture.debugElement.queryAll(By.css('#epeople tr td:first-child'));
|
||||
const ePeopleIdsFound: DebugElement[] = fixture.debugElement.queryAll(By.css('#epeople tr td:first-child'));
|
||||
expect(ePeopleIdsFound.length).toEqual(2);
|
||||
mockEPeople.map((ePerson: EPerson) => {
|
||||
expect(ePeopleIdsFound.find((foundEl) => {
|
||||
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === ePerson.uuid);
|
||||
})).toBeTruthy();
|
||||
});
|
||||
@@ -181,7 +203,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
describe('search', () => {
|
||||
describe('when searching with scope/query (scope metadata)', () => {
|
||||
let ePeopleIdsFound;
|
||||
let ePeopleIdsFound: DebugElement[];
|
||||
beforeEach(fakeAsync(() => {
|
||||
component.search({ scope: 'metadata', query: EPersonMock2.name });
|
||||
tick();
|
||||
@@ -191,14 +213,14 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
it('should display search result', () => {
|
||||
expect(ePeopleIdsFound.length).toEqual(1);
|
||||
expect(ePeopleIdsFound.find((foundEl) => {
|
||||
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === EPersonMock2.uuid);
|
||||
})).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when searching with scope/query (scope email)', () => {
|
||||
let ePeopleIdsFound;
|
||||
let ePeopleIdsFound: DebugElement[];
|
||||
beforeEach(fakeAsync(() => {
|
||||
component.search({ scope: 'email', query: EPersonMock.email });
|
||||
tick();
|
||||
@@ -208,7 +230,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
it('should display search result', () => {
|
||||
expect(ePeopleIdsFound.length).toEqual(1);
|
||||
expect(ePeopleIdsFound.find((foundEl) => {
|
||||
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||
return (foundEl.nativeElement.textContent.trim() === EPersonMock.uuid);
|
||||
})).toBeTruthy();
|
||||
});
|
||||
@@ -224,7 +246,7 @@ describe('EPeopleRegistryComponent', () => {
|
||||
const deleteButtons = fixture.debugElement.queryAll(By.css('.access-control-deleteEPersonButton'));
|
||||
deleteButtons[0].triggerEventHandler('click', {
|
||||
preventDefault: () => {/**/
|
||||
}
|
||||
},
|
||||
});
|
||||
tick();
|
||||
fixture.detectChanges();
|
||||
@@ -240,19 +262,12 @@ describe('EPeopleRegistryComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('delete EPerson button when the isAuthorized returns false', () => {
|
||||
let ePeopleDeleteButton;
|
||||
beforeEach(() => {
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||
component.initialisePage();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should be disabled', () => {
|
||||
ePeopleDeleteButton = fixture.debugElement.queryAll(By.css('#epeople tr td div button.delete-button'));
|
||||
ePeopleDeleteButton.forEach((deleteButton: DebugElement) => {
|
||||
expect(deleteButton.nativeElement.disabled).toBe(true);
|
||||
});
|
||||
});
|
||||
it('should hide delete EPerson button when the isAuthorized returns false', () => {
|
||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||
component.initialisePage();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(fixture.debugElement.query(By.css('#epeople tr td div button.delete-button'))).toBeNull();
|
||||
});
|
||||
});
|
||||
|
@@ -1,13 +1,44 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router, RouterModule } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
|
||||
import { map, switchMap, take } from 'rxjs/operators';
|
||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
Observable,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
switchMap,
|
||||
take,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { NoContent } from '../../core/shared/NoContent.model';
|
||||
import {
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
} from '../../core/shared/operators';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||
@@ -27,6 +58,10 @@ import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
|
||||
import {
|
||||
getEPersonEditRoute,
|
||||
getEPersonsRoute,
|
||||
} from '../access-control-routing-paths';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-epeople-registry',
|
||||
@@ -79,7 +114,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'elp',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
|
||||
// The search form
|
||||
@@ -127,7 +162,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
initialisePage() {
|
||||
this.searching$.next(true);
|
||||
this.search({scope: this.currentSearchScope, query: this.currentSearchQuery});
|
||||
this.search({ scope: this.currentSearchScope, query: this.currentSearchQuery });
|
||||
this.subs.push(this.ePeople$.pipe(
|
||||
switchMap((epeople: PaginatedList<EPerson>) => {
|
||||
if (epeople.pageInfo.totalElements > 0) {
|
||||
@@ -138,7 +173,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
epersonDtoModel.ableToDelete = authorized;
|
||||
epersonDtoModel.eperson = eperson;
|
||||
return epersonDtoModel;
|
||||
})
|
||||
}),
|
||||
);
|
||||
})).pipe(map((dtos: EpersonDtoModel[]) => {
|
||||
return buildPaginatedList(epeople.pageInfo, dtos);
|
||||
@@ -164,34 +199,34 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.findListOptionsSub = this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||
switchMap((findListOptions) => {
|
||||
const query: string = data.query;
|
||||
const scope: string = data.scope;
|
||||
if (query != null && this.currentSearchQuery !== query) {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchQuery = query;
|
||||
this.paginationService.resetPage(this.config.id);
|
||||
}
|
||||
if (scope != null && this.currentSearchScope !== scope) {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
this.currentSearchScope = scope;
|
||||
this.paginationService.resetPage(this.config.id);
|
||||
|
||||
}
|
||||
return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
|
||||
currentPage: findListOptions.currentPage,
|
||||
elementsPerPage: findListOptions.pageSize
|
||||
const query: string = data.query;
|
||||
const scope: string = data.scope;
|
||||
if (query != null && this.currentSearchQuery !== query) {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
this.currentSearchQuery = query;
|
||||
this.paginationService.resetPage(this.config.id);
|
||||
}
|
||||
if (scope != null && this.currentSearchScope !== scope) {
|
||||
void this.router.navigate([getEPersonsRoute()], {
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
this.currentSearchScope = scope;
|
||||
this.paginationService.resetPage(this.config.id);
|
||||
|
||||
}
|
||||
return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
|
||||
currentPage: findListOptions.currentPage,
|
||||
elementsPerPage: findListOptions.pageSize,
|
||||
});
|
||||
},
|
||||
),
|
||||
getAllSucceededRemoteData(),
|
||||
).subscribe((peopleRD) => {
|
||||
this.ePeople$.next(peopleRD.payload);
|
||||
this.pageInfoState$.next(peopleRD.payload.pageInfo);
|
||||
}
|
||||
this.ePeople$.next(peopleRD.payload);
|
||||
this.pageInfoState$.next(peopleRD.payload.pageInfo);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -201,7 +236,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
isActive(eperson: EPerson): Observable<boolean> {
|
||||
return this.getActiveEPerson().pipe(
|
||||
map((activeEPerson) => eperson === activeEPerson)
|
||||
map((activeEPerson) => eperson === activeEPerson),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -230,7 +265,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(ePerson.id)) {
|
||||
this.epersonService.deleteEPerson(ePerson).pipe(getFirstCompletedRemoteData()).subscribe((restResponse: RemoteData<NoContent>) => {
|
||||
if (restResponse.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', {name: this.dsoNameService.getName(ePerson)}));
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(ePerson) }));
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { id: ePerson.id, statusCode: restResponse.statusCode, errorMessage: restResponse.errorMessage }));
|
||||
}
|
||||
@@ -261,7 +296,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
||||
this.searchForm.patchValue({
|
||||
query: '',
|
||||
});
|
||||
this.search({query: ''});
|
||||
this.search({ query: '' });
|
||||
}
|
||||
|
||||
getEditEPeoplePage(id: string): string {
|
||||
|
@@ -1,6 +1,12 @@
|
||||
import { EPeopleRegistryCancelEPersonAction, EPeopleRegistryEditEPersonAction } from './epeople-registry.actions';
|
||||
import { ePeopleRegistryReducer, EPeopleRegistryState } from './epeople-registry.reducers';
|
||||
import { EPersonMock } from '../../shared/testing/eperson.mock';
|
||||
import {
|
||||
EPeopleRegistryCancelEPersonAction,
|
||||
EPeopleRegistryEditEPersonAction,
|
||||
} from './epeople-registry.actions';
|
||||
import {
|
||||
ePeopleRegistryReducer,
|
||||
EPeopleRegistryState,
|
||||
} from './epeople-registry.reducers';
|
||||
|
||||
const initialState: EPeopleRegistryState = {
|
||||
editEPerson: null,
|
||||
|
@@ -2,7 +2,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import {
|
||||
EPeopleRegistryAction,
|
||||
EPeopleRegistryActionTypes,
|
||||
EPeopleRegistryEditEPersonAction
|
||||
EPeopleRegistryEditEPersonAction,
|
||||
} from './epeople-registry.actions';
|
||||
|
||||
/**
|
||||
@@ -30,13 +30,13 @@ export function ePeopleRegistryReducer(state = initialState, action: EPeopleRegi
|
||||
|
||||
case EPeopleRegistryActionTypes.EDIT_EPERSON: {
|
||||
return Object.assign({}, state, {
|
||||
editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson
|
||||
editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson,
|
||||
});
|
||||
}
|
||||
|
||||
case EPeopleRegistryActionTypes.CANCEL_EDIT_EPERSON: {
|
||||
return Object.assign({}, state, {
|
||||
editEPerson: null
|
||||
editEPerson: null,
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div *ngIf="displayResetPassword" between class="btn-group">
|
||||
<button class="btn btn-primary" [disabled]="!(canReset$ | async)" type="button" (click)="resetPassword()">
|
||||
<button class="btn btn-primary" [disabled]="(canReset$ | async) !== true" type="button" (click)="resetPassword()">
|
||||
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
@@ -47,13 +47,13 @@
|
||||
<div *ngIf="epersonService.getActiveEPerson() | async">
|
||||
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
|
||||
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="!(groups | async)"></ds-themed-loading>
|
||||
<ds-themed-loading [showMessage]="false" *ngIf="groups$ | async | dsHasNoValue"></ds-themed-loading>
|
||||
|
||||
<ds-pagination
|
||||
*ngIf="(groups | async)?.payload?.totalElements > 0"
|
||||
*ngIf="(groups$ | async)?.payload?.totalElements > 0"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="(groups | async)?.payload"
|
||||
[collectionSize]="(groups | async)?.payload?.totalElements"
|
||||
[pageInfoState]="groupsPageInfoState$"
|
||||
[collectionSize]="(groups$ | async)?.payload?.totalElements"
|
||||
[hideGear]="true"
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
(pageChange)="onPageChange($event)">
|
||||
@@ -68,7 +68,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let group of (groups | async)?.payload?.page">
|
||||
<tr *ngFor="let group of (groups$ | async)?.payload?.page">
|
||||
<td class="align-middle">{{group.id}}</td>
|
||||
<td class="align-middle">
|
||||
<a (click)="groupsDataService.startEditingNewGroup(group)"
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(groups | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div *ngIf="(groups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
|
||||
<div>
|
||||
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
|
||||
|
@@ -1,28 +1,61 @@
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,} from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import {
|
||||
BrowserModule,
|
||||
By,
|
||||
} from '@angular/platform-browser';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import {
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { EPersonFormComponent } from './eperson-form.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||
import { AuthServiceStub } from '../../../shared/testing/auth-service.stub';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import {
|
||||
EPersonMock,
|
||||
EPersonMock2,
|
||||
} from '../../../shared/testing/eperson.mock';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
@@ -34,6 +67,10 @@ import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.c
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { FormComponent } from '../../../shared/form/form.component';
|
||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||
import { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe';
|
||||
import { EPeopleRegistryComponent } from '../epeople-registry.component';
|
||||
import { EPersonFormComponent } from './eperson-form.component';
|
||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -117,70 +154,70 @@ describe('EPersonFormComponent', () => {
|
||||
},
|
||||
findById(_id: string, _useCachedVersionIfAvailable = true, _reRequestOnStale = true, ..._linksToFollow: FollowLinkConfig<EPerson>[]): Observable<RemoteData<EPerson>> {
|
||||
return createSuccessfulRemoteDataObject$(null);
|
||||
}
|
||||
},
|
||||
};
|
||||
builderService = Object.assign(getMockFormBuilderService(),{
|
||||
createFormGroup(formModel, options = null) {
|
||||
const controls = {};
|
||||
formModel.forEach( model => {
|
||||
model.parent = parent;
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
model.parent = parent;
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null,
|
||||
validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null,
|
||||
};
|
||||
},
|
||||
getValidators(validatorsConfig) {
|
||||
return this.getValidatorFns(validatorsConfig);
|
||||
return this.getValidatorFns(validatorsConfig);
|
||||
},
|
||||
getValidatorFns(validatorsConfig, validatorsToken = this._NG_VALIDATORS) {
|
||||
let validatorFns = [];
|
||||
if (this.isObject(validatorsConfig)) {
|
||||
validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => {
|
||||
const validatorConfigValue = validatorsConfig[validatorConfigKey];
|
||||
if (this.isValidatorDescriptor(validatorConfigValue)) {
|
||||
const descriptor = validatorConfigValue;
|
||||
return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken);
|
||||
}
|
||||
return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken);
|
||||
});
|
||||
validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => {
|
||||
const validatorConfigValue = validatorsConfig[validatorConfigKey];
|
||||
if (this.isValidatorDescriptor(validatorConfigValue)) {
|
||||
const descriptor = validatorConfigValue;
|
||||
return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken);
|
||||
}
|
||||
return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken);
|
||||
});
|
||||
}
|
||||
return validatorFns;
|
||||
},
|
||||
getValidatorFn(validatorName, validatorArgs = null, validatorsToken = this._NG_VALIDATORS) {
|
||||
let validatorFn;
|
||||
if (Validators.hasOwnProperty(validatorName)) { // Built-in Angular Validators
|
||||
validatorFn = Validators[validatorName];
|
||||
validatorFn = Validators[validatorName];
|
||||
} else { // Custom Validators
|
||||
if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) {
|
||||
validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName);
|
||||
} else if (validatorsToken) {
|
||||
validatorFn = validatorsToken.find(validator => validator.name === validatorName);
|
||||
}
|
||||
if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) {
|
||||
validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName);
|
||||
} else if (validatorsToken) {
|
||||
validatorFn = validatorsToken.find(validator => validator.name === validatorName);
|
||||
}
|
||||
}
|
||||
if (validatorFn === undefined) { // throw when no validator could be resolved
|
||||
throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`);
|
||||
throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`);
|
||||
}
|
||||
if (validatorArgs !== null) {
|
||||
return validatorFn(validatorArgs);
|
||||
return validatorFn(validatorArgs);
|
||||
}
|
||||
return validatorFn;
|
||||
},
|
||||
},
|
||||
isValidatorDescriptor(value) {
|
||||
if (this.isObject(value)) {
|
||||
return value.hasOwnProperty('name') && value.hasOwnProperty('args');
|
||||
}
|
||||
return false;
|
||||
if (this.isObject(value)) {
|
||||
return value.hasOwnProperty('name') && value.hasOwnProperty('args');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isObject(value) {
|
||||
return typeof value === 'object' && value !== null;
|
||||
}
|
||||
},
|
||||
});
|
||||
authService = new AuthServiceStub();
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
@@ -189,7 +226,7 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
groupsDataService = jasmine.createSpyObj('groupsDataService', {
|
||||
findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||
getGroupRegistryRouterLink: ''
|
||||
getGroupRegistryRouterLink: '',
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -200,9 +237,12 @@ describe('EPersonFormComponent', () => {
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
}), EPersonFormComponent],
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}),
|
||||
EPersonFormComponent,
|
||||
HasNoValuePipe,
|
||||
],
|
||||
providers: [
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataService },
|
||||
@@ -214,9 +254,10 @@ describe('EPersonFormComponent', () => {
|
||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
|
||||
{ provide: ActivatedRoute, useValue: route },
|
||||
{ provide: Router, useValue: router }
|
||||
{ provide: Router, useValue: router },
|
||||
EPeopleRegistryComponent,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(EPersonFormComponent, {
|
||||
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]}
|
||||
@@ -225,7 +266,7 @@ describe('EPersonFormComponent', () => {
|
||||
}));
|
||||
|
||||
epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', {
|
||||
registerEmail: createSuccessfulRemoteDataObject$(null)
|
||||
registerEmail: createSuccessfulRemoteDataObject$(null),
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -257,12 +298,12 @@ describe('EPersonFormComponent', () => {
|
||||
metadata: {
|
||||
'eperson.firstname': [
|
||||
{
|
||||
value: firstName
|
||||
}
|
||||
value: firstName,
|
||||
},
|
||||
],
|
||||
'eperson.lastname': [
|
||||
{
|
||||
value: lastName
|
||||
value: lastName,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -301,16 +342,16 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('firstName should be valid because the firstName is set', () => {
|
||||
expect(component.formGroup.controls.firstName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.firstName.errors).toBeNull();
|
||||
expect(component.formGroup.controls.firstName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.firstName.errors).toBeNull();
|
||||
});
|
||||
it('lastName should be valid because the lastName is set', () => {
|
||||
expect(component.formGroup.controls.lastName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.lastName.errors).toBeNull();
|
||||
expect(component.formGroup.controls.lastName.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.lastName.errors).toBeNull();
|
||||
});
|
||||
it('email should be valid because the email is set', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.email.errors).toBeNull();
|
||||
expect(component.formGroup.controls.email.valid).toBeTrue();
|
||||
expect(component.formGroup.controls.email.errors).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -321,8 +362,8 @@ describe('EPersonFormComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
it('email should not be valid because the email pattern', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.pattern).toBeTruthy();
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.pattern).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -331,7 +372,7 @@ describe('EPersonFormComponent', () => {
|
||||
const ePersonServiceWithEperson = Object.assign(ePersonDataServiceStub,{
|
||||
getEPersonByEmail(): Observable<RemoteData<EPerson>> {
|
||||
return createSuccessfulRemoteDataObject$(EPersonMock);
|
||||
}
|
||||
},
|
||||
});
|
||||
component.formGroup.controls.email.setValue('test@test.com');
|
||||
component.formGroup.controls.email.setAsyncValidators(ValidateEmailNotTaken.createValidator(ePersonServiceWithEperson));
|
||||
@@ -339,8 +380,8 @@ describe('EPersonFormComponent', () => {
|
||||
});
|
||||
|
||||
it('email should not be valid because email is already taken', () => {
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.emailTaken).toBeTruthy();
|
||||
expect(component.formGroup.controls.email.valid).toBeFalse();
|
||||
expect(component.formGroup.controls.email.errors.emailTaken).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -366,12 +407,12 @@ describe('EPersonFormComponent', () => {
|
||||
metadata: {
|
||||
'eperson.firstname': [
|
||||
{
|
||||
value: firstName
|
||||
}
|
||||
value: firstName,
|
||||
},
|
||||
],
|
||||
'eperson.lastname': [
|
||||
{
|
||||
value: lastName
|
||||
value: lastName,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -407,19 +448,19 @@ describe('EPersonFormComponent', () => {
|
||||
metadata: {
|
||||
'eperson.firstname': [
|
||||
{
|
||||
value: firstName
|
||||
}
|
||||
value: firstName,
|
||||
},
|
||||
],
|
||||
'eperson.lastname': [
|
||||
{
|
||||
value: lastName
|
||||
value: lastName,
|
||||
},
|
||||
],
|
||||
},
|
||||
email: email,
|
||||
canLogIn: canLogIn,
|
||||
requireCertificate: requireCertificate,
|
||||
_links: undefined
|
||||
_links: undefined,
|
||||
});
|
||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
|
||||
component.onSubmit();
|
||||
@@ -439,7 +480,7 @@ describe('EPersonFormComponent', () => {
|
||||
spyOn(authService, 'impersonate').and.callThrough();
|
||||
ePersonId = 'testEPersonId';
|
||||
component.epersonInitial = Object.assign(new EPerson(), {
|
||||
id: ePersonId
|
||||
id: ePersonId,
|
||||
});
|
||||
component.impersonate();
|
||||
});
|
||||
@@ -527,7 +568,7 @@ describe('EPersonFormComponent', () => {
|
||||
ePersonEmail = 'person.email@4science.it';
|
||||
component.epersonInitial = Object.assign(new EPerson(), {
|
||||
id: ePersonId,
|
||||
email: ePersonEmail
|
||||
email: ePersonEmail,
|
||||
});
|
||||
component.resetPassword();
|
||||
});
|
||||
|
@@ -1,37 +1,65 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
EventEmitter,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
DynamicCheckboxModel,
|
||||
DynamicFormControlModel,
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel
|
||||
DynamicInputModel,
|
||||
} from '@ng-dynamic-forms/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 {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
debounceTime,
|
||||
finalize,
|
||||
map,
|
||||
switchMap,
|
||||
take,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||
import { Group } from '../../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import {
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstSucceededRemoteData,
|
||||
getRemoteDataPayload
|
||||
getRemoteDataPayload,
|
||||
} from '../../../core/shared/operators';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { Registration } from '../../../core/shared/registration.model';
|
||||
import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
|
||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import { Registration } from '../../../core/shared/registration.model';
|
||||
@@ -44,6 +72,7 @@ import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.c
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-eperson-form',
|
||||
@@ -98,28 +127,28 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
formLayout: DynamicFormLayout = {
|
||||
firstName: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
lastName: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
email: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
canLogIn: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-sm-6 d-inline-block',
|
||||
},
|
||||
},
|
||||
requireCertificate: {
|
||||
grid: {
|
||||
host: 'col col-sm-6 d-inline-block'
|
||||
}
|
||||
host: 'col col-sm-6 d-inline-block',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -162,7 +191,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
/**
|
||||
* A list of all the groups this EPerson is a member of
|
||||
*/
|
||||
groups: Observable<RemoteData<PaginatedList<Group>>>;
|
||||
groups$: Observable<RemoteData<PaginatedList<Group>>>;
|
||||
|
||||
/**
|
||||
* The pagination of the {@link groups$} list.
|
||||
*/
|
||||
groupsPageInfoState$: Observable<PageInfo>;
|
||||
|
||||
/**
|
||||
* Pagination config used to display the list of groups
|
||||
@@ -170,7 +204,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'gem',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -272,23 +306,23 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
required: true,
|
||||
errorMessages: {
|
||||
emailTaken: 'error.validation.emailTaken',
|
||||
pattern: 'error.validation.NotValidEmail'
|
||||
pattern: 'error.validation.NotValidEmail',
|
||||
},
|
||||
hint: emailHint
|
||||
hint: emailHint,
|
||||
});
|
||||
this.canLogIn = new DynamicCheckboxModel(
|
||||
{
|
||||
id: 'canLogIn',
|
||||
label: canLogIn,
|
||||
name: 'canLogIn',
|
||||
value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true)
|
||||
value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true),
|
||||
});
|
||||
this.requireCertificate = new DynamicCheckboxModel(
|
||||
{
|
||||
id: 'requireCertificate',
|
||||
label: requireCertificate,
|
||||
name: 'requireCertificate',
|
||||
value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false)
|
||||
value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false),
|
||||
});
|
||||
this.formModel = [
|
||||
this.firstName,
|
||||
@@ -300,9 +334,9 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
|
||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
||||
if (eperson != null) {
|
||||
this.groups = this.groupsDataService.findListByHref(eperson._links.groups.href, {
|
||||
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: this.config.pageSize
|
||||
elementsPerPage: this.config.pageSize,
|
||||
});
|
||||
}
|
||||
this.formGroup.patchValue({
|
||||
@@ -310,7 +344,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '',
|
||||
email: eperson != null ? eperson.email : '',
|
||||
canLogIn: eperson != null ? eperson.canLogIn : true,
|
||||
requireCertificate: eperson != null ? eperson.requireCertificate : false
|
||||
requireCertificate: eperson != null ? eperson.requireCertificate : false,
|
||||
});
|
||||
|
||||
if (eperson === null && !!this.formGroup.controls.email) {
|
||||
@@ -323,11 +357,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
const activeEPerson$ = this.epersonService.getActiveEPerson();
|
||||
|
||||
this.groups = activeEPerson$.pipe(
|
||||
this.groups$ = activeEPerson$.pipe(
|
||||
switchMap((eperson) => {
|
||||
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: this.config.pageSize
|
||||
elementsPerPage: this.config.pageSize,
|
||||
})]);
|
||||
}),
|
||||
switchMap(([eperson, findListOptions]) => {
|
||||
@@ -335,7 +369,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
return this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
|
||||
}
|
||||
return observableOf(undefined);
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
this.groupsPageInfoState$ = this.groups$.pipe(
|
||||
map(groupsRD => groupsRD.payload.pageInfo),
|
||||
);
|
||||
|
||||
this.canImpersonate$ = activeEPerson$.pipe(
|
||||
@@ -345,10 +383,10 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
return observableOf(false);
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
this.canDelete$ = activeEPerson$.pipe(
|
||||
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined))
|
||||
switchMap((eperson) => this.authorizationService.isAuthorized(FeatureID.CanDelete, hasValue(eperson) ? eperson.self : undefined)),
|
||||
);
|
||||
this.canReset$ = observableOf(true);
|
||||
});
|
||||
@@ -376,12 +414,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
metadata: {
|
||||
'eperson.firstname': [
|
||||
{
|
||||
value: this.firstName.value
|
||||
}
|
||||
value: this.firstName.value,
|
||||
},
|
||||
],
|
||||
'eperson.lastname': [
|
||||
{
|
||||
value: this.lastName.value
|
||||
value: this.lastName.value,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -394,7 +432,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
this.editEPerson(ePerson, values);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -407,7 +445,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
const response = this.epersonService.create(ePersonToCreate);
|
||||
response.pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((rd: RemoteData<EPerson>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.created.success', { name: this.dsoNameService.getName(ePersonToCreate) }));
|
||||
@@ -433,12 +471,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
metadata: {
|
||||
'eperson.firstname': [
|
||||
{
|
||||
value: (this.firstName.value ? this.firstName.value : ePerson.firstMetadataValue('eperson.firstname'))
|
||||
}
|
||||
value: (this.firstName.value ? this.firstName.value : ePerson.firstMetadataValue('eperson.firstname')),
|
||||
},
|
||||
],
|
||||
'eperson.lastname': [
|
||||
{
|
||||
value: (this.lastName.value ? this.lastName.value : ePerson.firstMetadataValue('eperson.lastname'))
|
||||
value: (this.lastName.value ? this.lastName.value : ePerson.firstMetadataValue('eperson.lastname')),
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -472,7 +510,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
onPageChange(event) {
|
||||
this.updateGroups({
|
||||
currentPage: event,
|
||||
elementsPerPage: this.config.pageSize
|
||||
elementsPerPage: this.config.pageSize,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -508,15 +546,15 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
this.canDelete$ = observableOf(false);
|
||||
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson }))
|
||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
|
||||
);
|
||||
} else {
|
||||
return observableOf(null);
|
||||
}
|
||||
}),
|
||||
finalize(() => this.canDelete$ = observableOf(true))
|
||||
finalize(() => this.canDelete$ = observableOf(true)),
|
||||
);
|
||||
})
|
||||
}),
|
||||
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||
if (restResponse?.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { name: this.dsoNameService.getName(eperson) }));
|
||||
@@ -544,14 +582,14 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
if (hasValue(this.epersonInitial.email)) {
|
||||
this.epersonRegistrationService.registerEmail(this.epersonInitial.email, null, TYPE_REQUEST_FORGOT).pipe(getFirstCompletedRemoteData())
|
||||
.subscribe((response: RemoteData<Registration>) => {
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'),
|
||||
this.translateService.get('forgot-email.form.success.content', {email: this.epersonInitial.email}));
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'),
|
||||
this.translateService.get('forgot-email.form.error.content', {email: this.epersonInitial.email}));
|
||||
}
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get('admin.access-control.epeople.actions.reset'),
|
||||
this.translateService.get('forgot-email.form.success.content', { email: this.epersonInitial.email }));
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'),
|
||||
this.translateService.get('forgot-email.form.error.content', { email: this.epersonInitial.email }));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -577,13 +615,13 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
// Relevant message for email in use
|
||||
this.subs.push(this.epersonService.searchByScope('email', ePerson.email, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 0
|
||||
elementsPerPage: 0,
|
||||
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
||||
.subscribe((list: PaginatedList<EPerson>) => {
|
||||
if (list.totalElements > 0) {
|
||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.' + notificationSection + '.failure.emailInUse', {
|
||||
name: this.dsoNameService.getName(ePerson),
|
||||
email: ePerson.email
|
||||
email: ePerson.email,
|
||||
}));
|
||||
}
|
||||
}));
|
||||
@@ -594,7 +632,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
private updateGroups(options) {
|
||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
||||
this.groups = this.groupsDataService.findListByHref(eperson._links.groups.href, options);
|
||||
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, options);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,12 @@
|
||||
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
ValidationErrors,
|
||||
} from '@angular/forms';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||
import { getFirstSucceededRemoteData, } from '../../../../core/shared/operators';
|
||||
import { getFirstSucceededRemoteData } from '../../../../core/shared/operators';
|
||||
|
||||
export class ValidateEmailNotTaken {
|
||||
|
||||
@@ -17,8 +20,8 @@ export class ValidateEmailNotTaken {
|
||||
.pipe(
|
||||
getFirstSucceededRemoteData(),
|
||||
map(res => {
|
||||
return !!res.payload ? { emailTaken: true } : null;
|
||||
})
|
||||
return res.payload ? { emailTaken: true } : null;
|
||||
}),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
@@ -1,13 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { ResolvedAction } from '../../core/resolving/resolver.actions';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { ResolvedAction } from '../../core/resolving/resolver.actions';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import {
|
||||
followLink,
|
||||
FollowLinkConfig,
|
||||
} from '../../shared/utils/follow-link-config.model';
|
||||
|
||||
export const EPERSON_EDIT_FOLLOW_LINKS: FollowLinkConfig<EPerson>[] = [
|
||||
followLink('groups'),
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertTypeEnum.Warning"
|
||||
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
|
||||
<ds-alert *ngIf="!(canEdit$ | async) && (groupDataService.getActiveGroup() | async)" [type]="AlertTypeEnum.Warning"
|
||||
<ds-alert *ngIf="(canEdit$ | async) !== true && (groupDataService.getActiveGroup() | async)" [type]="AlertTypeEnum.Warning"
|
||||
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName((getLinkedDSO(groupBeingEdited) | async)?.payload), comcol: (getLinkedDSO(groupBeingEdited) | async)?.payload?.type, comcolEditRolesRoute: (getLinkedEditRolesRoute(groupBeingEdited) | async) })">
|
||||
</ds-alert>
|
||||
|
||||
@@ -47,10 +47,10 @@
|
||||
</ds-form>
|
||||
|
||||
<div class="mb-5">
|
||||
<ds-members-list *ngIf="groupBeingEdited != null"
|
||||
<ds-members-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
||||
</div>
|
||||
<ds-subgroups-list *ngIf="groupBeingEdited != null"
|
||||
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
||||
|
||||
|
||||
|
@@ -1,43 +1,44 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators, } from '@angular/forms';
|
||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router, } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { Observable, of as observableOf, } from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service';
|
||||
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { Group } from '../../../core/eperson/models/group.model';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { UUIDService } from '../../../core/shared/uuid.service';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { GroupMock, GroupMock2 } from '../../../shared/testing/group-mock';
|
||||
import { GroupFormComponent } from './group-form.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
|
||||
import { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock';
|
||||
import { RouterMock } from '../../../shared/mocks/router.mock';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { GroupMock, GroupMock2, } from '../../../shared/testing/group-mock';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock';
|
||||
import { GroupFormComponent } from './group-form.component';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
import { FormComponent } from '../../../shared/form/form.component';
|
||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||
@@ -70,8 +71,8 @@ describe('GroupFormComponent', () => {
|
||||
metadata: {
|
||||
'dc.description': [
|
||||
{
|
||||
value: groupDescription
|
||||
}
|
||||
value: groupDescription,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
@@ -110,7 +111,7 @@ describe('GroupFormComponent', () => {
|
||||
create(group: Group): Observable<RemoteData<Group>> {
|
||||
this.allGroups = [...this.allGroups, group];
|
||||
this.createdGroup = Object.assign({}, group, {
|
||||
_links: { self: { href: 'group-selflink' } }
|
||||
_links: { self: { href: 'group-selflink' } },
|
||||
});
|
||||
return createSuccessfulRemoteDataObject$(this.createdGroup);
|
||||
},
|
||||
@@ -119,78 +120,78 @@ describe('GroupFormComponent', () => {
|
||||
},
|
||||
getGroupEditPageRouterLinkWithID(id: string) {
|
||||
return `group-edit-page-for-${id}`;
|
||||
}
|
||||
},
|
||||
};
|
||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||
isAuthorized: observableOf(true)
|
||||
isAuthorized: observableOf(true),
|
||||
});
|
||||
dsoDataServiceStub = {
|
||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
};
|
||||
builderService = Object.assign(getMockFormBuilderService(),{
|
||||
createFormGroup(formModel, options = null) {
|
||||
const controls = {};
|
||||
formModel.forEach( model => {
|
||||
model.parent = parent;
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
model.parent = parent;
|
||||
const controlModel = model;
|
||||
const controlState = { value: controlModel.value, disabled: controlModel.disabled };
|
||||
const controlOptions = this.createAbstractControlOptions(controlModel.validators, controlModel.asyncValidators, controlModel.updateOn);
|
||||
controls[model.id] = new UntypedFormControl(controlState, controlOptions);
|
||||
});
|
||||
return new UntypedFormGroup(controls, options);
|
||||
},
|
||||
createAbstractControlOptions(validatorsConfig = null, asyncValidatorsConfig = null, updateOn = null) {
|
||||
return {
|
||||
validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null,
|
||||
validators: validatorsConfig !== null ? this.getValidators(validatorsConfig) : null,
|
||||
};
|
||||
},
|
||||
getValidators(validatorsConfig) {
|
||||
return this.getValidatorFns(validatorsConfig);
|
||||
return this.getValidatorFns(validatorsConfig);
|
||||
},
|
||||
getValidatorFns(validatorsConfig, validatorsToken = this._NG_VALIDATORS) {
|
||||
let validatorFns = [];
|
||||
if (this.isObject(validatorsConfig)) {
|
||||
validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => {
|
||||
const validatorConfigValue = validatorsConfig[validatorConfigKey];
|
||||
if (this.isValidatorDescriptor(validatorConfigValue)) {
|
||||
const descriptor = validatorConfigValue;
|
||||
return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken);
|
||||
}
|
||||
return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken);
|
||||
});
|
||||
validatorFns = Object.keys(validatorsConfig).map(validatorConfigKey => {
|
||||
const validatorConfigValue = validatorsConfig[validatorConfigKey];
|
||||
if (this.isValidatorDescriptor(validatorConfigValue)) {
|
||||
const descriptor = validatorConfigValue;
|
||||
return this.getValidatorFn(descriptor.name, descriptor.args, validatorsToken);
|
||||
}
|
||||
return this.getValidatorFn(validatorConfigKey, validatorConfigValue, validatorsToken);
|
||||
});
|
||||
}
|
||||
return validatorFns;
|
||||
},
|
||||
getValidatorFn(validatorName, validatorArgs = null, validatorsToken = this._NG_VALIDATORS) {
|
||||
let validatorFn;
|
||||
if (Validators.hasOwnProperty(validatorName)) { // Built-in Angular Validators
|
||||
validatorFn = Validators[validatorName];
|
||||
validatorFn = Validators[validatorName];
|
||||
} else { // Custom Validators
|
||||
if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) {
|
||||
validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName);
|
||||
} else if (validatorsToken) {
|
||||
validatorFn = validatorsToken.find(validator => validator.name === validatorName);
|
||||
}
|
||||
if (this._DYNAMIC_VALIDATORS && this._DYNAMIC_VALIDATORS.has(validatorName)) {
|
||||
validatorFn = this._DYNAMIC_VALIDATORS.get(validatorName);
|
||||
} else if (validatorsToken) {
|
||||
validatorFn = validatorsToken.find(validator => validator.name === validatorName);
|
||||
}
|
||||
}
|
||||
if (validatorFn === undefined) { // throw when no validator could be resolved
|
||||
throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`);
|
||||
throw new Error(`validator '${validatorName}' is not provided via NG_VALIDATORS, NG_ASYNC_VALIDATORS or DYNAMIC_FORM_VALIDATORS`);
|
||||
}
|
||||
if (validatorArgs !== null) {
|
||||
return validatorFn(validatorArgs);
|
||||
return validatorFn(validatorArgs);
|
||||
}
|
||||
return validatorFn;
|
||||
},
|
||||
},
|
||||
isValidatorDescriptor(value) {
|
||||
if (this.isObject(value)) {
|
||||
return value.hasOwnProperty('name') && value.hasOwnProperty('args');
|
||||
}
|
||||
return false;
|
||||
if (this.isObject(value)) {
|
||||
return value.hasOwnProperty('name') && value.hasOwnProperty('args');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isObject(value) {
|
||||
return typeof value === 'object' && value !== null;
|
||||
}
|
||||
},
|
||||
});
|
||||
translateService = getMockTranslateService();
|
||||
router = new RouterMock();
|
||||
@@ -200,8 +201,8 @@ describe('GroupFormComponent', () => {
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), GroupFormComponent],
|
||||
providers: [
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
@@ -219,12 +220,12 @@ describe('GroupFormComponent', () => {
|
||||
{ provide: HALEndpointService, useValue: {} },
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) }
|
||||
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) },
|
||||
},
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(GroupFormComponent, {
|
||||
remove: { imports: [
|
||||
@@ -270,8 +271,8 @@ describe('GroupFormComponent', () => {
|
||||
metadata: {
|
||||
'dc.description': [
|
||||
{
|
||||
value: groupDescription
|
||||
}
|
||||
value: groupDescription,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
@@ -286,11 +287,11 @@ describe('GroupFormComponent', () => {
|
||||
const operations = [{
|
||||
op: 'add',
|
||||
path: '/metadata/dc.description',
|
||||
value: 'testDescription'
|
||||
value: 'testDescription',
|
||||
}, {
|
||||
op: 'replace',
|
||||
path: '/name',
|
||||
value: 'newGroupName'
|
||||
value: 'newGroupName',
|
||||
}];
|
||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||
});
|
||||
@@ -302,7 +303,7 @@ describe('GroupFormComponent', () => {
|
||||
const operations = [{
|
||||
op: 'add',
|
||||
path: '/metadata/dc.description',
|
||||
value: 'testDescription'
|
||||
value: 'testDescription',
|
||||
}];
|
||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||
});
|
||||
@@ -314,7 +315,7 @@ describe('GroupFormComponent', () => {
|
||||
const operations = [{
|
||||
op: 'replace',
|
||||
path: '/name',
|
||||
value: 'newGroupName'
|
||||
value: 'newGroupName',
|
||||
}];
|
||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||
});
|
||||
@@ -351,8 +352,8 @@ describe('GroupFormComponent', () => {
|
||||
metadata: {
|
||||
'dc.description': [
|
||||
{
|
||||
value: groupDescription
|
||||
}
|
||||
value: groupDescription,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
@@ -389,7 +390,7 @@ describe('GroupFormComponent', () => {
|
||||
const groupsDataServiceStubWithGroup = Object.assign(groupsDataServiceStub,{
|
||||
searchGroups(query: string): Observable<RemoteData<PaginatedList<Group>>> {
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [expected]));
|
||||
}
|
||||
},
|
||||
});
|
||||
component.formGroup.controls.groupName.setValue('testName');
|
||||
component.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(groupsDataServiceStubWithGroup));
|
||||
@@ -413,7 +414,7 @@ describe('GroupFormComponent', () => {
|
||||
|
||||
component.canEdit$ = observableOf(true);
|
||||
component.groupBeingEdited = {
|
||||
permanent: false
|
||||
permanent: false,
|
||||
} as Group;
|
||||
|
||||
fixture.detectChanges();
|
||||
|
@@ -1,23 +1,22 @@
|
||||
import { Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, ChangeDetectorRef } from '@angular/core';
|
||||
import { ChangeDetectorRef, Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, } from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router, } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel,
|
||||
DynamicTextAreaModel
|
||||
DynamicTextAreaModel,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import { catchError, map, switchMap, take, filter, debounceTime } from 'rxjs/operators';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription, } from 'rxjs';
|
||||
import { catchError, debounceTime, filter, map, switchMap, take, } from 'rxjs/operators';
|
||||
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
||||
import { getCommunityEditRolesRoute } from '../../../community-page/community-page-routing-paths';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||
@@ -30,30 +29,27 @@ import { Group } from '../../../core/eperson/models/group.model';
|
||||
import { Collection } from '../../../core/shared/collection.model';
|
||||
import { Community } from '../../../core/shared/community.model';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import {
|
||||
getRemoteDataPayload,
|
||||
getFirstSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstSucceededRemoteDataPayload
|
||||
getFirstSucceededRemoteData,
|
||||
getFirstSucceededRemoteDataPayload,
|
||||
getRemoteDataPayload,
|
||||
} from '../../../core/shared/operators';
|
||||
import { AlertType } from '../../../shared/alert/alert-type';
|
||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import { hasValue, isNotEmpty, hasValueOperator } from '../../../shared/empty.util';
|
||||
import { hasValue, hasValueOperator, isNotEmpty, } from '../../../shared/empty.util';
|
||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { getGroupEditRoute, getGroupsRoute, } from '../../access-control-routing-paths';
|
||||
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';
|
||||
import { getGroupEditRoute, getGroupsRoute } from '../../access-control-routing-paths';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-group-form',
|
||||
@@ -100,13 +96,13 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
formLayout: DynamicFormLayout = {
|
||||
groupName: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
groupDescription: {
|
||||
grid: {
|
||||
host: 'row'
|
||||
}
|
||||
host: 'row',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -193,7 +189,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
observableCombineLatest([
|
||||
this.translateService.get(`${this.messagePrefix}.groupName`),
|
||||
this.translateService.get(`${this.messagePrefix}.groupCommunity`),
|
||||
this.translateService.get(`${this.messagePrefix}.groupDescription`)
|
||||
this.translateService.get(`${this.messagePrefix}.groupDescription`),
|
||||
]).subscribe(([groupName, groupCommunity, groupDescription]) => {
|
||||
this.groupName = new DynamicInputModel({
|
||||
id: 'groupName',
|
||||
@@ -224,7 +220,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
];
|
||||
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
|
||||
|
||||
if (!!this.formGroup.controls.groupName) {
|
||||
if (this.formGroup.controls.groupName) {
|
||||
this.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(this.groupDataService));
|
||||
this.groupNameValueChangeSubscribe = this.groupName.valueChanges.pipe(debounceTime(300)).subscribe(() => {
|
||||
this.changeDetectorRef.detectChanges();
|
||||
@@ -236,7 +232,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
this.groupDataService.getActiveGroup(),
|
||||
this.canEdit$,
|
||||
this.groupDataService.getActiveGroup()
|
||||
.pipe(filter((activeGroup) => hasValue(activeGroup)),switchMap((activeGroup) => this.getLinkedDSO(activeGroup).pipe(getFirstSucceededRemoteDataPayload())))
|
||||
.pipe(filter((activeGroup) => hasValue(activeGroup)),switchMap((activeGroup) => this.getLinkedDSO(activeGroup).pipe(getFirstSucceededRemoteDataPayload()))),
|
||||
]).subscribe(([activeGroup, canEdit, linkedObject]) => {
|
||||
|
||||
if (activeGroup != null) {
|
||||
@@ -271,7 +267,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -299,9 +295,9 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
metadata: {
|
||||
'dc.description': [
|
||||
{
|
||||
value: this.groupDescription.value
|
||||
}
|
||||
]
|
||||
value: this.groupDescription.value,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
if (group === null) {
|
||||
@@ -309,7 +305,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
} else {
|
||||
this.editGroup(group);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -320,7 +316,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
createNewGroup(values) {
|
||||
const groupToCreate = Object.assign(new Group(), values);
|
||||
this.groupDataService.create(groupToCreate).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((rd: RemoteData<Group>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.created.success', { name: groupToCreate.name }));
|
||||
@@ -349,7 +345,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
// Relevant message for group name in use
|
||||
this.subs.push(this.groupDataService.searchGroups(group.name, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 0
|
||||
elementsPerPage: 0,
|
||||
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
||||
.subscribe((list: PaginatedList<Group>) => {
|
||||
if (list.totalElements > 0) {
|
||||
@@ -371,7 +367,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
operations = [...operations, {
|
||||
op: 'add',
|
||||
path: '/metadata/dc.description',
|
||||
value: this.groupDescription.value
|
||||
value: this.groupDescription.value,
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -379,12 +375,12 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
operations = [...operations, {
|
||||
op: 'replace',
|
||||
path: '/name',
|
||||
value: this.groupName.value
|
||||
value: this.groupName.value,
|
||||
}];
|
||||
}
|
||||
|
||||
this.groupDataService.patch(group, operations).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((rd: RemoteData<Group>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: this.dsoNameService.getName(rd.payload) }));
|
||||
@@ -523,7 +519,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
||||
return getCollectionEditRolesRoute(rd.payload.id);
|
||||
}
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleMembersOfGroup | async) == undefined || (ePeopleMembersOfGroup | async)?.totalElements == 0" class="alert alert-info w-100 mb-2"
|
||||
<div *ngIf="(ePeopleMembersOfGroup | async) === undefined || (ePeopleMembersOfGroup | async)?.totalElements === 0" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-members-yet' | translate}}
|
||||
</div>
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(ePeopleSearch | async)?.totalElements == 0 && searchDone"
|
||||
<div *ngIf="(ePeopleSearch | async)?.totalElements === 0 && searchDone"
|
||||
class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
|
@@ -1,38 +1,41 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf, } from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { RestResponse } from '../../../../core/cache/response.models';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { GroupMock } from '../../../../shared/testing/group-mock';
|
||||
import { MembersListComponent } from './members-list.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../../../shared/testing/eperson.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
import { EPersonMock, EPersonMock2, } from '../../../../shared/testing/eperson.mock';
|
||||
import { GroupMock } from '../../../../shared/testing/group-mock';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||
import { MembersListComponent } from './members-list.component';
|
||||
|
||||
// todo: optimize imports
|
||||
|
||||
describe('MembersListComponent', () => {
|
||||
let component: MembersListComponent;
|
||||
@@ -112,7 +115,7 @@ describe('MembersListComponent', () => {
|
||||
// Add eperson to list of non-members
|
||||
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||
}
|
||||
},
|
||||
};
|
||||
builderService = getMockFormBuilderService();
|
||||
translateService = getMockTranslateService();
|
||||
@@ -123,8 +126,8 @@ describe('MembersListComponent', () => {
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), MembersListComponent],
|
||||
providers: [MembersListComponent,
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
@@ -136,7 +139,7 @@ describe('MembersListComponent', () => {
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(MembersListComponent, {
|
||||
remove: {
|
||||
|
@@ -4,26 +4,29 @@ import { Router, RouterLink } from '@angular/router';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
||||
import { map, switchMap, take } from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import {
|
||||
getAllCompletedRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getRemoteDataPayload
|
||||
getRemoteDataPayload,
|
||||
} from '../../../../core/shared/operators';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.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';
|
||||
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
||||
|
||||
// todo: optimize imports
|
||||
|
||||
/**
|
||||
* Keys to keep track of specific subscriptions
|
||||
*/
|
||||
@@ -84,21 +87,21 @@ export interface EPersonListActionConfig {
|
||||
export class MembersListComponent implements OnInit, OnDestroy {
|
||||
|
||||
@Input()
|
||||
messagePrefix: string;
|
||||
messagePrefix: string;
|
||||
|
||||
@Input()
|
||||
actionConfig: EPersonListActionConfig = {
|
||||
add: {
|
||||
css: 'btn-outline-primary',
|
||||
disabled: false,
|
||||
icon: 'fas fa-plus fa-fw',
|
||||
},
|
||||
remove: {
|
||||
css: 'btn-outline-danger',
|
||||
disabled: false,
|
||||
icon: 'fas fa-trash-alt fa-fw'
|
||||
},
|
||||
};
|
||||
actionConfig: EPersonListActionConfig = {
|
||||
add: {
|
||||
css: 'btn-outline-primary',
|
||||
disabled: false,
|
||||
icon: 'fas fa-plus fa-fw',
|
||||
},
|
||||
remove: {
|
||||
css: 'btn-outline-danger',
|
||||
disabled: false,
|
||||
icon: 'fas fa-trash-alt fa-fw',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* EPeople being displayed in search result, initially all members, after search result of search
|
||||
@@ -115,7 +118,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'sml',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
/**
|
||||
* Pagination config used to display the list of EPerson Membes of active group being edited
|
||||
@@ -123,7 +126,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'ml',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -166,7 +169,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
if (activeGroup != null) {
|
||||
this.groupBeingEdited = activeGroup;
|
||||
this.retrieveMembers(this.config.currentPage);
|
||||
this.search({query: ''});
|
||||
this.search({ query: '' });
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -183,9 +186,9 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||
switchMap((currentPagination) => {
|
||||
return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, {
|
||||
currentPage: currentPagination.currentPage,
|
||||
elementsPerPage: currentPagination.pageSize
|
||||
}
|
||||
currentPage: currentPagination.currentPage,
|
||||
elementsPerPage: currentPagination.pageSize,
|
||||
},
|
||||
);
|
||||
}),
|
||||
getAllCompletedRemoteData(),
|
||||
@@ -228,7 +231,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially add this deleted subgroup into the list of search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
this.search({ query: this.currentSearchQuery });
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.noActiveGroup'));
|
||||
@@ -248,7 +251,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially add this deleted subgroup into the list of search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
this.search({ query: this.currentSearchQuery });
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.noActiveGroup'));
|
||||
@@ -274,7 +277,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
||||
|
||||
return this.ePersonDataService.searchNonMembers(this.currentSearchQuery, this.groupBeingEdited.id, {
|
||||
currentPage: paginationOptions.currentPage,
|
||||
elementsPerPage: paginationOptions.pageSize
|
||||
elementsPerPage: paginationOptions.pageSize,
|
||||
}, false, true);
|
||||
}),
|
||||
getAllCompletedRemoteData(),
|
||||
|
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(subGroups$ | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2"
|
||||
<div *ngIf="(subGroups$ | async)?.payload?.totalElements === 0" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-subgroups-yet' | translate}}
|
||||
</div>
|
||||
@@ -124,7 +124,7 @@
|
||||
</div>
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(searchResults$ | async)?.payload?.totalElements == 0 && searchDone" class="alert alert-info w-100 mb-2"
|
||||
<div *ngIf="(searchResults$ | async)?.payload?.totalElements === 0 && searchDone" class="alert alert-info w-100 mb-2"
|
||||
role="alert">
|
||||
{{messagePrefix + '.no-items' | translate}}
|
||||
</div>
|
||||
|
@@ -1,38 +1,37 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA, DebugElement } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf, } from 'rxjs';
|
||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { RestResponse } from '../../../../core/cache/response.models';
|
||||
import { buildPaginatedList, PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { GroupMock, GroupMock2 } from '../../../../shared/testing/group-mock';
|
||||
import { SubgroupsListComponent } from './subgroups-list.component';
|
||||
import {
|
||||
createSuccessfulRemoteDataObject$
|
||||
} from '../../../../shared/remote-data.utils';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||
import { GroupMock, GroupMock2, } from '../../../../shared/testing/group-mock';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||
import { SubgroupsListComponent } from './subgroups-list.component';
|
||||
|
||||
describe('SubgroupsListComponent', () => {
|
||||
let component: SubgroupsListComponent;
|
||||
@@ -54,12 +53,12 @@ describe('SubgroupsListComponent', () => {
|
||||
selfRegistered: false,
|
||||
permanent: false,
|
||||
_links: {
|
||||
self: {
|
||||
href: 'https://rest.api/server/api/eperson/groups/activegroupid',
|
||||
},
|
||||
subgroups: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/subgroups' },
|
||||
object: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/object' },
|
||||
epersons: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/epersons' }
|
||||
self: {
|
||||
href: 'https://rest.api/server/api/eperson/groups/activegroupid',
|
||||
},
|
||||
subgroups: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/subgroups' },
|
||||
object: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/object' },
|
||||
epersons: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/epersons' },
|
||||
},
|
||||
_name: 'activegroupname',
|
||||
id: 'activegroupid',
|
||||
|
@@ -1,23 +1,22 @@
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnDestroy, OnInit, } from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
||||
import { map, switchMap, take } from 'rxjs/operators';
|
||||
import { BehaviorSubject, Observable, Subscription, } from 'rxjs';
|
||||
import { map, switchMap, take, } from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import {
|
||||
getAllCompletedRemoteData,
|
||||
getFirstCompletedRemoteData
|
||||
} from '../../../../core/shared/operators';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
import { NoContent } from '../../../../core/shared/NoContent.model';
|
||||
import { getAllCompletedRemoteData, getFirstCompletedRemoteData, } from '../../../../core/shared/operators';
|
||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
||||
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';
|
||||
@@ -52,7 +51,7 @@ enum SubKey {
|
||||
export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
|
||||
@Input()
|
||||
messagePrefix: string;
|
||||
messagePrefix: string;
|
||||
|
||||
/**
|
||||
* Result of search groups, initially all groups
|
||||
@@ -63,6 +62,8 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
subGroups$: BehaviorSubject<RemoteData<PaginatedList<Group>>> = new BehaviorSubject(undefined);
|
||||
|
||||
subGroupsPageInfoState$: Observable<PageInfo>;
|
||||
|
||||
/**
|
||||
* Map of active subscriptions
|
||||
*/
|
||||
@@ -74,7 +75,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'ssgl',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
/**
|
||||
* Pagination config used to display the list of subgroups of currently active group being edited
|
||||
@@ -82,7 +83,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'sgl',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
|
||||
// The search form
|
||||
@@ -116,9 +117,12 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
if (activeGroup != null) {
|
||||
this.groupBeingEdited = activeGroup;
|
||||
this.retrieveSubGroups();
|
||||
this.search({query: ''});
|
||||
this.search({ query: '' });
|
||||
}
|
||||
}));
|
||||
this.subGroupsPageInfoState$ = this.subGroups$.pipe(
|
||||
map(subGroupsRD => subGroupsRD?.payload?.pageInfo),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,13 +137,13 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
SubKey.Members,
|
||||
this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||
switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, {
|
||||
currentPage: config.currentPage,
|
||||
elementsPerPage: config.pageSize
|
||||
},
|
||||
true,
|
||||
true,
|
||||
followLink('object')
|
||||
))
|
||||
currentPage: config.currentPage,
|
||||
elementsPerPage: config.pageSize,
|
||||
},
|
||||
true,
|
||||
true,
|
||||
followLink('object'),
|
||||
)),
|
||||
).subscribe((rd: RemoteData<PaginatedList<Group>>) => {
|
||||
this.subGroups$.next(rd);
|
||||
}));
|
||||
@@ -157,7 +161,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially add this deleted subgroup into the list of search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
this.search({ query: this.currentSearchQuery });
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.noActiveGroup'));
|
||||
@@ -178,7 +182,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
// Reload search results (if there is an active query).
|
||||
// This will potentially remove this added subgroup from search results.
|
||||
if (this.currentSearchQuery != null) {
|
||||
this.search({query: this.currentSearchQuery});
|
||||
this.search({ query: this.currentSearchQuery });
|
||||
}
|
||||
} else {
|
||||
this.notificationsService.error(this.translateService.get(this.messagePrefix + '.notification.failure.subgroupToAddIsActiveGroup'));
|
||||
@@ -208,7 +212,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
||||
|
||||
return this.groupDataService.searchNonMemberGroups(this.currentSearchQuery, this.groupBeingEdited.id, {
|
||||
currentPage: paginationOptions.currentPage,
|
||||
elementsPerPage: paginationOptions.pageSize
|
||||
elementsPerPage: paginationOptions.pageSize,
|
||||
}, false, true, followLink('object'));
|
||||
}),
|
||||
getAllCompletedRemoteData(),
|
||||
|
@@ -1,10 +1,13 @@
|
||||
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
ValidationErrors,
|
||||
} from '@angular/forms';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map} from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
||||
|
||||
export class ValidateGroupExists {
|
||||
|
||||
@@ -16,9 +19,9 @@ export class ValidateGroupExists {
|
||||
static createValidator(groupDataService: GroupDataService) {
|
||||
return (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => {
|
||||
return groupDataService.searchGroups(control.value, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 100
|
||||
})
|
||||
currentPage: 1,
|
||||
elementsPerPage: 100,
|
||||
})
|
||||
.pipe(
|
||||
getFirstSucceededRemoteListPayload(),
|
||||
map( (groups: Group[]) => {
|
||||
|
@@ -1,10 +1,14 @@
|
||||
import { GroupPageGuard } from './group-page.guard';
|
||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||
import { GroupPageGuard } from './group-page.guard';
|
||||
|
||||
describe('GroupPageGuard', () => {
|
||||
const groupsEndpointUrl = 'https://test.org/api/eperson/groups';
|
||||
@@ -13,7 +17,7 @@ describe('GroupPageGuard', () => {
|
||||
const routeSnapshotWithGroupId = {
|
||||
params: {
|
||||
groupId: groupUuid,
|
||||
}
|
||||
},
|
||||
} as unknown as ActivatedRouteSnapshot;
|
||||
|
||||
let guard: GroupPageGuard;
|
||||
@@ -50,10 +54,10 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
it('should return true', (done) => {
|
||||
guard.canActivate(
|
||||
routeSnapshotWithGroupId, { url: 'current-url'} as any
|
||||
routeSnapshotWithGroupId, { url: 'current-url' } as any,
|
||||
).subscribe((result) => {
|
||||
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined
|
||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined,
|
||||
);
|
||||
expect(result).toBeTrue();
|
||||
done();
|
||||
@@ -68,10 +72,10 @@ describe('GroupPageGuard', () => {
|
||||
|
||||
it('should not return true', (done) => {
|
||||
guard.canActivate(
|
||||
routeSnapshotWithGroupId, { url: 'current-url'} as any
|
||||
routeSnapshotWithGroupId, { url: 'current-url' } as any,
|
||||
).subscribe((result) => {
|
||||
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined
|
||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined,
|
||||
);
|
||||
expect(result).not.toBeTrue();
|
||||
done();
|
||||
|
@@ -1,15 +1,23 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { SomeFeatureAuthorizationGuard } from '../../core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard';
|
||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Router,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { SomeFeatureAuthorizationGuard } from '../../core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GroupPageGuard extends SomeFeatureAuthorizationGuard {
|
||||
|
||||
@@ -28,7 +36,7 @@ export class GroupPageGuard extends SomeFeatureAuthorizationGuard {
|
||||
|
||||
getObjectUrl(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<string> {
|
||||
return this.halEndpointService.getEndpoint(this.groupsEndpoint).pipe(
|
||||
map(groupsUrl => `${groupsUrl}/${route?.params?.groupId}`)
|
||||
map(groupsUrl => `${groupsUrl}/${route?.params?.groupId}`),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { Action } from '@ngrx/store';
|
||||
|
||||
import { Group } from '../../core/eperson/models/group.model';
|
||||
import { type } from '../../shared/ngrx/type';
|
||||
|
||||
|
@@ -1,6 +1,12 @@
|
||||
import { GroupMock } from '../../shared/testing/group-mock';
|
||||
import { GroupRegistryCancelGroupAction, GroupRegistryEditGroupAction } from './group-registry.actions';
|
||||
import { groupRegistryReducer, GroupRegistryState } from './group-registry.reducers';
|
||||
import {
|
||||
GroupRegistryCancelGroupAction,
|
||||
GroupRegistryEditGroupAction,
|
||||
} from './group-registry.actions';
|
||||
import {
|
||||
groupRegistryReducer,
|
||||
GroupRegistryState,
|
||||
} from './group-registry.reducers';
|
||||
|
||||
const initialState: GroupRegistryState = {
|
||||
editGroup: null,
|
||||
|
@@ -1,5 +1,9 @@
|
||||
import { Group } from '../../core/eperson/models/group.model';
|
||||
import { GroupRegistryAction, GroupRegistryActionTypes, GroupRegistryEditGroupAction } from './group-registry.actions';
|
||||
import {
|
||||
GroupRegistryAction,
|
||||
GroupRegistryActionTypes,
|
||||
GroupRegistryEditGroupAction,
|
||||
} from './group-registry.actions';
|
||||
|
||||
/**
|
||||
* The metadata registry state.
|
||||
@@ -27,13 +31,13 @@ export function groupRegistryReducer(state = initialState, action: GroupRegistry
|
||||
|
||||
case GroupRegistryActionTypes.EDIT_GROUP: {
|
||||
return Object.assign({}, state, {
|
||||
editGroup: (action as GroupRegistryEditGroupAction).group
|
||||
editGroup: (action as GroupRegistryEditGroupAction).group,
|
||||
});
|
||||
}
|
||||
|
||||
case GroupRegistryActionTypes.CANCEL_EDIT_GROUP: {
|
||||
return Object.assign({}, state, {
|
||||
editGroup: null
|
||||
editGroup: null,
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
<ds-themed-loading *ngIf="loading$ | async"></ds-themed-loading>
|
||||
<ds-pagination
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(loading$ | async)"
|
||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true"
|
||||
[paginationOptions]="config"
|
||||
[pageInfoState]="pageInfoState$"
|
||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
</ds-pagination>
|
||||
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
<div *ngIf="(pageInfoState$ | async)?.totalElements === 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{messagePrefix + 'no-items' | translate}}
|
||||
</div>
|
||||
|
||||
|
@@ -1,43 +1,44 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { Observable, of, of as observableOf } from 'rxjs';
|
||||
import { TranslateLoader, TranslateModule, } from '@ngx-translate/core';
|
||||
import { Observable, of, of as observableOf, } from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { Group } from '../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { RouteService } from '../../core/services/route.service';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { GroupMock, GroupMock2 } from '../../shared/testing/group-mock';
|
||||
import { GroupsRegistryComponent } from './groups-registry.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../shared/testing/eperson.mock';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { routeServiceStub } from '../../shared/testing/route-service.stub';
|
||||
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { NoContent } from '../../core/shared/NoContent.model';
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { DSONameServiceMock, UNDEFINED_NAME } from '../../shared/mocks/dso-name.service.mock';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { DSONameServiceMock, UNDEFINED_NAME, } from '../../shared/mocks/dso-name.service.mock';
|
||||
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock';
|
||||
import { GroupMock, GroupMock2, } from '../../shared/testing/group-mock';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||
import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface';
|
||||
import { routeServiceStub } from '../../shared/testing/route-service.stub';
|
||||
import { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock';
|
||||
import { GroupsRegistryComponent } from './groups-registry.component';
|
||||
|
||||
describe('GroupsRegistryComponent', () => {
|
||||
let component: GroupsRegistryComponent;
|
||||
@@ -83,24 +84,24 @@ describe('GroupsRegistryComponent', () => {
|
||||
elementsPerPage: 1,
|
||||
totalElements: 0,
|
||||
totalPages: 0,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), []));
|
||||
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/epersons':
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||
elementsPerPage: 1,
|
||||
totalElements: 1,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), [EPersonMock]));
|
||||
default:
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||
elementsPerPage: 1,
|
||||
totalElements: 0,
|
||||
totalPages: 0,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), []));
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
groupsDataServiceStub = {
|
||||
allGroups: mockGroups,
|
||||
@@ -111,21 +112,21 @@ describe('GroupsRegistryComponent', () => {
|
||||
elementsPerPage: 1,
|
||||
totalElements: 0,
|
||||
totalPages: 0,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), []));
|
||||
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/groups':
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||
elementsPerPage: 1,
|
||||
totalElements: 1,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), [GroupMock2]));
|
||||
default:
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||
elementsPerPage: 1,
|
||||
totalElements: 0,
|
||||
totalPages: 0,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), []));
|
||||
}
|
||||
},
|
||||
@@ -141,7 +142,7 @@ describe('GroupsRegistryComponent', () => {
|
||||
elementsPerPage: this.allGroups.length,
|
||||
totalElements: this.allGroups.length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), this.allGroups));
|
||||
}
|
||||
const result = this.allGroups.find((group: Group) => {
|
||||
@@ -151,7 +152,7 @@ describe('GroupsRegistryComponent', () => {
|
||||
elementsPerPage: [result].length,
|
||||
totalElements: [result].length,
|
||||
totalPages: 1,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
}), [result]));
|
||||
},
|
||||
delete(objectId: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
||||
@@ -161,7 +162,7 @@ describe('GroupsRegistryComponent', () => {
|
||||
dsoDataServiceStub = {
|
||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||
return createSuccessfulRemoteDataObject$(undefined);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
@@ -176,8 +177,8 @@ describe('GroupsRegistryComponent', () => {
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), GroupsRegistryComponent],
|
||||
providers: [GroupsRegistryComponent,
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
@@ -195,7 +196,7 @@ describe('GroupsRegistryComponent', () => {
|
||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||
provideMockStore(),
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
@@ -248,16 +249,16 @@ describe('GroupsRegistryComponent', () => {
|
||||
|
||||
it('should not check the canManageGroup permissions', () => {
|
||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, mockGroups[0].self
|
||||
FeatureID.CanManageGroup, mockGroups[0].self,
|
||||
);
|
||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, mockGroups[0].self, undefined // treated differently
|
||||
FeatureID.CanManageGroup, mockGroups[0].self, undefined, // treated differently
|
||||
);
|
||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, mockGroups[1].self
|
||||
FeatureID.CanManageGroup, mockGroups[1].self,
|
||||
);
|
||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||
FeatureID.CanManageGroup, mockGroups[1].self, undefined // treated differently
|
||||
FeatureID.CanManageGroup, mockGroups[1].self, undefined, // treated differently
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, OnDestroy, OnInit, } from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
@@ -8,36 +8,37 @@ import {
|
||||
EMPTY,
|
||||
Observable,
|
||||
of as observableOf,
|
||||
Subscription
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import { catchError, defaultIfEmpty, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { catchError, defaultIfEmpty, map, switchMap, tap, } from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { RequestService } from '../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { GroupDtoModel } from '../../core/eperson/models/group-dto.model';
|
||||
import { Group } from '../../core/eperson/models/group.model';
|
||||
import { GroupDtoModel } from '../../core/eperson/models/group-dto.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { RouteService } from '../../core/services/route.service';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { NoContent } from '../../core/shared/NoContent.model';
|
||||
import {
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstSucceededRemoteData,
|
||||
getRemoteDataPayload
|
||||
getRemoteDataPayload,
|
||||
} from '../../core/shared/operators';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||
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, NgForOf, NgIf, NgSwitch, NgSwitchCase } from '@angular/common';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
@@ -75,7 +76,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'gl',
|
||||
pageSize: 5,
|
||||
currentPage: 1
|
||||
currentPage: 1,
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -151,7 +152,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
const query: string = data.query;
|
||||
if (query != null && this.currentSearchQuery !== query) {
|
||||
this.currentSearchQuery = query;
|
||||
this.paginationService.updateRouteWithUrl(this.config.id, [], {page: 1});
|
||||
this.paginationService.updateRouteWithUrl(this.config.id, [], { page: 1 });
|
||||
}
|
||||
return this.groupService.searchGroups(this.currentSearchQuery.trim(), {
|
||||
currentPage: paginationOptions.currentPage,
|
||||
@@ -173,19 +174,19 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
this.canManageGroup$(isSiteAdmin, group),
|
||||
this.hasLinkedDSO(group),
|
||||
this.getSubgroups(group),
|
||||
this.getMembers(group)
|
||||
this.getMembers(group),
|
||||
]).pipe(
|
||||
map(([canDelete, canManageGroup, hasLinkedDSO, subgroups, members]:
|
||||
[boolean, boolean, boolean, RemoteData<PaginatedList<Group>>, RemoteData<PaginatedList<EPerson>>]) => {
|
||||
const groupDtoModel: GroupDtoModel = new GroupDtoModel();
|
||||
groupDtoModel.ableToDelete = canDelete && !hasLinkedDSO;
|
||||
groupDtoModel.ableToEdit = canManageGroup;
|
||||
groupDtoModel.group = group;
|
||||
groupDtoModel.subgroups = subgroups.payload;
|
||||
groupDtoModel.epersons = members.payload;
|
||||
return groupDtoModel;
|
||||
}
|
||||
)
|
||||
const groupDtoModel: GroupDtoModel = new GroupDtoModel();
|
||||
groupDtoModel.ableToDelete = canDelete && !hasLinkedDSO;
|
||||
groupDtoModel.ableToEdit = canManageGroup;
|
||||
groupDtoModel.group = group;
|
||||
groupDtoModel.subgroups = subgroups.payload;
|
||||
groupDtoModel.epersons = members.payload;
|
||||
return groupDtoModel;
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return EMPTY;
|
||||
@@ -193,9 +194,9 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
})]).pipe(defaultIfEmpty([]), map((dtos: GroupDtoModel[]) => {
|
||||
return buildPaginatedList(groups.pageInfo, dtos);
|
||||
}));
|
||||
})
|
||||
}),
|
||||
);
|
||||
})
|
||||
}),
|
||||
).subscribe((value: PaginatedList<GroupDtoModel>) => {
|
||||
this.groupsDto$.next(value);
|
||||
this.pageInfoState$.next(value.pageInfo);
|
||||
@@ -203,7 +204,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
this.subs.push(this.searchSub);
|
||||
}
|
||||
}
|
||||
|
||||
canManageGroup$(isSiteAdmin: boolean, group: Group): Observable<boolean> {
|
||||
if (isSiteAdmin) {
|
||||
@@ -228,7 +229,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
this.translateService.get(this.messagePrefix + 'notification.deleted.failure.title', { name: this.dsoNameService.getName(group.group) }),
|
||||
this.translateService.get(this.messagePrefix + 'notification.deleted.failure.content', { cause: rd.errorMessage }));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,9 +241,9 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
getMembers(group: Group): Observable<RemoteData<PaginatedList<EPerson>>> {
|
||||
return this.ePersonDataService.findListByHref(group._links.epersons.href, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 1,
|
||||
}).pipe(getFirstSucceededRemoteData());
|
||||
currentPage: 1,
|
||||
elementsPerPage: 1,
|
||||
}).pipe(getFirstSucceededRemoteData());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,9 +254,9 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
getSubgroups(group: Group): Observable<RemoteData<PaginatedList<Group>>> {
|
||||
return this.groupService.findListByHref(group._links.subgroups.href, {
|
||||
currentPage: 1,
|
||||
elementsPerPage: 1,
|
||||
}).pipe(getFirstSucceededRemoteData());
|
||||
currentPage: 1,
|
||||
elementsPerPage: 1,
|
||||
}).pipe(getFirstSucceededRemoteData());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,8 +1,13 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks.component';
|
||||
|
||||
describe('AdminCurationTasksComponent', () => {
|
||||
let comp: AdminCurationTasksComponent;
|
||||
|
@@ -1,22 +1,31 @@
|
||||
import { ComponentFixture, fakeAsync, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { BatchImportPageComponent } from './batch-import-page.component';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
||||
import { FileValidator } from '../../shared/utils/require-file.validator';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import {
|
||||
BATCH_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Location } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import {
|
||||
BATCH_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService,
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
||||
import { FileValidator } from '../../shared/utils/require-file.validator';
|
||||
import { BatchImportPageComponent } from './batch-import-page.component';
|
||||
|
||||
describe('BatchImportPageComponent', () => {
|
||||
let component: BatchImportPageComponent;
|
||||
@@ -31,14 +40,14 @@ describe('BatchImportPageComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
scriptService = jasmine.createSpyObj('scriptService',
|
||||
{
|
||||
invoke: createSuccessfulRemoteDataObject$({ processId: '46' })
|
||||
}
|
||||
invoke: createSuccessfulRemoteDataObject$({ processId: '46' }),
|
||||
},
|
||||
);
|
||||
router = jasmine.createSpyObj('router', {
|
||||
navigateByUrl: jasmine.createSpy('navigateByUrl')
|
||||
navigateByUrl: jasmine.createSpy('navigateByUrl'),
|
||||
});
|
||||
locationStub = jasmine.createSpyObj('location', {
|
||||
back: jasmine.createSpy('back')
|
||||
back: jasmine.createSpy('back'),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,7 +66,7 @@ describe('BatchImportPageComponent', () => {
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: Location, useValue: locationStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
@@ -108,7 +117,7 @@ describe('BatchImportPageComponent', () => {
|
||||
it('metadata-import script is invoked with --zip fileName and the mockFile', () => {
|
||||
const parameterValues: ProcessParameter[] = [
|
||||
Object.assign(new ProcessParameter(), { name: '--add' }),
|
||||
Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' })
|
||||
Object.assign(new ProcessParameter(), { name: '--zip', value: 'filename.zip' }),
|
||||
];
|
||||
expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [fileMock]);
|
||||
});
|
||||
@@ -181,7 +190,7 @@ describe('BatchImportPageComponent', () => {
|
||||
it('metadata-import script is invoked with --url and the file url', () => {
|
||||
const parameterValues: ProcessParameter[] = [
|
||||
Object.assign(new ProcessParameter(), { name: '--add' }),
|
||||
Object.assign(new ProcessParameter(), { name: '--url', value: 'example.fileURL.com' })
|
||||
Object.assign(new ProcessParameter(), { name: '--url', value: 'example.fileURL.com' }),
|
||||
];
|
||||
expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_IMPORT_SCRIPT_NAME, parameterValues, [null]);
|
||||
});
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { Location, NgIf } from '@angular/common';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
@@ -5,18 +6,28 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
||||
import { BATCH_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
import { isEmpty, isNotEmpty } from '../../shared/empty.util';
|
||||
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||
import {
|
||||
ImportBatchSelectorComponent
|
||||
} from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component';
|
||||
import { Router } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import {
|
||||
BATCH_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService,
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { ImportBatchSelectorComponent } from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component';
|
||||
import {
|
||||
isEmpty,
|
||||
isNotEmpty,
|
||||
} from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { UiSwitchModule } from 'ngx-ui-switch';
|
||||
import {
|
||||
@@ -104,7 +115,7 @@ export class BatchImportPageComponent {
|
||||
}
|
||||
} else {
|
||||
const parameterValues: ProcessParameter[] = [
|
||||
Object.assign(new ProcessParameter(), { name: '--add' })
|
||||
Object.assign(new ProcessParameter(), { name: '--add' }),
|
||||
];
|
||||
if (this.isUpload) {
|
||||
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name }));
|
||||
|
@@ -1,19 +1,31 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { METADATA_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||
|
||||
import {
|
||||
METADATA_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService,
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
||||
import { FileValidator } from '../../shared/utils/require-file.validator';
|
||||
import { MetadataImportPageComponent } from './metadata-import-page.component';
|
||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
|
||||
describe('MetadataImportPageComponent', () => {
|
||||
let comp: MetadataImportPageComponent;
|
||||
@@ -28,14 +40,14 @@ describe('MetadataImportPageComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
scriptService = jasmine.createSpyObj('scriptService',
|
||||
{
|
||||
invoke: createSuccessfulRemoteDataObject$({ processId: '45' })
|
||||
}
|
||||
invoke: createSuccessfulRemoteDataObject$({ processId: '45' }),
|
||||
},
|
||||
);
|
||||
router = jasmine.createSpyObj('router', {
|
||||
navigateByUrl: jasmine.createSpy('navigateByUrl')
|
||||
navigateByUrl: jasmine.createSpy('navigateByUrl'),
|
||||
});
|
||||
locationStub = jasmine.createSpyObj('location', {
|
||||
back: jasmine.createSpy('back')
|
||||
back: jasmine.createSpy('back'),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,7 +66,7 @@ describe('MetadataImportPageComponent', () => {
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: Location, useValue: locationStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -2,18 +2,22 @@ import { Location } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
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';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
|
||||
import {
|
||||
METADATA_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService,
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
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';
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-import-page',
|
||||
|
@@ -1,29 +1,29 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
||||
import { Routes ,
|
||||
} from '@angular/router';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
||||
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
|
||||
const moduleRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
component: LdnServicesOverviewComponent,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'ldn-registered-services.title', breadcrumbKey: 'ldn-registered-services.new'},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: { title: 'ldn-registered-services.title', breadcrumbKey: 'ldn-registered-services.new' },
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
resolve: {breadcrumb: NavigationBreadcrumbResolver},
|
||||
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
||||
component: LdnServiceFormComponent,
|
||||
data: {title: 'ldn-register-new-service.title', breadcrumbKey: 'ldn-register-new-service'}
|
||||
data: { title: 'ldn-register-new-service.title', breadcrumbKey: 'ldn-register-new-service' },
|
||||
},
|
||||
{
|
||||
path: 'edit/:serviceId',
|
||||
resolve: {breadcrumb: NavigationBreadcrumbResolver},
|
||||
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
||||
component: LdnServiceFormComponent,
|
||||
data: {title: 'ldn-edit-service.title', breadcrumbKey: 'ldn-edit-service'}
|
||||
data: { title: 'ldn-edit-service.title', breadcrumbKey: 'ldn-edit-service' },
|
||||
},
|
||||
];
|
||||
|
||||
@@ -33,6 +33,6 @@ export const ROUTES = moduleRoutes.map(route => {
|
||||
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||
.map((relatedRoute) => {
|
||||
return {path: relatedRoute.path, data: relatedRoute.data};
|
||||
})
|
||||
}),
|
||||
}};
|
||||
});
|
||||
|
@@ -1,15 +1,14 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule
|
||||
FormsModule,
|
||||
],
|
||||
providers: [LdnItemfiltersService]
|
||||
providers: [LdnItemfiltersService],
|
||||
})
|
||||
export class AdminLdnServicesModule {
|
||||
}
|
||||
|
@@ -102,8 +102,13 @@
|
||||
id="ldnUrl"
|
||||
name="ldnUrl"
|
||||
type="text">
|
||||
<div *ngIf="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched" class="error-text">
|
||||
{{ 'ldn-new-service.form.error.ldnurl' | translate }}
|
||||
<div *ngIf="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched" >
|
||||
<div *ngIf="formModel.get('ldnUrl').errors['required']" class="error-text">
|
||||
{{ 'ldn-new-service.form.error.ldnurl' | translate }}
|
||||
</div>
|
||||
<div *ngIf="formModel.get('ldnUrl').errors['ldnUrlAlreadyAssociated']" class="error-text">
|
||||
{{ 'ldn-new-service.form.error.ldnurl.ldnUrlAlreadyAssociated' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -1,23 +1,49 @@
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
|
||||
import {NgbDropdownModule, NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||
import {LdnServiceFormComponent} from './ldn-service-form.component';
|
||||
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||
import {PaginationService} from 'ngx-pagination';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {LdnItemfiltersService} from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||
import {RouterStub} from '../../../shared/testing/router.stub';
|
||||
import {MockActivatedRoute} from '../../../shared/mocks/active-router.mock';
|
||||
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service.stub';
|
||||
import { of as observableOf, of } from 'rxjs';
|
||||
import {RouteService} from '../../../core/services/route.service';
|
||||
import {provideMockStore} from '@ngrx/store/testing';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
EventEmitter,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
TestBed,
|
||||
tick,
|
||||
} from '@angular/core/testing';
|
||||
import {
|
||||
FormArray,
|
||||
FormBuilder,
|
||||
FormControl,
|
||||
FormGroup,
|
||||
ReactiveFormsModule,
|
||||
} from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import {
|
||||
NgbDropdownModule,
|
||||
NgbModal,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { PaginationService } from 'ngx-pagination';
|
||||
import {
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { RouteService } from '../../../core/services/route.service';
|
||||
import { MockActivatedRoute } from '../../../shared/mocks/active-router.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||
import { LdnServiceFormComponent } from './ldn-service-form.component';
|
||||
|
||||
describe('LdnServiceFormEditComponent', () => {
|
||||
let component: LdnServiceFormComponent;
|
||||
@@ -33,7 +59,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
const routeParams = {
|
||||
serviceId: testId,
|
||||
};
|
||||
const routeUrlSegments = [{path: 'path'}];
|
||||
const routeUrlSegments = [{ path: 'path' }];
|
||||
const formMockValue = {
|
||||
'id': '',
|
||||
'name': 'name',
|
||||
@@ -52,9 +78,9 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
'pattern': '',
|
||||
'patternLabel': 'Select a pattern',
|
||||
'constraint': '',
|
||||
'automatic': false
|
||||
}
|
||||
]
|
||||
'automatic': false,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +89,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
instant: () => 'translated-text',
|
||||
onLangChange: new EventEmitter(),
|
||||
onTranslationChange: new EventEmitter(),
|
||||
onDefaultLangChange: new EventEmitter()
|
||||
onDefaultLangChange: new EventEmitter(),
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -77,11 +103,11 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
findAll: () => of(['item1', 'item2']),
|
||||
};
|
||||
cdRefStub = Object.assign({
|
||||
detectChanges: () => fixture.detectChanges()
|
||||
detectChanges: () => fixture.detectChanges(),
|
||||
});
|
||||
modalService = {
|
||||
open: () => {/*comment*/
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -102,7 +128,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
FormBuilder,
|
||||
RouteService,
|
||||
provideMockStore({}),
|
||||
]
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
@@ -138,7 +164,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
|
||||
it('should handle create service with valid form', () => {
|
||||
spyOn(component, 'fetchServiceData').and.callFake((a) => a);
|
||||
component.formModel.addControl('notifyServiceInboundPatterns', (component as any).formBuilder.array([{pattern: 'patternValue'}]));
|
||||
component.formModel.addControl('notifyServiceInboundPatterns', (component as any).formBuilder.array([{ pattern: 'patternValue' }]));
|
||||
const nameInput = fixture.debugElement.query(By.css('#name'));
|
||||
const descriptionInput = fixture.debugElement.query(By.css('#description'));
|
||||
const urlInput = fixture.debugElement.query(By.css('#url'));
|
||||
@@ -183,7 +209,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
spyOn(component.formModel, 'markAllAsTouched');
|
||||
spyOn(component, 'closeModal');
|
||||
spyOn(component, 'checkPatterns').and.callFake(() => true);
|
||||
component.formModel.addControl('notifyServiceInboundPatterns', (component as any).formBuilder.array([{pattern: 'patternValue'}]));
|
||||
component.formModel.addControl('notifyServiceInboundPatterns', (component as any).formBuilder.array([{ pattern: 'patternValue' }]));
|
||||
component.formModel.patchValue(formMockValue);
|
||||
component.createService();
|
||||
|
||||
@@ -195,13 +221,13 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
it('should check patterns', () => {
|
||||
const arrValid = new FormArray([
|
||||
new FormGroup({
|
||||
pattern: new FormControl('pattern')
|
||||
pattern: new FormControl('pattern'),
|
||||
}),
|
||||
]);
|
||||
|
||||
const arrInvalid = new FormArray([
|
||||
new FormGroup({
|
||||
pattern: new FormControl('')
|
||||
pattern: new FormControl(''),
|
||||
}),
|
||||
]);
|
||||
|
||||
|
@@ -1,34 +1,27 @@
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { animate, state, style, transition, trigger, } from '@angular/animations';
|
||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||
import {notifyPatterns} from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||
import {animate, state, style, transition, trigger} from '@angular/animations';
|
||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
import {RemoteData} from 'src/app/core/data/remote-data';
|
||||
import {Operation} from 'fast-json-patch';
|
||||
import {getFirstCompletedRemoteData} from '../../../core/shared/operators';
|
||||
import {LdnItemfiltersService} from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||
import {Itemfilter} from '../ldn-services-model/ldn-service-itemfilters';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||
import {combineLatestWith, Observable, Subscription} from 'rxjs';
|
||||
import {PaginationService} from '../../../core/pagination/pagination.service';
|
||||
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||
import {NotifyServicePattern} from '../ldn-services-model/ldn-service-patterns.model';
|
||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { combineLatestWith, Observable, Subscription, } from 'rxjs';
|
||||
import { RemoteData } from 'src/app/core/data/remote-data';
|
||||
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||
import { NotifyServicePattern } from '../ldn-services-model/ldn-service-patterns.model';
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Component for editing LDN service through a form that allows to create or edit the properties of a service
|
||||
@@ -57,15 +50,15 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
formModel: FormGroup;
|
||||
|
||||
@ViewChild('confirmModal', {static: true}) confirmModal: TemplateRef<any>;
|
||||
@ViewChild('resetFormModal', {static: true}) resetFormModal: TemplateRef<any>;
|
||||
@ViewChild('confirmModal', { static: true }) confirmModal: TemplateRef<any>;
|
||||
@ViewChild('resetFormModal', { static: true }) resetFormModal: TemplateRef<any>;
|
||||
|
||||
public inboundPatterns: string[] = notifyPatterns;
|
||||
public isNewService: boolean;
|
||||
public areControlsInitialized: boolean;
|
||||
public itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
||||
public config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||
elementsPerPage: 20
|
||||
elementsPerPage: 20,
|
||||
});
|
||||
public markedForDeletionInboundPattern: number[] = [];
|
||||
public selectedInboundPatterns: string[];
|
||||
@@ -88,7 +81,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
protected modalService: NgbModal,
|
||||
private notificationService: NotificationsService,
|
||||
private translateService: TranslateService,
|
||||
protected paginationService: PaginationService
|
||||
protected paginationService: PaginationService,
|
||||
) {
|
||||
|
||||
this.formModel = this.formBuilder.group({
|
||||
@@ -107,8 +100,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.routeSubscription = this.route.params.pipe(
|
||||
combineLatestWith(this.route.url)
|
||||
this.routeSubscription = this.route.params.pipe(
|
||||
combineLatestWith(this.route.url),
|
||||
).subscribe(([params, segment]) => {
|
||||
this.serviceId = params.serviceId;
|
||||
this.isNewService = segment[0].path === 'new';
|
||||
@@ -159,17 +152,17 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
patternLabel: string,
|
||||
constraintFormatted: string;
|
||||
}) => {
|
||||
const {patternLabel, ...rest} = pattern;
|
||||
const { patternLabel, ...rest } = pattern;
|
||||
delete rest.constraintFormatted;
|
||||
return rest;
|
||||
});
|
||||
|
||||
const values = {...this.formModel.value, enabled: true};
|
||||
const values = { ...this.formModel.value, enabled: true };
|
||||
|
||||
const ldnServiceData = this.ldnServicesService.create(values);
|
||||
|
||||
ldnServiceData.pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((rd: RemoteData<LdnService>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
this.notificationService.success(this.translateService.get('ldn-service-notification.created.success.title'),
|
||||
@@ -177,6 +170,9 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
this.closeModal();
|
||||
this.sendBack();
|
||||
} else {
|
||||
if (!this.formModel.errors) {
|
||||
this.setLdnUrlError();
|
||||
}
|
||||
this.notificationService.error(this.translateService.get('ldn-service-notification.created.failure.title'),
|
||||
this.translateService.get('ldn-service-notification.created.failure.body'));
|
||||
this.closeModal();
|
||||
@@ -206,7 +202,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
fetchServiceData(serviceId: string): void {
|
||||
this.ldnServicesService.findById(serviceId).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe(
|
||||
(data: RemoteData<LdnService>) => {
|
||||
if (data.hasSucceeded) {
|
||||
@@ -221,18 +217,18 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
type: this.ldnService.type,
|
||||
enabled: this.ldnService.enabled,
|
||||
lowerIp: this.ldnService.lowerIp,
|
||||
upperIp: this.ldnService.upperIp
|
||||
upperIp: this.ldnService.upperIp,
|
||||
});
|
||||
this.filterPatternObjectsAndAssignLabel('notifyServiceInboundPatterns');
|
||||
let notifyServiceInboundPatternsFormArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||
const notifyServiceInboundPatternsFormArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||
notifyServiceInboundPatternsFormArray.controls.forEach(
|
||||
control => {
|
||||
const controlFormGroup = control as FormGroup;
|
||||
const controlConstraint = controlFormGroup.get('constraint').value;
|
||||
controlFormGroup.patchValue({
|
||||
constraintFormatted: controlConstraint ? this.translateService.instant((controlConstraint as string) + '.label') : ''
|
||||
constraintFormatted: controlConstraint ? this.translateService.instant((controlConstraint as string) + '.label') : '',
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -247,14 +243,13 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
const PatternsArray = this.formModel.get(formArrayName) as FormArray;
|
||||
PatternsArray.clear();
|
||||
|
||||
let servicesToUse = this.ldnService.notifyServiceInboundPatterns;
|
||||
const servicesToUse = this.ldnService.notifyServiceInboundPatterns;
|
||||
|
||||
servicesToUse.forEach((patternObj: NotifyServicePattern) => {
|
||||
let patternFormGroup;
|
||||
patternFormGroup = this.initializeInboundPatternFormGroup();
|
||||
const patternFormGroup = this.initializeInboundPatternFormGroup();
|
||||
const newPatternObjWithLabel = Object.assign(new NotifyServicePattern(), {
|
||||
...patternObj,
|
||||
patternLabel: this.translateService.instant('ldn-service.form.pattern.' + patternObj?.pattern + '.label')
|
||||
patternLabel: this.translateService.instant('ldn-service.form.pattern.' + patternObj?.pattern + '.label'),
|
||||
});
|
||||
patternFormGroup.patchValue(newPatternObjWithLabel);
|
||||
|
||||
@@ -282,7 +277,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
this.deletedInboundPatterns.forEach(index => {
|
||||
const removeOperation: Operation = {
|
||||
op: 'remove',
|
||||
path: `notifyServiceInboundPatterns[${index}]`
|
||||
path: `notifyServiceInboundPatterns[${index}]`,
|
||||
};
|
||||
patchOperations.push(removeOperation);
|
||||
});
|
||||
@@ -312,8 +307,8 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
selectInboundPattern(patternValue: string, index: number): void {
|
||||
const patternArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray);
|
||||
patternArray.controls[index].patchValue({pattern: patternValue});
|
||||
patternArray.controls[index].patchValue({patternLabel: this.translateService.instant('ldn-service.form.pattern.' + patternValue + '.label')});
|
||||
patternArray.controls[index].patchValue({ pattern: patternValue });
|
||||
patternArray.controls[index].patchValue({ patternLabel: this.translateService.instant('ldn-service.form.pattern.' + patternValue + '.label') });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -325,7 +320,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray);
|
||||
filterArray.controls[index].patchValue({
|
||||
constraint: filterValue,
|
||||
constraintFormatted: this.translateService.instant((filterValue !== '' ? filterValue : 'ldn.no-filter') + '.label')
|
||||
constraintFormatted: this.translateService.instant((filterValue !== '' ? filterValue : 'ldn.no-filter') + '.label'),
|
||||
});
|
||||
filterArray.markAllAsTouched();
|
||||
}
|
||||
@@ -355,12 +350,12 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
|
||||
this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe(
|
||||
() => {
|
||||
this.formModel.get('enabled').setValue(newStatus);
|
||||
this.cdRef.detectChanges();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -406,7 +401,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.ldnServicesService.patch(this.ldnService, patchOperations).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe(
|
||||
(rd: RemoteData<LdnService>) => {
|
||||
if (rd.hasSucceeded) {
|
||||
@@ -415,6 +410,9 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
this.notificationService.success(this.translateService.get('admin.registries.services-formats.modify.success.head'),
|
||||
this.translateService.get('admin.registries.services-formats.modify.success.content'));
|
||||
} else {
|
||||
if (!this.formModel.errors) {
|
||||
this.setLdnUrlError();
|
||||
}
|
||||
this.notificationService.error(this.translateService.get('admin.registries.services-formats.modify.failure.head'),
|
||||
this.translateService.get('admin.registries.services-formats.modify.failure.content'));
|
||||
this.closeModal();
|
||||
@@ -541,7 +539,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
constraint: '',
|
||||
constraintFormatted: '',
|
||||
automatic: false,
|
||||
isNew: true
|
||||
isNew: true,
|
||||
};
|
||||
|
||||
if (this.isNewService) {
|
||||
@@ -564,4 +562,14 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
automatic: '',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* set ldnUrl error in case of unprocessable entity and provided value
|
||||
*/
|
||||
private setLdnUrlError(): void {
|
||||
const control = this.formModel.controls.ldnUrl;
|
||||
const controlErrors = control.errors || {};
|
||||
control.setErrors({ ...controlErrors, ldnUrlAlreadyAssociated: true });
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,13 @@
|
||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import {createSuccessfulRemoteDataObject$} from '../../../shared/remote-data.utils';
|
||||
import {
|
||||
Observable,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
|
||||
export const mockLdnService: LdnService = {
|
||||
uuid: '1',
|
||||
@@ -31,7 +35,7 @@ export const mockLdnService: LdnService = {
|
||||
type: LDN_SERVICE,
|
||||
_links: {
|
||||
self: {
|
||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
||||
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||
},
|
||||
},
|
||||
get self(): string {
|
||||
@@ -68,7 +72,7 @@ export const mockLdnServices: LdnService[] = [{
|
||||
type: LDN_SERVICE,
|
||||
_links: {
|
||||
self: {
|
||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
||||
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||
},
|
||||
},
|
||||
get self(): string {
|
||||
@@ -100,12 +104,12 @@ export const mockLdnServices: LdnService[] = [{
|
||||
type: LDN_SERVICE,
|
||||
_links: {
|
||||
self: {
|
||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
||||
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||
},
|
||||
},
|
||||
get self(): string {
|
||||
return '';
|
||||
},
|
||||
}
|
||||
},
|
||||
];
|
||||
export const mockLdnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>> = of((mockLdnServices as unknown) as RemoteData<PaginatedList<LdnService>>);
|
||||
|
@@ -1,19 +1,23 @@
|
||||
import {
|
||||
cold,
|
||||
getTestScheduler,
|
||||
} from 'jasmine-marbles';
|
||||
import { of } from 'rxjs';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
import { LdnItemfiltersService } from './ldn-itemfilters-data.service';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { RequestEntry } from '../../../core/data/request-entry.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestEntryState } from '../../../core/data/request-entry-state.model';
|
||||
import { cold, getTestScheduler } from 'jasmine-marbles';
|
||||
import { RestResponse } from '../../../core/cache/response.models';
|
||||
import { of } from 'rxjs';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { FindAllData } from '../../../core/data/base/find-all-data';
|
||||
import { testFindAllDataImplementation } from '../../../core/data/base/find-all-data.spec';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RequestEntry } from '../../../core/data/request-entry.model';
|
||||
import { RequestEntryState } from '../../../core/data/request-entry-state.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { LdnItemfiltersService } from './ldn-itemfilters-data.service';
|
||||
|
||||
describe('LdnItemfiltersService test', () => {
|
||||
let scheduler: TestScheduler;
|
||||
@@ -60,12 +64,12 @@ describe('LdnItemfiltersService test', () => {
|
||||
});
|
||||
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: of(endpointURL)
|
||||
getEndpoint: of(endpointURL),
|
||||
});
|
||||
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
||||
buildList: cold('a', { a: remoteDataMocks.Success })
|
||||
buildList: cold('a', { a: remoteDataMocks.Success }),
|
||||
});
|
||||
|
||||
|
||||
|
@@ -1,21 +1,23 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {dataService} from '../../../core/data/base/data-service.decorator';
|
||||
import {LDN_SERVICE_CONSTRAINT_FILTERS} from '../ldn-services-model/ldn-service.resource-type';
|
||||
import {IdentifiableDataService} from '../../../core/data/base/identifiable-data.service';
|
||||
import {FindAllData, FindAllDataImpl} from '../../../core/data/base/find-all-data';
|
||||
|
||||
import {RequestService} from '../../../core/data/request.service';
|
||||
import {RemoteDataBuildService} from '../../../core/cache/builders/remote-data-build.service';
|
||||
import {ObjectCacheService} from '../../../core/cache/object-cache.service';
|
||||
import {HALEndpointService} from '../../../core/shared/hal-endpoint.service';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||
import {FollowLinkConfig} from '../../../shared/utils/follow-link-config.model';
|
||||
import {Observable} from 'rxjs';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {Itemfilter} from '../ldn-services-model/ldn-service-itemfilters';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { dataService } from '../../../core/data/base/data-service.decorator';
|
||||
import {
|
||||
FindAllData,
|
||||
FindAllDataImpl,
|
||||
} from '../../../core/data/base/find-all-data';
|
||||
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||
import { LDN_SERVICE_CONSTRAINT_FILTERS } from '../ldn-services-model/ldn-service.resource-type';
|
||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||
|
||||
/**
|
||||
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
||||
|
@@ -1,116 +1,134 @@
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { RequestEntry } from '../../../core/data/request-entry.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestEntryState } from '../../../core/data/request-entry-state.model';
|
||||
import { cold, getTestScheduler } from 'jasmine-marbles';
|
||||
import { RestResponse } from '../../../core/cache/response.models';
|
||||
import {
|
||||
cold,
|
||||
getTestScheduler,
|
||||
} from 'jasmine-marbles';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { FindAllData } from '../../../core/data/base/find-all-data';
|
||||
import { testFindAllDataImplementation } from '../../../core/data/base/find-all-data.spec';
|
||||
import { LdnServicesService } from './ldn-services-data.service';
|
||||
import { testDeleteDataImplementation } from '../../../core/data/base/delete-data.spec';
|
||||
import { DeleteData } from '../../../core/data/base/delete-data';
|
||||
import { testSearchDataImplementation } from '../../../core/data/base/search-data.spec';
|
||||
import { SearchData } from '../../../core/data/base/search-data';
|
||||
import { testPatchDataImplementation } from '../../../core/data/base/patch-data.spec';
|
||||
import { PatchData } from '../../../core/data/base/patch-data';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { RestResponse } from '../../../core/cache/response.models';
|
||||
import { CreateData } from '../../../core/data/base/create-data';
|
||||
import { testCreateDataImplementation } from '../../../core/data/base/create-data.spec';
|
||||
import { DeleteData } from '../../../core/data/base/delete-data';
|
||||
import { testDeleteDataImplementation } from '../../../core/data/base/delete-data.spec';
|
||||
import { FindAllData } from '../../../core/data/base/find-all-data';
|
||||
import { testFindAllDataImplementation } from '../../../core/data/base/find-all-data.spec';
|
||||
import { PatchData } from '../../../core/data/base/patch-data';
|
||||
import { testPatchDataImplementation } from '../../../core/data/base/patch-data.spec';
|
||||
import { SearchData } from '../../../core/data/base/search-data';
|
||||
import { testSearchDataImplementation } from '../../../core/data/base/search-data.spec';
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
||||
import { mockLdnService } from '../ldn-service-serviceMock/ldnServicesRD$-mock';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RequestEntry } from '../../../core/data/request-entry.model';
|
||||
import { RequestEntryState } from '../../../core/data/request-entry-state.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
|
||||
import { mockLdnService } from '../ldn-service-serviceMock/ldnServicesRD$-mock';
|
||||
import { LdnServicesService } from './ldn-services-data.service';
|
||||
|
||||
describe('LdnServicesService test', () => {
|
||||
let scheduler: TestScheduler;
|
||||
let service: LdnServicesService;
|
||||
let requestService: RequestService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
let objectCache: ObjectCacheService;
|
||||
let halService: HALEndpointService;
|
||||
let notificationsService: NotificationsService;
|
||||
let responseCacheEntry: RequestEntry;
|
||||
let scheduler: TestScheduler;
|
||||
let service: LdnServicesService;
|
||||
let requestService: RequestService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
let objectCache: ObjectCacheService;
|
||||
let halService: HALEndpointService;
|
||||
let notificationsService: NotificationsService;
|
||||
let responseCacheEntry: RequestEntry;
|
||||
|
||||
const endpointURL = `https://rest.api/rest/api/ldn/ldnservices`;
|
||||
const requestUUID = '8b3c613a-5a4b-438b-9686-be1d5b4a1c5a';
|
||||
const endpointURL = `https://rest.api/rest/api/ldn/ldnservices`;
|
||||
const requestUUID = '8b3c613a-5a4b-438b-9686-be1d5b4a1c5a';
|
||||
|
||||
const remoteDataMocks = {
|
||||
Success: new RemoteData(null, null, null, RequestEntryState.Success, null, null, 200),
|
||||
};
|
||||
const remoteDataMocks = {
|
||||
Success: new RemoteData(null, null, null, RequestEntryState.Success, null, null, 200),
|
||||
};
|
||||
|
||||
function initTestService() {
|
||||
return new LdnServicesService(
|
||||
requestService,
|
||||
rdbService,
|
||||
objectCache,
|
||||
halService,
|
||||
notificationsService,
|
||||
);
|
||||
}
|
||||
function initTestService() {
|
||||
return new LdnServicesService(
|
||||
requestService,
|
||||
rdbService,
|
||||
objectCache,
|
||||
halService,
|
||||
notificationsService,
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
scheduler = getTestScheduler();
|
||||
beforeEach(() => {
|
||||
scheduler = getTestScheduler();
|
||||
|
||||
objectCache = {} as ObjectCacheService;
|
||||
notificationsService = {} as NotificationsService;
|
||||
responseCacheEntry = new RequestEntry();
|
||||
responseCacheEntry.request = { href: 'https://rest.api/' } as any;
|
||||
responseCacheEntry.response = new RestResponse(true, 200, 'Success');
|
||||
objectCache = {} as ObjectCacheService;
|
||||
notificationsService = {} as NotificationsService;
|
||||
responseCacheEntry = new RequestEntry();
|
||||
responseCacheEntry.request = { href: 'https://rest.api/' } as any;
|
||||
responseCacheEntry.response = new RestResponse(true, 200, 'Success');
|
||||
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
generateRequestId: requestUUID,
|
||||
send: true,
|
||||
removeByHrefSubstring: {},
|
||||
getByHref: observableOf(responseCacheEntry),
|
||||
getByUUID: observableOf(responseCacheEntry),
|
||||
});
|
||||
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: observableOf(endpointURL)
|
||||
});
|
||||
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
||||
buildList: cold('a', { a: remoteDataMocks.Success })
|
||||
});
|
||||
|
||||
|
||||
service = initTestService();
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
generateRequestId: requestUUID,
|
||||
send: true,
|
||||
removeByHrefSubstring: {},
|
||||
getByHref: observableOf(responseCacheEntry),
|
||||
getByUUID: observableOf(responseCacheEntry),
|
||||
});
|
||||
|
||||
describe('composition', () => {
|
||||
const initFindAllService = () => new LdnServicesService(null, null, null, null, null) as unknown as FindAllData<any>;
|
||||
const initDeleteService = () => new LdnServicesService(null, null, null, null, null) as unknown as DeleteData<any>;
|
||||
const initSearchService = () => new LdnServicesService(null, null, null, null, null) as unknown as SearchData<any>;
|
||||
const initPatchService = () => new LdnServicesService(null, null, null, null, null) as unknown as PatchData<any>;
|
||||
const initCreateService = () => new LdnServicesService(null, null, null, null, null) as unknown as CreateData<any>;
|
||||
|
||||
testFindAllDataImplementation(initFindAllService);
|
||||
testDeleteDataImplementation(initDeleteService);
|
||||
testSearchDataImplementation(initSearchService);
|
||||
testPatchDataImplementation(initPatchService);
|
||||
testCreateDataImplementation(initCreateService);
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: observableOf(endpointURL),
|
||||
});
|
||||
|
||||
describe('custom methods', () => {
|
||||
it('should find service by inbound pattern', (done) => {
|
||||
const params = [new RequestParam('pattern', 'testPattern')];
|
||||
const findListOptions = Object.assign(new FindListOptions(), {}, {searchParams: params});
|
||||
spyOn(service, 'searchBy').and.returnValue(observableOf(null));
|
||||
spyOn((service as any).searchData, 'searchBy').and.returnValue(createSuccessfulRemoteDataObject$(createPaginatedList([mockLdnService])));
|
||||
|
||||
service.findByInboundPattern('testPattern').subscribe(() => {
|
||||
expect(service.searchBy).toHaveBeenCalledWith('byInboundPattern', findListOptions, undefined, undefined );
|
||||
done();
|
||||
});
|
||||
});
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
||||
buildFromRequestUUID: createSuccessfulRemoteDataObject$({}, 500),
|
||||
buildList: cold('a', { a: remoteDataMocks.Success }),
|
||||
});
|
||||
|
||||
|
||||
service = initTestService();
|
||||
});
|
||||
|
||||
describe('composition', () => {
|
||||
const initFindAllService = () => new LdnServicesService(null, null, null, null, null) as unknown as FindAllData<any>;
|
||||
const initDeleteService = () => new LdnServicesService(null, null, null, null, null) as unknown as DeleteData<any>;
|
||||
const initSearchService = () => new LdnServicesService(null, null, null, null, null) as unknown as SearchData<any>;
|
||||
const initPatchService = () => new LdnServicesService(null, null, null, null, null) as unknown as PatchData<any>;
|
||||
const initCreateService = () => new LdnServicesService(null, null, null, null, null) as unknown as CreateData<any>;
|
||||
|
||||
testFindAllDataImplementation(initFindAllService);
|
||||
testDeleteDataImplementation(initDeleteService);
|
||||
testSearchDataImplementation(initSearchService);
|
||||
testPatchDataImplementation(initPatchService);
|
||||
testCreateDataImplementation(initCreateService);
|
||||
});
|
||||
|
||||
describe('custom methods', () => {
|
||||
it('should find service by inbound pattern', (done) => {
|
||||
const params = [new RequestParam('pattern', 'testPattern')];
|
||||
const findListOptions = Object.assign(new FindListOptions(), {}, { searchParams: params });
|
||||
spyOn(service, 'searchBy').and.returnValue(observableOf(null));
|
||||
spyOn((service as any).searchData, 'searchBy').and.returnValue(createSuccessfulRemoteDataObject$(createPaginatedList([mockLdnService])));
|
||||
|
||||
service.findByInboundPattern('testPattern').subscribe(() => {
|
||||
expect(service.searchBy).toHaveBeenCalledWith('byInboundPattern', findListOptions, undefined, undefined );
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should invoke service', (done) => {
|
||||
const constraints = [{ void: true }];
|
||||
const files = [new File([],'fileName')];
|
||||
spyOn(service as any, 'getInvocationFormData');
|
||||
spyOn(service, 'getBrowseEndpoint').and.returnValue(observableOf('testEndpoint'));
|
||||
service.invoke('serviceName', 'serviceId', constraints, files).subscribe(result => {
|
||||
expect((service as any).getInvocationFormData).toHaveBeenCalledWith(constraints, files);
|
||||
expect(service.getBrowseEndpoint).toHaveBeenCalled();
|
||||
expect(result).toBeInstanceOf(RemoteData);
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -1,36 +1,49 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {dataService} from '../../../core/data/base/data-service.decorator';
|
||||
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
||||
import {IdentifiableDataService} from '../../../core/data/base/identifiable-data.service';
|
||||
import {FindAllData, FindAllDataImpl} from '../../../core/data/base/find-all-data';
|
||||
import {DeleteData, DeleteDataImpl} from '../../../core/data/base/delete-data';
|
||||
import {RequestService} from '../../../core/data/request.service';
|
||||
import {RemoteDataBuildService} from '../../../core/cache/builders/remote-data-build.service';
|
||||
import {ObjectCacheService} from '../../../core/cache/object-cache.service';
|
||||
import {HALEndpointService} from '../../../core/shared/hal-endpoint.service';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||
import {FollowLinkConfig} from '../../../shared/utils/follow-link-config.model';
|
||||
import {Observable} from 'rxjs';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||
import {NoContent} from '../../../core/shared/NoContent.model';
|
||||
import {map, take} from 'rxjs/operators';
|
||||
import {URLCombiner} from '../../../core/url-combiner/url-combiner';
|
||||
import {MultipartPostRequest} from '../../../core/data/request.models';
|
||||
import {RestRequest} from '../../../core/data/rest-request.model';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { Observable } from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
take,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
|
||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
|
||||
import {PatchData, PatchDataImpl} from '../../../core/data/base/patch-data';
|
||||
import {ChangeAnalyzer} from '../../../core/data/change-analyzer';
|
||||
import {Operation} from 'fast-json-patch';
|
||||
import {RestRequestMethod} from '../../../core/data/rest-request-method';
|
||||
import {CreateData, CreateDataImpl} from '../../../core/data/base/create-data';
|
||||
import {LdnServiceConstrain} from '../ldn-services-model/ldn-service.constrain.model';
|
||||
import {SearchDataImpl} from '../../../core/data/base/search-data';
|
||||
import {RequestParam} from '../../../core/cache/models/request-param.model';
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import {
|
||||
CreateData,
|
||||
CreateDataImpl,
|
||||
} from '../../../core/data/base/create-data';
|
||||
import { dataService } from '../../../core/data/base/data-service.decorator';
|
||||
import {
|
||||
DeleteData,
|
||||
DeleteDataImpl,
|
||||
} from '../../../core/data/base/delete-data';
|
||||
import {
|
||||
FindAllData,
|
||||
FindAllDataImpl,
|
||||
} from '../../../core/data/base/find-all-data';
|
||||
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
||||
import {
|
||||
PatchData,
|
||||
PatchDataImpl,
|
||||
} from '../../../core/data/base/patch-data';
|
||||
import { SearchDataImpl } from '../../../core/data/base/search-data';
|
||||
import { ChangeAnalyzer } from '../../../core/data/change-analyzer';
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { MultipartPostRequest } from '../../../core/data/request.models';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RestRequest } from '../../../core/data/rest-request.model';
|
||||
import { RestRequestMethod } from '../../../core/data/rest-request-method';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||
import { LdnServiceConstrain } from '../ldn-services-model/ldn-service.constrain.model';
|
||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
|
||||
/**
|
||||
* Injectable service responsible for fetching/sending data from/to the REST API on the ldnservices endpoint.
|
||||
@@ -147,7 +160,7 @@ export class LdnServicesService extends IdentifiableDataService<LdnService> impl
|
||||
*/
|
||||
findByInboundPattern(pattern: string, options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<LdnService>[]): Observable<RemoteData<PaginatedList<LdnService>>> {
|
||||
const params = [new RequestParam('pattern', pattern)];
|
||||
const findListOptions = Object.assign(new FindListOptions(), options, {searchParams: params});
|
||||
const findListOptions = Object.assign(new FindListOptions(), options, { searchParams: params });
|
||||
return this.searchBy(this.findByPatternEndpoint, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
||||
}
|
||||
|
||||
@@ -200,7 +213,7 @@ export class LdnServicesService extends IdentifiableDataService<LdnService> impl
|
||||
map((endpoint: string) => {
|
||||
const body = this.getInvocationFormData(parameters, files);
|
||||
return new MultipartPostRequest(requestId, endpoint, body);
|
||||
})
|
||||
}),
|
||||
).subscribe((request: RestRequest) => this.requestService.send(request));
|
||||
|
||||
return this.rdbService.buildFromRequestUUID<LdnService>(requestId);
|
||||
|
@@ -1,19 +1,32 @@
|
||||
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
|
||||
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service.stub';
|
||||
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||
import {PaginationService} from '../../../core/pagination/pagination.service';
|
||||
import {PaginationServiceStub} from '../../../shared/testing/pagination-service.stub';
|
||||
import {of} from 'rxjs';
|
||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||
import {RemoteData} from '../../../core/data/remote-data';
|
||||
import {LdnServicesOverviewComponent} from './ldn-services-directory.component';
|
||||
import {createSuccessfulRemoteDataObject$} from '../../../shared/remote-data.utils';
|
||||
import {createPaginatedList} from '../../../shared/testing/utils.test';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
EventEmitter,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
TestBed,
|
||||
tick,
|
||||
} from '@angular/core/testing';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory.component';
|
||||
|
||||
describe('LdnServicesOverviewComponent', () => {
|
||||
let component: LdnServicesOverviewComponent;
|
||||
@@ -21,37 +34,40 @@ describe('LdnServicesOverviewComponent', () => {
|
||||
let ldnServicesService;
|
||||
let paginationService;
|
||||
let modalService: NgbModal;
|
||||
let notificationsService: NotificationsService;
|
||||
let translateService: TranslateService;
|
||||
|
||||
const translateServiceStub = {
|
||||
get: () => of('translated-text'),
|
||||
onLangChange: new EventEmitter(),
|
||||
onTranslationChange: new EventEmitter(),
|
||||
onDefaultLangChange: new EventEmitter()
|
||||
onDefaultLangChange: new EventEmitter(),
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
paginationService = new PaginationServiceStub();
|
||||
ldnServicesService = jasmine.createSpyObj('LdnServicesService', ['findAll', 'delete', 'patch']);
|
||||
ldnServicesService = jasmine.createSpyObj('ldnServicesService', {
|
||||
'findAll': createSuccessfulRemoteDataObject$({}),
|
||||
'delete': createSuccessfulRemoteDataObject$({}),
|
||||
'patch': createSuccessfulRemoteDataObject$({}),
|
||||
});
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: LdnServicesService,
|
||||
useValue: ldnServicesService
|
||||
useValue: ldnServicesService,
|
||||
},
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{
|
||||
provide: NgbModal, useValue: {
|
||||
open: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{ provide: ChangeDetectorRef, useValue: {} },
|
||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
{ provide: TranslateService, useValue: translateServiceStub },
|
||||
]
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
@@ -61,10 +77,8 @@ describe('LdnServicesOverviewComponent', () => {
|
||||
ldnServicesService = TestBed.inject(LdnServicesService);
|
||||
paginationService = TestBed.inject(PaginationService);
|
||||
modalService = TestBed.inject(NgbModal);
|
||||
notificationsService = TestBed.inject(NotificationsService);
|
||||
translateService = TestBed.inject(TranslateService);
|
||||
component.modalRef = jasmine.createSpyObj({close: null});
|
||||
component.isProcessingSub = jasmine.createSpyObj({unsubscribe: null});
|
||||
component.modalRef = jasmine.createSpyObj({ close: null });
|
||||
component.isProcessingSub = jasmine.createSpyObj({ unsubscribe: null });
|
||||
component.ldnServicesRD$ = of({} as RemoteData<PaginatedList<LdnService>>);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -84,9 +98,9 @@ describe('LdnServicesOverviewComponent', () => {
|
||||
it('should set ldnServicesRD$ with mock data', fakeAsync(() => {
|
||||
spyOn(component, 'setLdnServices').and.callThrough();
|
||||
const testData: LdnService[] = Object.assign([new LdnService()], [
|
||||
{id: 1, name: 'Service 1', description: 'Description 1', enabled: true},
|
||||
{id: 2, name: 'Service 2', description: 'Description 2', enabled: false},
|
||||
{id: 3, name: 'Service 3', description: 'Description 3', enabled: true}]);
|
||||
{ id: 1, name: 'Service 1', description: 'Description 1', enabled: true },
|
||||
{ id: 2, name: 'Service 2', description: 'Description 2', enabled: false },
|
||||
{ id: 3, name: 'Service 3', description: 'Description 3', enabled: true }]);
|
||||
|
||||
const mockLdnServicesRD = createPaginatedList(testData);
|
||||
component.ldnServicesRD$ = createSuccessfulRemoteDataObject$(mockLdnServicesRD);
|
||||
@@ -140,4 +154,22 @@ describe('LdnServicesOverviewComponent', () => {
|
||||
expect(deleteSpy).toHaveBeenCalledWith(serviceId);
|
||||
}));
|
||||
});
|
||||
|
||||
describe('selectServiceToDelete', () => {
|
||||
it('should set service to delete', fakeAsync(() => {
|
||||
spyOn(component, 'openDeleteModal');
|
||||
const serviceId = 123;
|
||||
component.selectServiceToDelete(serviceId);
|
||||
expect(component.selectedServiceId).toEqual(serviceId);
|
||||
expect(component.openDeleteModal).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
describe('toggleStatus', () => {
|
||||
it('should toggle status', (() => {
|
||||
component.toggleStatus({ enabled: false }, ldnServicesService);
|
||||
expect(ldnServicesService.patch).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -5,29 +5,30 @@ import {
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import {Observable, Subscription} from 'rxjs';
|
||||
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 {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
import {PaginationComponentOptions} from '../../../shared/pagination/pagination-component-options.model';
|
||||
import {map, switchMap} from 'rxjs/operators';
|
||||
import {LdnServicesService} from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||
import {PaginationService} from 'src/app/core/pagination/pagination.service';
|
||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||
import {hasValue} from '../../../shared/empty.util';
|
||||
import {Operation} from 'fast-json-patch';
|
||||
import {getFirstCompletedRemoteData} from '../../../core/shared/operators';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { Observable, Subscription, } from 'rxjs';
|
||||
import { map, switchMap, } from 'rxjs/operators';
|
||||
import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||
import { PaginationService } from 'src/app/core/pagination/pagination.service';
|
||||
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
||||
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
|
||||
/**
|
||||
* The `LdnServicesOverviewComponent` is a component that provides an overview of LDN (Linked Data Notifications) services.
|
||||
@@ -55,14 +56,14 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
|
||||
selectedServiceId: string | number | null = null;
|
||||
servicesData: any[] = [];
|
||||
@ViewChild('deleteModal', {static: true}) deleteModal: TemplateRef<any>;
|
||||
@ViewChild('deleteModal', { static: true }) deleteModal: TemplateRef<any>;
|
||||
ldnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>>;
|
||||
config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||
elementsPerPage: 10
|
||||
elementsPerPage: 10,
|
||||
});
|
||||
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'po',
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
});
|
||||
isProcessingSub: Subscription;
|
||||
modalRef: any;
|
||||
@@ -88,8 +89,8 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
setLdnServices() {
|
||||
this.ldnServicesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
|
||||
switchMap((config) => this.ldnServicesService.findAll(config, false, false).pipe(
|
||||
getFirstCompletedRemoteData()
|
||||
))
|
||||
getFirstCompletedRemoteData(),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -144,7 +145,7 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
remoteData.payload.page = remoteData.payload.page.filter(service => service.id.toString() !== serviceId);
|
||||
}
|
||||
return remoteData;
|
||||
})
|
||||
}),
|
||||
);
|
||||
this.cdRef.detectChanges();
|
||||
this.closeModal();
|
||||
@@ -186,7 +187,7 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
this.notificationService.error(this.translateService.get('ldn-enable-service.notification.error.title'),
|
||||
this.translateService.get('ldn-enable-service.notification.error.content'));
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,14 @@
|
||||
import {autoserialize, deserialize, inheritSerialization} from 'cerialize';
|
||||
import {LDN_SERVICE_CONSTRAINT_FILTER} from './ldn-service.resource-type';
|
||||
import {CacheableObject} from '../../../core/cache/cacheable-object.model';
|
||||
import {typedObject} from '../../../core/cache/builders/build-decorators';
|
||||
import {excludeFromEquals} from '../../../core/utilities/equals.decorators';
|
||||
import {ResourceType} from '../../../core/shared/resource-type';
|
||||
import {
|
||||
autoserialize,
|
||||
deserialize,
|
||||
inheritSerialization,
|
||||
} from 'cerialize';
|
||||
|
||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
||||
import { ResourceType } from '../../../core/shared/resource-type';
|
||||
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
||||
import { LDN_SERVICE_CONSTRAINT_FILTER } from './ldn-service.resource-type';
|
||||
|
||||
/** A single filter value and its properties. */
|
||||
@typedObject
|
||||
@@ -13,13 +18,13 @@ export class Itemfilter extends CacheableObject {
|
||||
|
||||
@excludeFromEquals
|
||||
@autoserialize
|
||||
type: ResourceType;
|
||||
type: ResourceType;
|
||||
|
||||
@autoserialize
|
||||
id: string;
|
||||
id: string;
|
||||
|
||||
@deserialize
|
||||
_links: {
|
||||
_links: {
|
||||
self: {
|
||||
href: string;
|
||||
};
|
||||
|
@@ -1,13 +1,13 @@
|
||||
import {autoserialize} from 'cerialize';
|
||||
import { autoserialize } from 'cerialize';
|
||||
|
||||
/**
|
||||
* A single notify service pattern and his properties
|
||||
*/
|
||||
export class NotifyServicePattern {
|
||||
@autoserialize
|
||||
pattern: string;
|
||||
pattern: string;
|
||||
@autoserialize
|
||||
constraint: string;
|
||||
constraint: string;
|
||||
@autoserialize
|
||||
automatic: string;
|
||||
automatic: string;
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* Needs to be in a separate file to prevent circular
|
||||
* dependencies in webpack.
|
||||
*/
|
||||
import {ResourceType} from '../../../core/shared/resource-type';
|
||||
import { ResourceType } from '../../../core/shared/resource-type';
|
||||
|
||||
export const LDN_SERVICE = new ResourceType('ldnservice');
|
||||
export const LDN_SERVICE_CONSTRAINT_FILTERS = new ResourceType('itemfilters');
|
||||
|
@@ -1,11 +1,16 @@
|
||||
import {ResourceType} from '../../../core/shared/resource-type';
|
||||
import {CacheableObject} from '../../../core/cache/cacheable-object.model';
|
||||
import {autoserialize, deserialize, deserializeAs, inheritSerialization} from 'cerialize';
|
||||
import {LDN_SERVICE} from './ldn-service.resource-type';
|
||||
import {excludeFromEquals} from '../../../core/utilities/equals.decorators';
|
||||
import {typedObject} from '../../../core/cache/builders/build-decorators';
|
||||
import {NotifyServicePattern} from './ldn-service-patterns.model';
|
||||
import {
|
||||
autoserialize,
|
||||
deserialize,
|
||||
deserializeAs,
|
||||
inheritSerialization,
|
||||
} from 'cerialize';
|
||||
|
||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
||||
import { ResourceType } from '../../../core/shared/resource-type';
|
||||
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
||||
import { LDN_SERVICE } from './ldn-service.resource-type';
|
||||
import { NotifyServicePattern } from './ldn-service-patterns.model';
|
||||
|
||||
/**
|
||||
* LDN Services bounded to each selected pattern, relation set in service creation
|
||||
@@ -24,43 +29,43 @@ export class LdnService extends CacheableObject {
|
||||
|
||||
@excludeFromEquals
|
||||
@autoserialize
|
||||
type: ResourceType;
|
||||
type: ResourceType;
|
||||
|
||||
@autoserialize
|
||||
id: number;
|
||||
id: number;
|
||||
|
||||
@deserializeAs('id')
|
||||
uuid: string;
|
||||
uuid: string;
|
||||
|
||||
@autoserialize
|
||||
name: string;
|
||||
name: string;
|
||||
|
||||
@autoserialize
|
||||
description: string;
|
||||
description: string;
|
||||
|
||||
@autoserialize
|
||||
url: string;
|
||||
url: string;
|
||||
|
||||
@autoserialize
|
||||
score: number;
|
||||
score: number;
|
||||
|
||||
@autoserialize
|
||||
enabled: boolean;
|
||||
enabled: boolean;
|
||||
|
||||
@autoserialize
|
||||
ldnUrl: string;
|
||||
ldnUrl: string;
|
||||
|
||||
@autoserialize
|
||||
lowerIp: string;
|
||||
lowerIp: string;
|
||||
|
||||
@autoserialize
|
||||
upperIp: string;
|
||||
upperIp: string;
|
||||
|
||||
@autoserialize
|
||||
notifyServiceInboundPatterns?: NotifyServicePattern[];
|
||||
notifyServiceInboundPatterns?: NotifyServicePattern[];
|
||||
|
||||
@deserialize
|
||||
_links: {
|
||||
_links: {
|
||||
self: {
|
||||
href: string;
|
||||
};
|
||||
|
@@ -1,5 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||
import {
|
||||
ActivatedRouteSnapshot,
|
||||
Resolve,
|
||||
RouterStateSnapshot,
|
||||
} from '@angular/router';
|
||||
|
||||
/**
|
||||
* Interface for the route parameters.
|
||||
@@ -26,7 +30,7 @@ export class NotificationsSuggestionTargetsPageResolver implements Resolve<Notif
|
||||
return {
|
||||
pageId: route.queryParams.pageId,
|
||||
pageSize: parseInt(route.queryParams.pageSize, 10),
|
||||
currentPage: parseInt(route.queryParams.page, 10)
|
||||
currentPage: parseInt(route.queryParams.page, 10),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,13 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
NotificationsSuggestionTargetsPageComponent
|
||||
} from '../../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component';
|
||||
async,
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { NotificationsSuggestionTargetsPageComponent } from '../../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component';
|
||||
|
||||
describe('NotificationsSuggestionTargetsPageComponent', () => {
|
||||
let component: NotificationsSuggestionTargetsPageComponent;
|
||||
@@ -16,12 +18,12 @@ describe('NotificationsSuggestionTargetsPageComponent', () => {
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule.forRoot(),
|
||||
NotificationsSuggestionTargetsPageComponent
|
||||
NotificationsSuggestionTargetsPageComponent,
|
||||
],
|
||||
providers: [
|
||||
NotificationsSuggestionTargetsPageComponent
|
||||
NotificationsSuggestionTargetsPageComponent,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -0,0 +1,59 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { NotifyInfoGuard } from '../../core/coar-notify/notify-info/notify-info.guard';
|
||||
import { SiteAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||
import { AdminNotifyIncomingComponent } from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component';
|
||||
import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard],
|
||||
path: '',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyDashboardComponent,
|
||||
pathMatch: 'full',
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'inbound',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyIncomingComponent,
|
||||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard],
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'outbound',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyOutgoingComponent,
|
||||
canActivate: [SiteAdministratorGuard, NotifyInfoGuard],
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
},
|
||||
},
|
||||
]),
|
||||
],
|
||||
})
|
||||
/**
|
||||
* Routing module for the Notifications section of the admin sidebar
|
||||
*/
|
||||
export class AdminNotifyDashboardRoutingModule {
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1>
|
||||
<div class="my-4">{{'admin-notify-dashboard.description' | translate}}</div>
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active">{{'admin-notify-dashboard.metrics' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'inbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'outbound'" [queryParams]="{view: 'table'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
|
||||
</ul>
|
||||
<div class="mt-2">
|
||||
<ds-admin-notify-metrics *ngIf="(notifyMetricsRows$ | async)?.length" [boxesConfig]="notifyMetricsRows$ | async"></ds-admin-notify-metrics>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,60 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { buildPaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { SearchService } from '../../core/shared/search/search.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||
import { AdminNotifyMessage } from './models/admin-notify-message.model';
|
||||
import { AdminNotifySearchResult } from './models/admin-notify-message-search-result.model';
|
||||
|
||||
describe('AdminNotifyDashboardComponent', () => {
|
||||
let component: AdminNotifyDashboardComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyDashboardComponent>;
|
||||
|
||||
let item1;
|
||||
let item2;
|
||||
let item3;
|
||||
let searchResult1;
|
||||
let searchResult2;
|
||||
let searchResult3;
|
||||
let results;
|
||||
|
||||
const mockBoxes = [
|
||||
{ title: 'admin-notify-dashboard.received-ldn', boxes: [ undefined, undefined, undefined, undefined, undefined ] },
|
||||
{ title: 'admin-notify-dashboard.generated-ldn', boxes: [ undefined, undefined, undefined, undefined, undefined ] },
|
||||
];
|
||||
|
||||
beforeEach(async () => {
|
||||
item1 = Object.assign(new AdminNotifyMessage(), { uuid: 'e1c51c69-896d-42dc-8221-1d5f2ad5516e' });
|
||||
item2 = Object.assign(new AdminNotifyMessage(), { uuid: 'c8279647-1acc-41ae-b036-951d5f65649b' });
|
||||
item3 = Object.assign(new AdminNotifyMessage(), { uuid: 'c3bcbff5-ec0c-4831-8e4c-94b9c933ccac' });
|
||||
searchResult1 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item1 });
|
||||
searchResult2 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item2 });
|
||||
searchResult3 = Object.assign(new AdminNotifySearchResult(), { indexableObject: item3 });
|
||||
results = buildPaginatedList(undefined, [searchResult1, searchResult2, searchResult3]);
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), NgbNavModule],
|
||||
declarations: [ AdminNotifyDashboardComponent ],
|
||||
providers: [{ provide: SearchService, useValue: { search: () => createSuccessfulRemoteDataObject$(results) } }],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyDashboardComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', (done) => {
|
||||
component.notifyMetricsRows$.subscribe(boxes => {
|
||||
expect(boxes).toEqual(mockBoxes);
|
||||
done();
|
||||
});
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,104 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
forkJoin,
|
||||
Observable,
|
||||
} from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
import { SearchService } from '../../core/shared/search/search.service';
|
||||
import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../my-dspace-page/my-dspace-page.component';
|
||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||
import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model';
|
||||
import { SearchObjects } from '../../shared/search/models/search-objects.model';
|
||||
import {
|
||||
AdminNotifyMetricsBox,
|
||||
AdminNotifyMetricsRow,
|
||||
} from './admin-notify-metrics/admin-notify-metrics.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-dashboard',
|
||||
templateUrl: './admin-notify-dashboard.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
* Component used for visual representation and search of LDN messages for Admins
|
||||
*/
|
||||
export class AdminNotifyDashboardComponent implements OnInit{
|
||||
|
||||
public notifyMetricsRows$: Observable<AdminNotifyMetricsRow[]>;
|
||||
|
||||
private metricsConfig = environment.notifyMetrics;
|
||||
private singleResultOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'single-result-options',
|
||||
pageSize: 1,
|
||||
});
|
||||
|
||||
constructor(private searchService: SearchService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const mertricsRowsConfigurations = this.metricsConfig
|
||||
.map(row => row.boxes)
|
||||
.map(boxes => boxes.map(box => box.config).filter(config => !!config));
|
||||
const flatConfigurations = [].concat(...mertricsRowsConfigurations.map((config) => config));
|
||||
const searchConfigurations = flatConfigurations
|
||||
.map(config => Object.assign(new PaginatedSearchOptions({}),
|
||||
{ configuration: config, pagination: this.singleResultOptions },
|
||||
));
|
||||
|
||||
this.notifyMetricsRows$ = forkJoin(searchConfigurations.map(config => this.searchService.search(config)
|
||||
.pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
map(response => this.mapSearchObjectsToMetricsBox(response.payload)),
|
||||
),
|
||||
),
|
||||
).pipe(
|
||||
map(metricBoxes => this.mapUpdatedBoxesToMetricsRows(metricBoxes)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to map received SearchObjects to notify boxes config
|
||||
*
|
||||
* @param searchObject The object to map
|
||||
* @private
|
||||
*/
|
||||
private mapSearchObjectsToMetricsBox(searchObject: SearchObjects<DSpaceObject>): AdminNotifyMetricsBox {
|
||||
const count = searchObject.pageInfo.totalElements;
|
||||
const objectConfig = searchObject.configuration;
|
||||
const metricsBoxes = [].concat(...this.metricsConfig.map((config) => config.boxes));
|
||||
|
||||
return {
|
||||
...metricsBoxes.find(box => box.config === objectConfig),
|
||||
count,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to map updated boxes with count to each row of the configuration
|
||||
*
|
||||
* @param boxesWithCount The object to map
|
||||
* @private
|
||||
*/
|
||||
private mapUpdatedBoxesToMetricsRows(boxesWithCount: AdminNotifyMetricsBox[]): AdminNotifyMetricsRow[] {
|
||||
return this.metricsConfig.map(row => {
|
||||
return {
|
||||
...row,
|
||||
boxes: row.boxes.map(rowBox => boxesWithCount.find(boxWithCount => boxWithCount.config === rowBox.config)),
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
CommonModule,
|
||||
DatePipe,
|
||||
} from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { SearchPageModule } from '../../search-page/search-page.module';
|
||||
import { SearchModule } from '../../shared/search/search.module';
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||
import { AdminNotifyDashboardRoutingModule } from './admin-notify-dashboard-routing.module';
|
||||
import { AdminNotifyDetailModalComponent } from './admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||
import { AdminNotifyIncomingComponent } from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component';
|
||||
import { AdminNotifyLogsResultComponent } from './admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component';
|
||||
import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component';
|
||||
import { AdminNotifyMetricsComponent } from './admin-notify-metrics/admin-notify-metrics.component';
|
||||
import { AdminNotifySearchResultComponent } from './admin-notify-search-result/admin-notify-search-result.component';
|
||||
import { AdminNotifyMessagesService } from './services/admin-notify-messages.service';
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
AdminNotifySearchResultComponent,
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
SharedModule,
|
||||
AdminNotifyDashboardRoutingModule,
|
||||
SearchModule,
|
||||
SearchPageModule,
|
||||
],
|
||||
providers: [
|
||||
AdminNotifyMessagesService,
|
||||
DatePipe,
|
||||
],
|
||||
declarations: [
|
||||
...ENTRY_COMPONENTS,
|
||||
AdminNotifyDashboardComponent,
|
||||
AdminNotifyMetricsComponent,
|
||||
AdminNotifyIncomingComponent,
|
||||
AdminNotifyOutgoingComponent,
|
||||
AdminNotifyDetailModalComponent,
|
||||
AdminNotifySearchResultComponent,
|
||||
AdminNotifyLogsResultComponent,
|
||||
],
|
||||
})
|
||||
export class AdminNotifyDashboardModule {
|
||||
static withEntryComponents() {
|
||||
return {
|
||||
ngModule: AdminNotifyDashboardModule,
|
||||
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">{{'notify-message-modal.title' | translate}}</h4>
|
||||
<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<div *ngFor="let key of notifyMessageKeys">
|
||||
<div class="row mb-4">
|
||||
<div class="font-weight-bold col">{{ key + '.notify-detail-modal' | translate}}</div>
|
||||
<div class="col text-right">{{'notify-detail-modal.' + notifyMessage[key] | translate: {default: notifyMessage[key] ?? "n/a" } }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn-primary" (click)="toggleCoarMessage()">
|
||||
{{'notify-message-modal.show-message' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<pre @fadeIn [innerHTML]="notifyMessage.message" class="bg-secondary text-white mt-2 p-2" *ngIf="isCoarMessageVisible"></pre>
|
||||
</div>
|
@@ -0,0 +1,39 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { AdminNotifyDetailModalComponent } from './admin-notify-detail-modal.component';
|
||||
|
||||
describe('AdminNotifyDetailModalComponent', () => {
|
||||
let component: AdminNotifyDetailModalComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyDetailModalComponent>;
|
||||
const modalStub = jasmine.createSpyObj('modalStub', ['close']);
|
||||
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifyDetailModalComponent ],
|
||||
providers: [{ provide: NgbActiveModal, useValue: modalStub }],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyDetailModalComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should close', () => {
|
||||
spyOn(component.response, 'emit');
|
||||
component.closeModal();
|
||||
expect(modalStub.close).toHaveBeenCalled();
|
||||
expect(component.response.emit).toHaveBeenCalledWith(true);
|
||||
});
|
||||
});
|
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
Input,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { fadeIn } from '../../../shared/animations/fade';
|
||||
import { MissingTranslationHelper } from '../../../shared/translate/missing-translation.helper';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-detail-modal',
|
||||
templateUrl: './admin-notify-detail-modal.component.html',
|
||||
animations: [
|
||||
fadeIn,
|
||||
],
|
||||
})
|
||||
/**
|
||||
* Component for detailed view of LDN messages displayed in search result in AdminNotifyDashboardComponent
|
||||
*/
|
||||
|
||||
export class AdminNotifyDetailModalComponent {
|
||||
@Input() notifyMessage: AdminNotifyMessage;
|
||||
@Input() notifyMessageKeys: string[];
|
||||
|
||||
/**
|
||||
* An event fired when the modal is closed
|
||||
*/
|
||||
@Output()
|
||||
response = new EventEmitter<boolean>();
|
||||
|
||||
public isCoarMessageVisible = false;
|
||||
|
||||
|
||||
constructor(protected activeModal: NgbActiveModal,
|
||||
public translationsService: TranslateService) {
|
||||
this.translationsService.missingTranslationHandler = new MissingTranslationHelper();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Close the modal and set the response to true so RootComponent knows the modal was closed
|
||||
*/
|
||||
closeModal() {
|
||||
this.activeModal.close();
|
||||
this.response.emit(true);
|
||||
}
|
||||
|
||||
toggleCoarMessage() {
|
||||
this.isCoarMessageVisible = !this.isCoarMessageVisible;
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1>
|
||||
<div>
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'../outbound'" [queryParams]="{view: 'table', configuration: 'NOTIFY.outgoing'}">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
|
||||
</ul>
|
||||
|
||||
<ds-admin-notify-logs-result [defaultConfiguration]="'NOTIFY.incoming'" ></ds-admin-notify-logs-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,61 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service';
|
||||
import { RequestService } from '../../../../core/data/request.service';
|
||||
import { RouteService } from '../../../../core/services/route.service';
|
||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
||||
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||
import { AdminNotifyIncomingComponent } from './admin-notify-incoming.component';
|
||||
|
||||
describe('AdminNotifyIncomingComponent', () => {
|
||||
let component: AdminNotifyIncomingComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyIncomingComponent>;
|
||||
let halService: HALEndpointService;
|
||||
let requestService: RequestService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
|
||||
|
||||
|
||||
beforeEach(async () => {
|
||||
rdbService = getMockRemoteDataBuildService();
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
'getRootHref': '/api',
|
||||
});
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
'generateRequestId': 'client/1234',
|
||||
'send': '',
|
||||
});
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifyIncomingComponent ],
|
||||
providers: [
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: SearchConfigurationService },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: ActivatedRoute, useValue: new MockActivatedRoute() },
|
||||
{ provide: HALEndpointService, useValue: halService },
|
||||
{ provide: RequestService, useValue: requestService },
|
||||
{ provide: RemoteDataBuildService, useValue: rdbService },
|
||||
provideMockStore({}),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyIncomingComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
} from '@angular/core';
|
||||
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-incoming',
|
||||
templateUrl: './admin-notify-incoming.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AdminNotifyIncomingComponent {
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService) {
|
||||
}
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-3 text-left h4">{{((isInbound$ | async) ? 'admin.notify.dashboard.inbound' : 'admin.notify.dashboard.outbound') | translate}}</div>
|
||||
<div class="col-md-9">
|
||||
<div class="h4">
|
||||
<button (click)="resetDefaultConfiguration()" *ngIf="(selectedSearchConfig$ | async) !== defaultConfiguration" class="badge badge-primary mr-1 mb-1">
|
||||
{{ 'admin-notify-logs.' + (selectedSearchConfig$ | async) | translate}}
|
||||
<span> ×</span>
|
||||
</button>
|
||||
</div>
|
||||
<ds-search-labels [inPlaceSearch]="true"></ds-search-labels>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<ds-themed-search
|
||||
[configuration]="selectedSearchConfig$ | async"
|
||||
[showViewModes]="false"
|
||||
[searchEnabled]="false"
|
||||
[context]="context"
|
||||
></ds-themed-search>
|
||||
</div>
|
||||
|
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../../core/cache/object-cache.service';
|
||||
import { RequestService } from '../../../../core/data/request.service';
|
||||
import { RouteService } from '../../../../core/services/route.service';
|
||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||
import { AdminNotifyLogsResultComponent } from './admin-notify-logs-result.component';
|
||||
|
||||
describe('AdminNotifyLogsResultComponent', () => {
|
||||
let component: AdminNotifyLogsResultComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyLogsResultComponent>;
|
||||
let objectCache: ObjectCacheService;
|
||||
let requestService: RequestService;
|
||||
let halService: HALEndpointService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifyLogsResultComponent ],
|
||||
providers: [
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
{ provide: ActivatedRoute, useValue: new MockActivatedRoute() },
|
||||
{ provide: HALEndpointService, useValue: halService },
|
||||
{ provide: ObjectCacheService, useValue: objectCache },
|
||||
{ provide: RequestService, useValue: requestService },
|
||||
{ provide: RemoteDataBuildService, useValue: rdbService },
|
||||
provideMockStore({}),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyLogsResultComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,84 @@
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
Inject,
|
||||
Input,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
ActivatedRouteSnapshot,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-logs-result',
|
||||
templateUrl: './admin-notify-logs-result.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
* Component for visualization of search page and related results for the logs of the Notify dashboard
|
||||
*/
|
||||
|
||||
export class AdminNotifyLogsResultComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
defaultConfiguration: string;
|
||||
|
||||
|
||||
public selectedSearchConfig$: Observable<string>;
|
||||
public isInbound$: Observable<boolean>;
|
||||
|
||||
protected readonly context = Context.CoarNotify;
|
||||
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
protected cdRef: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.selectedSearchConfig$ = this.searchConfigService.getCurrentConfiguration(this.defaultConfiguration);
|
||||
this.isInbound$ = this.selectedSearchConfig$.pipe(
|
||||
map(config => config.startsWith('NOTIFY.incoming')),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset route state to default configuration
|
||||
*/
|
||||
public resetDefaultConfiguration() {
|
||||
//Idle navigation to trigger rendering of result on same page
|
||||
this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
|
||||
this.router.navigate([this.getResolvedUrl(this.route.snapshot)], {
|
||||
queryParams: {
|
||||
configuration: this.defaultConfiguration,
|
||||
view: ViewMode.Table,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resolved url from route
|
||||
*
|
||||
* @param route url path
|
||||
* @returns url path
|
||||
*/
|
||||
private getResolvedUrl(route: ActivatedRouteSnapshot): string {
|
||||
return route.pathFromRoot.map(v => v.url.map(segment => segment.toString()).join('/')).join('/');
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="border-bottom pb-2">{{'admin-notify-dashboard.title'| translate}}</h1>
|
||||
<div>
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'../'">{{'admin-notify-dashboard.metrics' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" [routerLink]="'../inbound'" [queryParams]="{view: 'table', configuration: 'NOTIFY.incoming'}">{{'admin.notify.dashboard.inbound-logs' | translate}}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active">{{'admin.notify.dashboard.outbound-logs' | translate}}</a>
|
||||
</ul>
|
||||
|
||||
<ds-admin-notify-logs-result [defaultConfiguration]="'NOTIFY.outgoing'" ></ds-admin-notify-logs-result>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,60 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../../core/cache/builders/remote-data-build.service';
|
||||
import { RequestService } from '../../../../core/data/request.service';
|
||||
import { RouteService } from '../../../../core/services/route.service';
|
||||
import { HALEndpointService } from '../../../../core/shared/hal-endpoint.service';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
import { MockActivatedRoute } from '../../../../shared/mocks/active-router.mock';
|
||||
import { getMockRemoteDataBuildService } from '../../../../shared/mocks/remote-data-build.service.mock';
|
||||
import { routeServiceStub } from '../../../../shared/testing/route-service.stub';
|
||||
import { AdminNotifyOutgoingComponent } from './admin-notify-outgoing.component';
|
||||
|
||||
describe('AdminNotifyOutgoingComponent', () => {
|
||||
let component: AdminNotifyOutgoingComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyOutgoingComponent>;
|
||||
let halService: HALEndpointService;
|
||||
let requestService: RequestService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
|
||||
|
||||
beforeEach(async () => {
|
||||
rdbService = getMockRemoteDataBuildService();
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
'generateRequestId': 'client/1234',
|
||||
'send': '',
|
||||
});
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
'getRootHref': '/api',
|
||||
});
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifyOutgoingComponent ],
|
||||
providers: [
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: SearchConfigurationService },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: ActivatedRoute, useValue: new MockActivatedRoute() },
|
||||
{ provide: HALEndpointService, useValue: halService },
|
||||
{ provide: RequestService, useValue: requestService },
|
||||
{ provide: RemoteDataBuildService, useValue: rdbService },
|
||||
provideMockStore({}),
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyOutgoingComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
} from '@angular/core';
|
||||
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-outgoing',
|
||||
templateUrl: './admin-notify-outgoing.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class AdminNotifyOutgoingComponent {
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService) {
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<div class="mb-5" *ngFor="let row of boxesConfig">
|
||||
<div class="mb-2">{{ row.title | translate }}</div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-sm" *ngFor="let box of row.boxes">
|
||||
<ds-notification-box (selectedBoxConfig)="navigateToSelectedSearchConfig($event)" [boxConfig]="box"></ds-notification-box>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -0,0 +1,74 @@
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { AdminNotifyMetricsComponent } from './admin-notify-metrics.component';
|
||||
|
||||
describe('AdminNotifyMetricsComponent', () => {
|
||||
let component: AdminNotifyMetricsComponent;
|
||||
let fixture: ComponentFixture<AdminNotifyMetricsComponent>;
|
||||
let router: RouterStub;
|
||||
|
||||
beforeEach(async () => {
|
||||
router = Object.assign(new RouterStub(),
|
||||
{ url : '/notify-dashboard' },
|
||||
);
|
||||
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifyMetricsComponent ],
|
||||
providers: [{ provide: Router, useValue: router }],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifyMetricsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
it('should navigate to correct url based on config', () => {
|
||||
const searchConfig = 'test.involvedItems';
|
||||
const incomingConfig = 'NOTIFY.incoming.test';
|
||||
const outgoingConfig = 'NOTIFY.outgoing.test';
|
||||
const adminPath = '/admin/search';
|
||||
const routeExtras = {
|
||||
queryParams: {
|
||||
configuration: searchConfig,
|
||||
view: ViewMode.ListElement,
|
||||
},
|
||||
};
|
||||
|
||||
const routeExtrasTable = {
|
||||
queryParams: {
|
||||
configuration: incomingConfig,
|
||||
view: ViewMode.Table,
|
||||
},
|
||||
};
|
||||
|
||||
const routeExtrasTableOutgoing = {
|
||||
queryParams: {
|
||||
configuration: outgoingConfig,
|
||||
view: ViewMode.Table,
|
||||
},
|
||||
};
|
||||
component.navigateToSelectedSearchConfig(searchConfig);
|
||||
expect(router.navigate).toHaveBeenCalledWith([adminPath], routeExtras);
|
||||
|
||||
component.navigateToSelectedSearchConfig(incomingConfig);
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/notify-dashboard/inbound'], routeExtrasTable);
|
||||
|
||||
component.navigateToSelectedSearchConfig(outgoingConfig);
|
||||
expect(router.navigate).toHaveBeenCalledWith(['/notify-dashboard/outbound'], routeExtrasTableOutgoing);
|
||||
});
|
||||
});
|
@@ -0,0 +1,57 @@
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { AdminNotifyMetricsRow } from './admin-notify-metrics.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-metrics',
|
||||
templateUrl: './admin-notify-metrics.component.html',
|
||||
})
|
||||
/**
|
||||
* Component used to display the number of notification for each configured box in the notifyMetrics section
|
||||
*/
|
||||
|
||||
export class AdminNotifyMetricsComponent {
|
||||
|
||||
@Input()
|
||||
boxesConfig: AdminNotifyMetricsRow[];
|
||||
|
||||
private incomingConfiguration = 'NOTIFY.incoming';
|
||||
private involvedItemsSuffix = 'involvedItems';
|
||||
private inboundPath = '/inbound';
|
||||
private outboundPath = '/outbound';
|
||||
private adminSearchPath = '/admin/search';
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
|
||||
public navigateToSelectedSearchConfig(searchConfig: string) {
|
||||
const isRelatedItemsConfig = searchConfig.endsWith(this.involvedItemsSuffix);
|
||||
|
||||
if (isRelatedItemsConfig) {
|
||||
this.router.navigate([this.adminSearchPath], {
|
||||
queryParams: {
|
||||
configuration: searchConfig,
|
||||
view: ViewMode.ListElement,
|
||||
},
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const isIncomingConfig = searchConfig.startsWith(this.incomingConfiguration);
|
||||
const selectedPath = isIncomingConfig ? this.inboundPath : this.outboundPath;
|
||||
|
||||
this.router.navigate([`${this.router.url}${selectedPath}`], {
|
||||
queryParams: {
|
||||
configuration: searchConfig,
|
||||
view: ViewMode.Table,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* The properties for each Box to be displayed in rows in the AdminNotifyMetricsComponent
|
||||
*/
|
||||
|
||||
export interface AdminNotifyMetricsBox {
|
||||
color: string;
|
||||
textColor?: string;
|
||||
title: string;
|
||||
description: string;
|
||||
config: string;
|
||||
count?: number;
|
||||
}
|
||||
/**
|
||||
* The properties for each Row containing a list of AdminNotifyMetricsBox to be displayed in the AdminNotifyMetricsComponent
|
||||
*/
|
||||
export interface AdminNotifyMetricsRow {
|
||||
title: string;
|
||||
boxes: AdminNotifyMetricsBox[]
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
<div class="table-responsive mt-2">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr class="text-nowrap">
|
||||
<th scope="col">{{ 'notify-message-result.timestamp' | translate}}</th>
|
||||
<th scope="col">{{'notify-message-result.repositoryItem' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.ldnService' | translate}}</th>
|
||||
<th scope="col">{{ 'notify-message-result.type' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.status' | translate }}</th>
|
||||
<th scope="col">{{ 'notify-message-result.action' | translate }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let message of (messagesSubject$ | async)">
|
||||
<td class="text-nowrap">
|
||||
<div *ngIf="message.queueLastStartTime">{{ message.queueLastStartTime | date:"YYYY/MM/d hh:mm:ss" }}</div>
|
||||
<div *ngIf="!message.queueLastStartTime">n/a</div>
|
||||
</td>
|
||||
<td>
|
||||
<ds-truncatable [id]="message.id">
|
||||
<ds-truncatable-part [id]="message.id" [minLines]="2">
|
||||
<a *ngIf="message.relatedItem" [routerLink]="'/items/' + (message.context || message.object)">{{ message.relatedItem }}</a>
|
||||
</ds-truncatable-part>
|
||||
</ds-truncatable>
|
||||
<div *ngIf="!message.relatedItem">n/a</div>
|
||||
</td>
|
||||
<td>
|
||||
<div *ngIf="message.ldnService">{{ message.ldnService }}</div>
|
||||
<div *ngIf="!message.ldnService">n/a</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>{{ message.activityStreamType }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="text-nowrap">{{ 'notify-detail-modal.' + message.queueStatusLabel | translate }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<button class="btn mb-2 btn-dark" (click)="openDetailModal(message)">{{ 'notify-message-result.detail' | translate }}</button>
|
||||
<button *ngIf="message.queueStatusLabel !== reprocessStatus && validStatusesForReprocess.includes(message.queueStatusLabel)"
|
||||
(click)="reprocessMessage(message)"
|
||||
class="btn btn-warning"
|
||||
>
|
||||
{{ 'notify-message-result.reprocess' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@@ -0,0 +1,188 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
} from '@angular/core/testing';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import {
|
||||
of as observableOf,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RouteService } from '../../../core/services/route.service';
|
||||
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
||||
import { routeServiceStub } from '../../../shared/testing/route-service.stub';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { AdminNotifyMessagesService } from '../services/admin-notify-messages.service';
|
||||
import { AdminNotifySearchResultComponent } from './admin-notify-search-result.component';
|
||||
|
||||
export const mockAdminNotifyMessages = [
|
||||
{
|
||||
'type': 'message',
|
||||
'id': 'urn:uuid:5fb3af44-d4f8-4226-9475-2d09c2d8d9e0',
|
||||
'coarNotifyType': 'coar-notify:ReviewAction',
|
||||
'activityStreamType': 'TentativeReject',
|
||||
'inReplyTo': 'urn:uuid:f7289ad5-0955-4c86-834c-fb54a736778b',
|
||||
'object': null,
|
||||
'context': '24d50450-9ff0-485f-82d4-fba1be42f3f9',
|
||||
'queueAttempts': 1,
|
||||
'queueLastStartTime': '2023-11-24T14:44:00.064+00:00',
|
||||
'origin': 12,
|
||||
'target': null,
|
||||
'queueStatusLabel': 'notify-queue-status.processed',
|
||||
'queueTimeout': '2023-11-24T15:44:00.064+00:00',
|
||||
'queueStatus': 3,
|
||||
'_links': {
|
||||
'self': {
|
||||
'href': 'http://localhost:8080/server/api/ldn/messages/urn:uuid:5fb3af44-d4f8-4226-9475-2d09c2d8d9e0',
|
||||
},
|
||||
},
|
||||
'thumbnail': 'test',
|
||||
'item': {},
|
||||
'accessStatus': {},
|
||||
'ldnService': 'NOTIFY inbox - Automatic service',
|
||||
'relatedItem': 'test coar 2 demo',
|
||||
'message': '{"@context":["https://www.w3.org/ns/activitystreams","https://purl.org/coar/notify"],"id":"urn:uuid:668f26e0-2e8d-4118-b0d2-ee713523bc45","type":["Reject","coar-notify:IngestAction"],"actor":{"id":"https://generic-service.com","type":["Service"],"name":"Generic Service"},"context":{"id":"https://dspace-coar.4science.cloud/handle/123456789/28","type":["Document"],"ietf:cite-as":"https://doi.org/10.4598/12123488"},"object":{"id":"https://dspace-coar.4science.cloud/handle/123456789/28","type":["Offer"]},"origin":{"id":"https://generic-service.com/system","type":["Service"],"inbox":"https://notify-inbox.info/inbox7"},"target":{"id":"https://some-organisation.org","type":["Organization"],"inbox":"https://dspace-coar.4science.cloud/server/ldn/inbox"},"inReplyTo":"urn:uuid:d9b4010a-f128-4815-abb2-83707a2ee9cf"}',
|
||||
},
|
||||
{
|
||||
'type': 'message',
|
||||
'id': 'urn:uuid:544c8777-e826-4810-a625-3e394cc3660d',
|
||||
'coarNotifyType': 'coar-notify:IngestAction',
|
||||
'activityStreamType': 'Announce',
|
||||
'inReplyTo': 'urn:uuid:b2ad72d6-6ea9-464f-b385-29a78417f6b8',
|
||||
'object': null,
|
||||
'context': 'e657437a-0ee2-437d-916a-bba8c57bf40b',
|
||||
'queueAttempts': 1,
|
||||
'queueLastStartTime': null,
|
||||
'origin': 12,
|
||||
'target': null,
|
||||
'queueStatusLabel': 'notify-queue-status.unmapped_action',
|
||||
'queueTimeout': '2023-11-24T14:15:34.945+00:00',
|
||||
'queueStatus': 6,
|
||||
'_links': {
|
||||
'self': {
|
||||
'href': 'http://localhost:8080/server/api/ldn/messages/urn:uuid:544c8777-e826-4810-a625-3e394cc3660d',
|
||||
},
|
||||
},
|
||||
'thumbnail': {},
|
||||
'item': {},
|
||||
'accessStatus': {},
|
||||
'ldnService': 'NOTIFY inbox - Automatic service',
|
||||
'relatedItem': 'test coar demo',
|
||||
'message': '{"@context":["https://www.w3.org/ns/activitystreams","https://purl.org/coar/notify"],"id":"urn:uuid:668f26e0-2e8d-4118-b0d2-ee713523bc45","type":["Reject","coar-notify:IngestAction"],"actor":{"id":"https://generic-service.com","type":["Service"],"name":"Generic Service"},"context":{"id":"https://dspace-coar.4science.cloud/handle/123456789/28","type":["Document"],"ietf:cite-as":"https://doi.org/10.4598/12123488"},"object":{"id":"https://dspace-coar.4science.cloud/handle/123456789/28","type":["Offer"]},"origin":{"id":"https://generic-service.com/system","type":["Service"],"inbox":"https://notify-inbox.info/inbox7"},"target":{"id":"https://some-organisation.org","type":["Organization"],"inbox":"https://dspace-coar.4science.cloud/server/ldn/inbox"},"inReplyTo":"urn:uuid:d9b4010a-f128-4815-abb2-83707a2ee9cf"}',
|
||||
},
|
||||
] as unknown as AdminNotifyMessage[];
|
||||
describe('AdminNotifySearchResultComponent', () => {
|
||||
let component: AdminNotifySearchResultComponent;
|
||||
let fixture: ComponentFixture<AdminNotifySearchResultComponent>;
|
||||
let objectCache: ObjectCacheService;
|
||||
let requestService: RequestService;
|
||||
let halService: HALEndpointService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
let adminNotifyMessageService: AdminNotifyMessagesService;
|
||||
let searchConfigService: SearchConfigurationService;
|
||||
let modalService: NgbModal;
|
||||
const requestUUID = '34cfed7c-f597-49ef-9cbe-ea351f0023c2';
|
||||
const testObject = {
|
||||
uuid: 'test-property',
|
||||
name: 'test-property',
|
||||
values: ['value-1', 'value-2'],
|
||||
} as ConfigurationProperty;
|
||||
|
||||
beforeEach(async () => {
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: cold('a', { a: '' }),
|
||||
});
|
||||
adminNotifyMessageService = jasmine.createSpyObj('adminNotifyMessageService', {
|
||||
getDetailedMessages: of(mockAdminNotifyMessages),
|
||||
reprocessMessage: of(mockAdminNotifyMessages),
|
||||
});
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
generateRequestId: requestUUID,
|
||||
send: true,
|
||||
});
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
buildSingle: cold('a', {
|
||||
a: {
|
||||
payload: testObject,
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
searchConfigService = jasmine.createSpyObj('searchConfigService', {
|
||||
getCurrentConfiguration: of('NOTIFY.outgoing'),
|
||||
});
|
||||
objectCache = {} as ObjectCacheService;
|
||||
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ AdminNotifySearchResultComponent, AdminNotifyDetailModalComponent ],
|
||||
providers: [
|
||||
{ provide: AdminNotifyMessagesService, useValue: adminNotifyMessageService },
|
||||
{ provide: RouteService, useValue: routeServiceStub },
|
||||
{ provide: ActivatedRoute, useValue: new RouterStub() },
|
||||
{ provide: HALEndpointService, useValue: halService },
|
||||
{ provide: ObjectCacheService, useValue: objectCache },
|
||||
{ provide: RequestService, useValue: requestService },
|
||||
{ provide: RemoteDataBuildService, useValue: rdbService },
|
||||
{ provide: SEARCH_CONFIG_SERVICE, useValue: searchConfigService },
|
||||
DatePipe,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AdminNotifySearchResultComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.searchConfigService = searchConfigService;
|
||||
modalService = (component as any).modalService;
|
||||
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
expect(component.isInbound).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should open modal', () => {
|
||||
component.openDetailModal(mockAdminNotifyMessages[0]);
|
||||
expect(modalService.open).toHaveBeenCalledWith(AdminNotifyDetailModalComponent);
|
||||
});
|
||||
|
||||
it('should map messages', (done) => {
|
||||
component.messagesSubject$.subscribe((messages) => {
|
||||
expect(messages).toEqual(mockAdminNotifyMessages);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should reprocess message', (done) => {
|
||||
component.reprocessMessage(mockAdminNotifyMessages[0]);
|
||||
component.messagesSubject$.subscribe((messages) => {
|
||||
expect(messages).toEqual(mockAdminNotifyMessages);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should unsubscribe on destroy', () => {
|
||||
(component as any).subs = [of(null).subscribe()];
|
||||
|
||||
spyOn((component as any).subs[0], 'unsubscribe');
|
||||
component.ngOnDestroy();
|
||||
expect((component as any).subs[0].unsubscribe).toHaveBeenCalled();
|
||||
});
|
||||
});
|
@@ -0,0 +1,162 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { Context } from '../../../core/shared/context.model';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
||||
import { tabulatableObjectsComponent } from '../../../shared/object-collection/shared/tabulatable-objects/tabulatable-objects.decorator';
|
||||
import { TabulatableResultListElementsComponent } from '../../../shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component';
|
||||
import { AdminNotifyDetailModalComponent } from '../admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { AdminNotifySearchResult } from '../models/admin-notify-message-search-result.model';
|
||||
import { AdminNotifyMessagesService } from '../services/admin-notify-messages.service';
|
||||
|
||||
@tabulatableObjectsComponent(PaginatedList<AdminNotifySearchResult>, ViewMode.Table, Context.CoarNotify)
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-search-result',
|
||||
templateUrl: './admin-notify-search-result.component.html',
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
})
|
||||
/**
|
||||
* Component for visualization in table format of the search results related to the AdminNotifyDashboardComponent
|
||||
*/
|
||||
|
||||
|
||||
export class AdminNotifySearchResultComponent extends TabulatableResultListElementsComponent<PaginatedList<AdminNotifySearchResult>, AdminNotifySearchResult> implements OnInit, OnDestroy{
|
||||
public messagesSubject$: BehaviorSubject<AdminNotifyMessage[]> = new BehaviorSubject([]);
|
||||
public reprocessStatus = 'QUEUE_STATUS_QUEUED_FOR_RETRY';
|
||||
//we check on one type of config to render specific table headers
|
||||
public isInbound: boolean;
|
||||
|
||||
/**
|
||||
* Statuses for which we display the reprocess button
|
||||
*/
|
||||
public validStatusesForReprocess = [
|
||||
'QUEUE_STATUS_UNTRUSTED',
|
||||
'QUEUE_STATUS_UNTRUSTED_IP',
|
||||
'QUEUE_STATUS_FAILED',
|
||||
'QUEUE_STATUS_UNMAPPED_ACTION',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Array to track all subscriptions and unsubscribe them onDestroy
|
||||
* @type {Array}
|
||||
*/
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
/**
|
||||
* Keys to be formatted as date
|
||||
* @private
|
||||
*/
|
||||
|
||||
private dateTypeKeys: string[] = ['queueLastStartTime', 'queueTimeout'];
|
||||
|
||||
/**
|
||||
* Keys to be not shown in detail
|
||||
* @private
|
||||
*/
|
||||
private messageKeys: string[] = [
|
||||
'type',
|
||||
'id',
|
||||
'coarNotifyType',
|
||||
'activityStreamType',
|
||||
'inReplyTo',
|
||||
'queueAttempts',
|
||||
'queueLastStartTime',
|
||||
'queueStatusLabel',
|
||||
'queueTimeout',
|
||||
];
|
||||
|
||||
/**
|
||||
* The format for the date values
|
||||
* @private
|
||||
*/
|
||||
private dateFormat = 'YYYY/MM/d hh:mm:ss';
|
||||
|
||||
constructor(private modalService: NgbModal,
|
||||
private adminNotifyMessagesService: AdminNotifyMessagesService,
|
||||
private datePipe: DatePipe,
|
||||
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Map messages on init for readable representation
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.mapDetailsToMessages();
|
||||
this.subs.push(this.searchConfigService.getCurrentConfiguration('')
|
||||
.subscribe(configuration => {
|
||||
this.isInbound = configuration.startsWith('NOTIFY.incoming');
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subs.forEach(sub => sub.unsubscribe());
|
||||
}
|
||||
|
||||
/**
|
||||
* Open modal for details visualization
|
||||
* @param notifyMessage the message to be displayed
|
||||
*/
|
||||
openDetailModal(notifyMessage: AdminNotifyMessage) {
|
||||
const modalRef = this.modalService.open(AdminNotifyDetailModalComponent);
|
||||
const messageToOpen = { ...notifyMessage };
|
||||
|
||||
this.messageKeys.forEach(key => {
|
||||
if (this.dateTypeKeys.includes(key)) {
|
||||
messageToOpen[key] = this.datePipe.transform(messageToOpen[key], this.dateFormat);
|
||||
}
|
||||
});
|
||||
// format COAR message for technical visualization
|
||||
messageToOpen.message = JSON.stringify(JSON.parse(notifyMessage.message), null, 2);
|
||||
|
||||
modalRef.componentInstance.notifyMessage = messageToOpen;
|
||||
modalRef.componentInstance.notifyMessageKeys = this.messageKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reprocess message in status QUEUE_STATUS_QUEUED_FOR_RETRY and update results
|
||||
* @param message the message to be reprocessed
|
||||
*/
|
||||
reprocessMessage(message: AdminNotifyMessage) {
|
||||
this.subs.push(
|
||||
this.adminNotifyMessagesService.reprocessMessage(message, this.messagesSubject$)
|
||||
.subscribe(response => {
|
||||
this.messagesSubject$.next(response);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Map readable results to messages
|
||||
* @private
|
||||
*/
|
||||
private mapDetailsToMessages() {
|
||||
this.subs.push(this.adminNotifyMessagesService.getDetailedMessages(this.objects?.page.map(pageResult => pageResult.indexableObject))
|
||||
.subscribe(response => {
|
||||
this.messagesSubject$.next(response);
|
||||
}));
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
import { SearchResult } from '../../../shared/search/models/search-result.model';
|
||||
import { searchResultFor } from '../../../shared/search/search-result-element-decorator';
|
||||
import { AdminNotifyMessage } from './admin-notify-message.model';
|
||||
|
||||
@searchResultFor(AdminNotifyMessage)
|
||||
export class AdminNotifySearchResult extends SearchResult<AdminNotifyMessage> {
|
||||
}
|
@@ -0,0 +1,171 @@
|
||||
import {
|
||||
autoserialize,
|
||||
deserialize,
|
||||
inheritSerialization,
|
||||
} from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||
import { GenericConstructor } from '../../../core/shared/generic-constructor';
|
||||
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||
import { ADMIN_NOTIFY_MESSAGE } from './admin-notify-message.resource-type';
|
||||
|
||||
/**
|
||||
* A message that includes admin notify info
|
||||
*/
|
||||
@typedObject
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class AdminNotifyMessage extends DSpaceObject {
|
||||
static type = ADMIN_NOTIFY_MESSAGE;
|
||||
|
||||
/**
|
||||
* The type of the resource
|
||||
*/
|
||||
@excludeFromEquals
|
||||
type = ADMIN_NOTIFY_MESSAGE;
|
||||
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
@autoserialize
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* The id of the notification
|
||||
*/
|
||||
@autoserialize
|
||||
notificationId: string;
|
||||
|
||||
/**
|
||||
* The type of the notification
|
||||
*/
|
||||
@autoserialize
|
||||
notificationType: string;
|
||||
|
||||
/**
|
||||
* The type of the notification
|
||||
*/
|
||||
@autoserialize
|
||||
coarNotifyType: string;
|
||||
|
||||
/**
|
||||
* The type of the activity
|
||||
*/
|
||||
@autoserialize
|
||||
activityStreamType: string;
|
||||
|
||||
/**
|
||||
* The object the message reply to
|
||||
*/
|
||||
@autoserialize
|
||||
inReplyTo: string;
|
||||
|
||||
/**
|
||||
* The object the message relates to
|
||||
*/
|
||||
@autoserialize
|
||||
object: string;
|
||||
|
||||
/**
|
||||
* The name of the related item
|
||||
*/
|
||||
@autoserialize
|
||||
relatedItem: string;
|
||||
|
||||
/**
|
||||
* The name of the related ldn service
|
||||
*/
|
||||
@autoserialize
|
||||
ldnService: string;
|
||||
|
||||
/**
|
||||
* The context of the message
|
||||
*/
|
||||
@autoserialize
|
||||
context: string;
|
||||
|
||||
/**
|
||||
* The related COAR message
|
||||
*/
|
||||
@autoserialize
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The attempts of the queue
|
||||
*/
|
||||
@autoserialize
|
||||
queueAttempts: number;
|
||||
|
||||
/**
|
||||
* Timestamp of the last queue attempt
|
||||
*/
|
||||
@autoserialize
|
||||
queueLastStartTime: string;
|
||||
|
||||
/**
|
||||
* The type of the activity stream
|
||||
*/
|
||||
@autoserialize
|
||||
origin: number | string;
|
||||
|
||||
/**
|
||||
* The type of the activity stream
|
||||
*/
|
||||
@autoserialize
|
||||
target: number | string;
|
||||
|
||||
/**
|
||||
* The label for the status of the queue
|
||||
*/
|
||||
@autoserialize
|
||||
queueStatusLabel: string;
|
||||
|
||||
/**
|
||||
* The timeout of the queue
|
||||
*/
|
||||
@autoserialize
|
||||
queueTimeout: string;
|
||||
|
||||
/**
|
||||
* The status of the queue
|
||||
*/
|
||||
@autoserialize
|
||||
queueStatus: number;
|
||||
|
||||
/**
|
||||
* Thumbnail link used when browsing items with showThumbs config enabled.
|
||||
*/
|
||||
@autoserialize
|
||||
thumbnail: string;
|
||||
|
||||
/**
|
||||
* The observable pointing to the item itself
|
||||
*/
|
||||
@autoserialize
|
||||
item: Observable<AdminNotifyMessage>;
|
||||
|
||||
/**
|
||||
* The observable pointing to the access status of the item
|
||||
*/
|
||||
@autoserialize
|
||||
accessStatus: Observable<AdminNotifyMessage>;
|
||||
|
||||
|
||||
|
||||
@deserialize
|
||||
_links: {
|
||||
self: {
|
||||
href: string;
|
||||
};
|
||||
};
|
||||
|
||||
get self(): string {
|
||||
return this._links.self.href;
|
||||
}
|
||||
|
||||
getRenderTypes(): (string | GenericConstructor<ListableObject>)[] {
|
||||
return [this.constructor as GenericConstructor<ListableObject>];
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
import { ResourceType } from '../../../core/shared/resource-type';
|
||||
|
||||
/**
|
||||
* The resource type for AdminNotifyMessage
|
||||
*
|
||||
* Needs to be in a separate file to prevent circular
|
||||
* dependencies in webpack.
|
||||
*/
|
||||
export const ADMIN_NOTIFY_MESSAGE = new ResourceType('message');
|
@@ -0,0 +1,117 @@
|
||||
import { deepClone } from 'fast-json-patch';
|
||||
import { cold } from 'jasmine-marbles';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
of,
|
||||
} from 'rxjs';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { RestResponse } from '../../../core/cache/response.models';
|
||||
import { ItemDataService } from '../../../core/data/item-data.service';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RequestEntry } from '../../../core/data/request-entry.model';
|
||||
import { RequestEntryState } from '../../../core/data/request-entry-state.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { LdnServicesService } from '../../admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||
import { mockAdminNotifyMessages } from '../admin-notify-search-result/admin-notify-search-result.component.spec';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { AdminNotifyMessagesService } from './admin-notify-messages.service';
|
||||
|
||||
describe('AdminNotifyMessagesService test', () => {
|
||||
let service: AdminNotifyMessagesService;
|
||||
let requestService: RequestService;
|
||||
let rdbService: RemoteDataBuildService;
|
||||
let objectCache: ObjectCacheService;
|
||||
let halService: HALEndpointService;
|
||||
let notificationsService: NotificationsService;
|
||||
let ldnServicesService: LdnServicesService;
|
||||
let itemDataService: ItemDataService;
|
||||
let responseCacheEntry: RequestEntry;
|
||||
let mockMessages: AdminNotifyMessage[];
|
||||
|
||||
const endpointURL = `https://rest.api/rest/api/ldn/messages`;
|
||||
const requestUUID = '8b3c613a-5a4b-438b-9686-be1d5b4a1c5a';
|
||||
const remoteDataMocks = {
|
||||
Success: new RemoteData(null, null, null, RequestEntryState.Success, null, null, 200),
|
||||
};
|
||||
const testLdnServiceName = 'testLdnService';
|
||||
const testRelatedItemName = 'testRelatedItem';
|
||||
|
||||
function initTestService() {
|
||||
return new AdminNotifyMessagesService(
|
||||
requestService,
|
||||
rdbService,
|
||||
objectCache,
|
||||
halService,
|
||||
notificationsService,
|
||||
ldnServicesService,
|
||||
itemDataService,
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
mockMessages = deepClone(mockAdminNotifyMessages);
|
||||
objectCache = {} as ObjectCacheService;
|
||||
notificationsService = {} as NotificationsService;
|
||||
responseCacheEntry = new RequestEntry();
|
||||
responseCacheEntry.request = { href: endpointURL } as any;
|
||||
responseCacheEntry.response = new RestResponse(true, 200, 'Success');
|
||||
|
||||
|
||||
requestService = jasmine.createSpyObj('requestService', {
|
||||
generateRequestId: requestUUID,
|
||||
send: true,
|
||||
removeByHrefSubstring: {},
|
||||
getByHref: of(responseCacheEntry),
|
||||
getByUUID: of(responseCacheEntry),
|
||||
});
|
||||
|
||||
halService = jasmine.createSpyObj('halService', {
|
||||
getEndpoint: of(endpointURL),
|
||||
});
|
||||
|
||||
rdbService = jasmine.createSpyObj('rdbService', {
|
||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
||||
buildList: cold('a', { a: remoteDataMocks.Success }),
|
||||
buildFromRequestUUID: createSuccessfulRemoteDataObject$(mockMessages),
|
||||
});
|
||||
|
||||
ldnServicesService = jasmine.createSpyObj('ldnServicesService', {
|
||||
findById: createSuccessfulRemoteDataObject$({ name: testLdnServiceName }),
|
||||
});
|
||||
|
||||
itemDataService = jasmine.createSpyObj('itemDataService', {
|
||||
findById: createSuccessfulRemoteDataObject$({ name: testRelatedItemName }),
|
||||
});
|
||||
|
||||
service = initTestService();
|
||||
});
|
||||
|
||||
describe('Admin Notify service', () => {
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
|
||||
it('should get details for messages', (done) => {
|
||||
service.getDetailedMessages(mockMessages).pipe(take(1)).subscribe((detailedMessages) => {
|
||||
expect(detailedMessages[0].ldnService).toEqual(testLdnServiceName);
|
||||
expect(detailedMessages[0].relatedItem).toEqual(testRelatedItemName);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should reprocess message', (done) => {
|
||||
const behaviorSubject = new BehaviorSubject(mockMessages);
|
||||
service.reprocessMessage(mockMessages[0], behaviorSubject).pipe(take(1)).subscribe((reprocessedMessages) => {
|
||||
expect(reprocessedMessages.length).toEqual(2);
|
||||
expect(reprocessedMessages).toEqual(mockMessages);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@@ -0,0 +1,115 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
from,
|
||||
Observable,
|
||||
of,
|
||||
scan,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
mergeMap,
|
||||
switchMap,
|
||||
tap,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||
import { dataService } from '../../../core/data/base/data-service.decorator';
|
||||
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
||||
import { ItemDataService } from '../../../core/data/item-data.service';
|
||||
import { PostRequest } from '../../../core/data/request.models';
|
||||
import { RequestService } from '../../../core/data/request.service';
|
||||
import { RestRequest } from '../../../core/data/rest-request.model';
|
||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||
import {
|
||||
getAllSucceededRemoteDataPayload,
|
||||
getFirstCompletedRemoteData,
|
||||
} from '../../../core/shared/operators';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { LdnServicesService } from '../../admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||
import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { ADMIN_NOTIFY_MESSAGE } from '../models/admin-notify-message.resource-type';
|
||||
|
||||
/**
|
||||
* Injectable service responsible for fetching/sending data from/to the REST API on the messages endpoint.
|
||||
*
|
||||
* @export
|
||||
* @class AdminNotifyMessagesService
|
||||
* @extends {IdentifiableDataService<AdminNotifyMessage>}
|
||||
*/
|
||||
@Injectable()
|
||||
@dataService(ADMIN_NOTIFY_MESSAGE)
|
||||
export class AdminNotifyMessagesService extends IdentifiableDataService<AdminNotifyMessage> {
|
||||
|
||||
protected reprocessEndpoint = 'enqueueretry';
|
||||
|
||||
constructor(
|
||||
protected requestService: RequestService,
|
||||
protected rdbService: RemoteDataBuildService,
|
||||
protected objectCache: ObjectCacheService,
|
||||
protected halService: HALEndpointService,
|
||||
protected notificationsService: NotificationsService,
|
||||
private ldnServicesService: LdnServicesService,
|
||||
private itemDataService: ItemDataService,
|
||||
) {
|
||||
super('messages', requestService, rdbService, objectCache, halService);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add detailed information to each message
|
||||
* @param messages the messages to which add detailded info
|
||||
*/
|
||||
public getDetailedMessages(messages: AdminNotifyMessage[]): Observable<AdminNotifyMessage[]> {
|
||||
return from(messages).pipe(
|
||||
mergeMap(message =>
|
||||
message.target || message.origin ? this.ldnServicesService.findById((message.target || message.origin).toString()).pipe(
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
map(detail => ({ ...message, ldnService: detail.name })),
|
||||
) : of(message),
|
||||
),
|
||||
mergeMap(message =>
|
||||
message.object || message.context ? this.itemDataService.findById(message.object || message.context).pipe(
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
map(detail => ({ ...message, relatedItem: detail.name })),
|
||||
) : of(message),
|
||||
),
|
||||
scan((acc: any, value: any) => [...acc, value], []),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reprocess message in status QUEUE_STATUS_QUEUED_FOR_RETRY and update results
|
||||
* @param message the message to reprocess
|
||||
* @param messageSubject the current visualised messages source
|
||||
*/
|
||||
public reprocessMessage(message: AdminNotifyMessage, messageSubject: BehaviorSubject<AdminNotifyMessage[]>): Observable<AdminNotifyMessage[]> {
|
||||
const requestId = this.requestService.generateRequestId();
|
||||
|
||||
return this.halService.getEndpoint(this.reprocessEndpoint).pipe(
|
||||
map(endpoint => endpoint.replace('{id}', message.id)),
|
||||
map((endpointURL: string) => new PostRequest(requestId, endpointURL)),
|
||||
tap(request => this.requestService.send(request)),
|
||||
switchMap((request: RestRequest) => this.rdbService.buildFromRequestUUID<AdminNotifyMessage>(request.uuid)),
|
||||
getFirstCompletedRemoteData(),
|
||||
getAllSucceededRemoteDataPayload(),
|
||||
mergeMap(reprocessedMessage => this.getDetailedMessages([reprocessedMessage])),
|
||||
).pipe(
|
||||
mergeMap((newMessages) => messageSubject.pipe(
|
||||
map(messages => {
|
||||
const detailedReprocessedMessage = newMessages[0];
|
||||
const messageToUpdate = messages.find(currentMessage => currentMessage.id === message.id);
|
||||
const indexOfMessageToUpdate = messages.indexOf(messageToUpdate);
|
||||
detailedReprocessedMessage.target = message.target;
|
||||
detailedReprocessedMessage.object = message.object;
|
||||
detailedReprocessedMessage.origin = message.origin;
|
||||
detailedReprocessedMessage.context = message.context;
|
||||
messages[indexOfMessageToUpdate] = detailedReprocessedMessage;
|
||||
|
||||
return messages;
|
||||
}),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
@@ -1,15 +1,24 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
||||
@@ -43,7 +52,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||
createBitstreamFormat: createSuccessfulRemoteDataObject$({}),
|
||||
clearBitStreamFormatRequests: observableOf(null)
|
||||
clearBitStreamFormatRequests: observableOf(null),
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
@@ -55,7 +64,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
{ provide: FormService, useValue: getMockFormService() },
|
||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
@@ -90,7 +99,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
notificationService = new NotificationsServiceStub();
|
||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||
createBitstreamFormat: createFailedRemoteDataObject$('Error', 500),
|
||||
clearBitStreamFormatRequests: observableOf(null)
|
||||
clearBitStreamFormatRequests: observableOf(null),
|
||||
});
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
@@ -102,7 +111,7 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
{ provide: FormService, useValue: getMockFormService() },
|
||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
|
@@ -1,13 +1,19 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Component } from '@angular/core';
|
||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||
|
||||
/**
|
||||
* This component renders the page to create a new bitstream format.
|
||||
@@ -41,16 +47,16 @@ export class AddBitstreamFormatComponent {
|
||||
this.bitstreamFormatDataService.createBitstreamFormat(bitstreamFormat).pipe(
|
||||
getFirstCompletedRemoteData(),
|
||||
).subscribe((response: RemoteData<BitstreamFormat>) => {
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'),
|
||||
this.translateService.get('admin.registries.bitstream-formats.create.success.content'));
|
||||
this.router.navigate([getBitstreamFormatsModuleRoute()]);
|
||||
this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe();
|
||||
} else {
|
||||
this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'),
|
||||
this.translateService.get('admin.registries.bitstream-formats.create.failure.content'));
|
||||
}
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'),
|
||||
this.translateService.get('admin.registries.bitstream-formats.create.success.content'));
|
||||
this.router.navigate([getBitstreamFormatsModuleRoute()]);
|
||||
this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe();
|
||||
} else {
|
||||
this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'),
|
||||
this.translateService.get('admin.registries.bitstream-formats.create.failure.content'));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,8 @@
|
||||
/* eslint-disable max-classes-per-file */
|
||||
import { Action } from '@ngrx/store';
|
||||
import { type } from '../../../shared/ngrx/type';
|
||||
|
||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||
import { type } from '../../../shared/ngrx/type';
|
||||
|
||||
/**
|
||||
* For each action type in an action group, make a simple
|
||||
@@ -15,7 +16,7 @@ export const BitstreamFormatsRegistryActionTypes = {
|
||||
|
||||
SELECT_FORMAT: type('dspace/bitstream-formats-registry/SELECT_FORMAT'),
|
||||
DESELECT_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_FORMAT'),
|
||||
DESELECT_ALL_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_ALL_FORMAT')
|
||||
DESELECT_ALL_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_ALL_FORMAT'),
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1,11 +1,15 @@
|
||||
import { Action } from '@ngrx/store';
|
||||
|
||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||
import { bitstreamFormatReducer, BitstreamFormatRegistryState } from './bitstream-format.reducers';
|
||||
import {
|
||||
BitstreamFormatsRegistryDeselectAction,
|
||||
BitstreamFormatsRegistryDeselectAllAction,
|
||||
BitstreamFormatsRegistrySelectAction
|
||||
BitstreamFormatsRegistrySelectAction,
|
||||
} from './bitstream-format.actions';
|
||||
import {
|
||||
bitstreamFormatReducer,
|
||||
BitstreamFormatRegistryState,
|
||||
} from './bitstream-format.reducers';
|
||||
|
||||
const bitstreamFormat1: BitstreamFormat = new BitstreamFormat();
|
||||
bitstreamFormat1.id = 'test-uuid-1';
|
||||
@@ -16,15 +20,15 @@ bitstreamFormat2.id = 'test-uuid-2';
|
||||
bitstreamFormat2.shortDescription = 'test-short-2';
|
||||
|
||||
const initialState: BitstreamFormatRegistryState = {
|
||||
selectedBitstreamFormats: []
|
||||
selectedBitstreamFormats: [],
|
||||
};
|
||||
|
||||
const bitstream1SelectedState: BitstreamFormatRegistryState = {
|
||||
selectedBitstreamFormats: [bitstreamFormat1]
|
||||
selectedBitstreamFormats: [bitstreamFormat1],
|
||||
};
|
||||
|
||||
const bitstream1and2SelectedState: BitstreamFormatRegistryState = {
|
||||
selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2]
|
||||
selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2],
|
||||
};
|
||||
|
||||
describe('BitstreamFormatReducer', () => {
|
||||
|
@@ -3,7 +3,7 @@ import {
|
||||
BitstreamFormatsRegistryAction,
|
||||
BitstreamFormatsRegistryActionTypes,
|
||||
BitstreamFormatsRegistryDeselectAction,
|
||||
BitstreamFormatsRegistrySelectAction
|
||||
BitstreamFormatsRegistrySelectAction,
|
||||
} from './bitstream-format.actions';
|
||||
|
||||
/**
|
||||
@@ -32,21 +32,21 @@ export function bitstreamFormatReducer(state = initialState, action: BitstreamFo
|
||||
|
||||
case BitstreamFormatsRegistryActionTypes.SELECT_FORMAT: {
|
||||
return Object.assign({}, state, {
|
||||
selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat]
|
||||
selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat],
|
||||
});
|
||||
}
|
||||
|
||||
case BitstreamFormatsRegistryActionTypes.DESELECT_FORMAT: {
|
||||
return Object.assign({}, state, {
|
||||
selectedBitstreamFormats: state.selectedBitstreamFormats.filter(
|
||||
(selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat
|
||||
)
|
||||
(selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
case BitstreamFormatsRegistryActionTypes.DESELECT_ALL_FORMAT: {
|
||||
return Object.assign({}, state, {
|
||||
selectedBitstreamFormats: []
|
||||
selectedBitstreamFormats: [],
|
||||
});
|
||||
}
|
||||
default:
|
||||
|
@@ -47,7 +47,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</ds-pagination>
|
||||
<div *ngIf="(bitstreamFormats | async)?.payload?.totalElements == 0" class="alert alert-info" role="alert">
|
||||
<div *ngIf="(bitstreamFormats | async)?.payload?.totalElements === 0" class="alert alert-info" role="alert">
|
||||
{{'admin.registries.bitstream-formats.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user