mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +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",
|
"eslint-plugin-deprecation",
|
||||||
"unused-imports",
|
"unused-imports",
|
||||||
"eslint-plugin-lodash",
|
"eslint-plugin-lodash",
|
||||||
"eslint-plugin-jsonc"
|
"eslint-plugin-jsonc",
|
||||||
|
"eslint-plugin-rxjs",
|
||||||
|
"eslint-plugin-simple-import-sort",
|
||||||
|
"eslint-plugin-import-newlines"
|
||||||
],
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@@ -27,17 +30,29 @@
|
|||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
||||||
"plugin:@angular-eslint/recommended",
|
"plugin:@angular-eslint/recommended",
|
||||||
"plugin:@angular-eslint/template/process-inline-templates"
|
"plugin:@angular-eslint/template/process-inline-templates",
|
||||||
|
"plugin:rxjs/recommended"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
"SwitchCase": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
"max-classes-per-file": [
|
"max-classes-per-file": [
|
||||||
"error",
|
"error",
|
||||||
1
|
1
|
||||||
],
|
],
|
||||||
"comma-dangle": [
|
"comma-dangle": [
|
||||||
"off",
|
"error",
|
||||||
"always-multiline"
|
"always-multiline"
|
||||||
],
|
],
|
||||||
|
"object-curly-spacing": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
"eol-last": [
|
"eol-last": [
|
||||||
"error",
|
"error",
|
||||||
"always"
|
"always"
|
||||||
@@ -104,15 +119,13 @@
|
|||||||
"allowTernary": true
|
"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",
|
"prefer-spread": "off",
|
||||||
"no-underscore-dangle": "off",
|
"no-underscore-dangle": "off",
|
||||||
|
|
||||||
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
|
|
||||||
"no-prototype-builtins": "off",
|
"no-prototype-builtins": "off",
|
||||||
"no-useless-escape": "off",
|
"no-useless-escape": "off",
|
||||||
"no-case-declarations": "off",
|
|
||||||
"no-extra-boolean-cast": "off",
|
|
||||||
|
|
||||||
"@angular-eslint/directive-selector": [
|
"@angular-eslint/directive-selector": [
|
||||||
"error",
|
"error",
|
||||||
@@ -182,7 +195,7 @@
|
|||||||
],
|
],
|
||||||
"@typescript-eslint/type-annotation-spacing": "error",
|
"@typescript-eslint/type-annotation-spacing": "error",
|
||||||
"@typescript-eslint/unified-signatures": "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-floating-promises": "warn",
|
||||||
"@typescript-eslint/no-misused-promises": "warn",
|
"@typescript-eslint/no-misused-promises": "warn",
|
||||||
"@typescript-eslint/restrict-plus-operands": "warn",
|
"@typescript-eslint/restrict-plus-operands": "warn",
|
||||||
@@ -202,14 +215,45 @@
|
|||||||
|
|
||||||
"deprecation/deprecation": "warn",
|
"deprecation/deprecation": "warn",
|
||||||
|
|
||||||
|
"simple-import-sort/imports": "error",
|
||||||
|
"simple-import-sort/exports": "error",
|
||||||
"import/order": "off",
|
"import/order": "off",
|
||||||
|
"import/first": "error",
|
||||||
|
"import/newline-after-import": "error",
|
||||||
|
"import/no-duplicates": "error",
|
||||||
"import/no-deprecated": "warn",
|
"import/no-deprecated": "warn",
|
||||||
"import/no-namespace": "error",
|
"import/no-namespace": "error",
|
||||||
|
"import-newlines/enforce": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"items": 1,
|
||||||
|
"semi": true,
|
||||||
|
"forceSingleLine": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
"lodash/import-scope": [
|
"lodash/import-scope": [
|
||||||
"error",
|
"error",
|
||||||
"method"
|
"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": [
|
"extends": [
|
||||||
"plugin:@angular-eslint/template/recommended"
|
"plugin:@angular-eslint/template/recommended"
|
||||||
],
|
]
|
||||||
"rules": {
|
|
||||||
// todo: re-enable & fix errors
|
|
||||||
"@angular-eslint/template/no-negated-async": "off",
|
|
||||||
"@angular-eslint/template/eqeqeq": "off"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": [
|
"files": [
|
||||||
|
@@ -131,6 +131,10 @@ submission:
|
|||||||
# NOTE: after how many time (milliseconds) submission is saved automatically
|
# NOTE: after how many time (milliseconds) submission is saved automatically
|
||||||
# eg. timer: 5 * (1000 * 60); // 5 minutes
|
# eg. timer: 5 * (1000 * 60); // 5 minutes
|
||||||
timer: 0
|
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:
|
icons:
|
||||||
metadata:
|
metadata:
|
||||||
# NOTE: example of configuration
|
# NOTE: example of configuration
|
||||||
@@ -433,3 +437,61 @@ search:
|
|||||||
enabled: false
|
enabled: false
|
||||||
# List of filters to enable in "Advanced Search" dropdown
|
# List of filters to enable in "Advanced Search" dropdown
|
||||||
filter: [ 'title', 'author', 'subject', 'entityType' ]
|
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 'cypress-axe';
|
||||||
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
|
||||||
|
|
||||||
|
|
||||||
// Runs once before all tests
|
// Runs once before all tests
|
||||||
before(() => {
|
before(() => {
|
||||||
// Cypress doesn't have access to the running application in Node.js.
|
// Cypress doesn't have access to the running application in Node.js.
|
||||||
|
@@ -15,7 +15,10 @@ module.exports = function (config) {
|
|||||||
],
|
],
|
||||||
client: {
|
client: {
|
||||||
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||||
captureConsole: false
|
captureConsole: false,
|
||||||
|
jasmine: {
|
||||||
|
failSpecWithNoExpectations: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
coverageIstanbulReporter: {
|
coverageIstanbulReporter: {
|
||||||
dir: require('path').join(__dirname, './coverage/dspace-angular'),
|
dir: require('path').join(__dirname, './coverage/dspace-angular'),
|
||||||
|
@@ -128,7 +128,7 @@
|
|||||||
"react-copy-to-clipboard": "^5.1.0",
|
"react-copy-to-clipboard": "^5.1.0",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rxjs": "^7.8.0",
|
"rxjs": "^7.8.0",
|
||||||
"sanitize-html": "^2.10.0",
|
"sanitize-html": "^2.12.1",
|
||||||
"sortablejs": "1.15.0",
|
"sortablejs": "1.15.0",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"webfontloader": "1.6.28",
|
"webfontloader": "1.6.28",
|
||||||
@@ -170,9 +170,12 @@
|
|||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-deprecation": "^1.4.1",
|
"eslint-plugin-deprecation": "^1.4.1",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
|
"eslint-plugin-import-newlines": "^1.3.1",
|
||||||
"eslint-plugin-jsdoc": "^45.0.0",
|
"eslint-plugin-jsdoc": "^45.0.0",
|
||||||
"eslint-plugin-jsonc": "^2.6.0",
|
"eslint-plugin-jsonc": "^2.6.0",
|
||||||
"eslint-plugin-lodash": "^7.4.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",
|
"eslint-plugin-unused-imports": "^2.0.0",
|
||||||
"express-static-gzip": "^2.1.7",
|
"express-static-gzip": "^2.1.7",
|
||||||
"jasmine-core": "^3.8.0",
|
"jasmine-core": "^3.8.0",
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
|
||||||
import { getAccessControlModuleRoute } from '../app-routing-paths';
|
import { getAccessControlModuleRoute } from '../app-routing-paths';
|
||||||
|
import { URLCombiner } from '../core/url-combiner/url-combiner';
|
||||||
|
|
||||||
export const EPERSON_PATH = 'epeople';
|
export const EPERSON_PATH = 'epeople';
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
import { AbstractControl } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
||||||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
||||||
@@ -47,9 +48,9 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
|||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||||
useValue: ValidateEmailErrorStateMatcher
|
useValue: ValidateEmailErrorStateMatcher,
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* This module handles all components related to the access control pages
|
* 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 { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
|
import {
|
||||||
import { of } from 'rxjs';
|
ComponentFixture,
|
||||||
import { NgbAccordionModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
NgbAccordionModule,
|
||||||
|
NgbNavModule,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
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 { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec';
|
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 { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||||
import { ThemeService } from '../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../shared/theme-support/theme.service';
|
||||||
import { getMockThemeService } from '../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../shared/mocks/theme-service.mock';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
@@ -49,8 +55,8 @@ describe('BulkAccessBrowseComponent', () => {
|
|||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
],
|
],
|
||||||
schemas: [
|
schemas: [
|
||||||
NO_ERRORS_SCHEMA
|
NO_ERRORS_SCHEMA,
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
.overrideComponent(BulkAccessBrowseComponent, {
|
.overrideComponent(BulkAccessBrowseComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
@@ -96,7 +102,7 @@ describe('BulkAccessBrowseComponent', () => {
|
|||||||
'elementsPerPage': 5,
|
'elementsPerPage': 5,
|
||||||
'totalElements': 2,
|
'totalElements': 2,
|
||||||
'totalPages': 1,
|
'totalPages': 1,
|
||||||
'currentPage': 1
|
'currentPage': 1,
|
||||||
}), [selected1, selected2]);
|
}), [selected1, selected2]);
|
||||||
const rd = createSuccessfulRemoteDataObject(list);
|
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 { BehaviorSubject, Subscription } from 'rxjs';
|
||||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
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 { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
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 { 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 { 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 { hasValue } from '../../../shared/empty.util';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||||
@@ -27,6 +42,11 @@ import {
|
|||||||
ListableObjectComponentLoaderComponent
|
ListableObjectComponentLoaderComponent
|
||||||
} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
} 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 { 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({
|
@Component({
|
||||||
selector: 'ds-bulk-access-browse',
|
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(), {
|
paginationOptions$: BehaviorSubject<PaginationComponentOptions> = new BehaviorSubject<PaginationComponentOptions>(Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'bas',
|
id: 'bas',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,20 +115,20 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
|||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
|
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)),
|
||||||
).subscribe(this.objectsSelected$)
|
).subscribe(this.objectsSelected$),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pageNext() {
|
pageNext() {
|
||||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||||
currentPage: this.paginationOptions$.value.currentPage + 1
|
currentPage: this.paginationOptions$.value.currentPage + 1,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
pagePrev() {
|
pagePrev() {
|
||||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
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,
|
elementsPerPage: this.paginationOptions$.value.pageSize,
|
||||||
totalElements: list?.selection.length,
|
totalElements: list?.selection.length,
|
||||||
totalPages: this.calculatePageCount(this.paginationOptions$.value.pageSize, 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) {
|
if (pageInfo.currentPage > pageInfo.totalPages) {
|
||||||
pageInfo.currentPage = pageInfo.totalPages;
|
pageInfo.currentPage = pageInfo.totalPages;
|
||||||
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
|
||||||
currentPage: pageInfo.currentPage
|
currentPage: pageInfo.currentPage,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
return createSuccessfulRemoteDataObject(buildPaginatedList(pageInfo, list?.selection || []));
|
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 { 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 { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of } from 'rxjs';
|
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 { 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 { 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 { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
||||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||||
|
import { BulkAccessComponent } from './bulk-access.component';
|
||||||
|
|
||||||
describe('BulkAccessComponent', () => {
|
describe('BulkAccessComponent', () => {
|
||||||
let component: BulkAccessComponent;
|
let component: BulkAccessComponent;
|
||||||
@@ -34,35 +36,35 @@ describe('BulkAccessComponent', () => {
|
|||||||
'startDate': {
|
'startDate': {
|
||||||
'year': 2026,
|
'year': 2026,
|
||||||
'month': 5,
|
'month': 5,
|
||||||
'day': 31
|
'day': 31,
|
||||||
|
},
|
||||||
|
'endDate': null,
|
||||||
},
|
},
|
||||||
'endDate': null
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
'state': {
|
'state': {
|
||||||
'item': {
|
'item': {
|
||||||
'toggleStatus': true,
|
'toggleStatus': true,
|
||||||
'accessMode': 'replace'
|
'accessMode': 'replace',
|
||||||
},
|
},
|
||||||
'bitstream': {
|
'bitstream': {
|
||||||
'toggleStatus': false,
|
'toggleStatus': false,
|
||||||
'accessMode': '',
|
'accessMode': '',
|
||||||
'changesLimit': '',
|
'changesLimit': '',
|
||||||
'selectedBitstreams': []
|
'selectedBitstreams': [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const mockFile = {
|
const mockFile = {
|
||||||
'uuids': [
|
'uuids': [
|
||||||
'1234', '5678'
|
'1234', '5678',
|
||||||
],
|
],
|
||||||
'file': { }
|
'file': { },
|
||||||
};
|
};
|
||||||
|
|
||||||
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
const mockSettings: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||||
getValue: jasmine.createSpy('getValue'),
|
getValue: jasmine.createSpy('getValue'),
|
||||||
reset: jasmine.createSpy('reset')
|
reset: jasmine.createSpy('reset'),
|
||||||
});
|
});
|
||||||
const selection: any[] = [{ indexableObject: { uuid: '1234' } }, { indexableObject: { uuid: '5678' } }];
|
const selection: any[] = [{ indexableObject: { uuid: '1234' } }, { indexableObject: { uuid: '5678' } }];
|
||||||
const selectableListState: SelectableListState = { id: 'test', selection };
|
const selectableListState: SelectableListState = { id: 'test', selection };
|
||||||
@@ -83,7 +85,7 @@ describe('BulkAccessComponent', () => {
|
|||||||
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(BulkAccessComponent, {
|
.overrideComponent(BulkAccessComponent, {
|
||||||
remove: {
|
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 { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component';
|
import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component';
|
||||||
|
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-bulk-access',
|
selector: 'ds-bulk-access',
|
||||||
@@ -45,7 +54,7 @@ export class BulkAccessComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private bulkAccessControlService: BulkAccessControlService,
|
private bulkAccessControlService: BulkAccessControlService,
|
||||||
private selectableListService: SelectableListService
|
private selectableListService: SelectableListService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,8 +62,8 @@ export class BulkAccessComponent implements OnInit {
|
|||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.selectableListService.getSelectableList(this.listId).pipe(
|
this.selectableListService.getSelectableList(this.listId).pipe(
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
map((list: SelectableListState) => this.generateIdListBySelectedElements(list))
|
map((list: SelectableListState) => this.generateIdListBySelectedElements(list)),
|
||||||
).subscribe(this.objectsSelected$)
|
).subscribe(this.objectsSelected$),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,12 +91,12 @@ export class BulkAccessComponent implements OnInit {
|
|||||||
const { file } = this.bulkAccessControlService.createPayloadFile({
|
const { file } = this.bulkAccessControlService.createPayloadFile({
|
||||||
bitstreamAccess,
|
bitstreamAccess,
|
||||||
itemAccess,
|
itemAccess,
|
||||||
state: settings.state
|
state: settings.state,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.bulkAccessControlService.executeScript(
|
this.bulkAccessControlService.executeScript(
|
||||||
this.objectsSelected$.value || [],
|
this.objectsSelected$.value || [],
|
||||||
file
|
file,
|
||||||
).subscribe();
|
).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 { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
@@ -18,28 +23,28 @@ describe('BulkAccessSettingsComponent', () => {
|
|||||||
'startDate': {
|
'startDate': {
|
||||||
'year': 2026,
|
'year': 2026,
|
||||||
'month': 5,
|
'month': 5,
|
||||||
'day': 31
|
'day': 31,
|
||||||
|
},
|
||||||
|
'endDate': null,
|
||||||
},
|
},
|
||||||
'endDate': null
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
'state': {
|
'state': {
|
||||||
'item': {
|
'item': {
|
||||||
'toggleStatus': true,
|
'toggleStatus': true,
|
||||||
'accessMode': 'replace'
|
'accessMode': 'replace',
|
||||||
},
|
},
|
||||||
'bitstream': {
|
'bitstream': {
|
||||||
'toggleStatus': false,
|
'toggleStatus': false,
|
||||||
'accessMode': '',
|
'accessMode': '',
|
||||||
'changesLimit': '',
|
'changesLimit': '',
|
||||||
'selectedBitstreams': []
|
'selectedBitstreams': [],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
const mockControl: any = jasmine.createSpyObj('AccessControlFormContainerComponent', {
|
||||||
getFormValue: jasmine.createSpy('getFormValue'),
|
getFormValue: jasmine.createSpy('getFormValue'),
|
||||||
reset: jasmine.createSpy('reset')
|
reset: jasmine.createSpy('reset'),
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
import { Component, ViewChild } from '@angular/core';
|
|
||||||
import {
|
import {
|
||||||
AccessControlFormContainerComponent
|
Component,
|
||||||
} from '../../../shared/access-control-form-container/access-control-form-container.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 { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgIf } from '@angular/common';
|
import { NgIf } from '@angular/common';
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
/* eslint-disable max-classes-per-file */
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
|
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
import { type } from '../../shared/ngrx/type';
|
import { type } from '../../shared/ngrx/type';
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<ds-themed-loading *ngIf="searching$ | async"></ds-themed-loading>
|
<ds-themed-loading *ngIf="searching$ | async"></ds-themed-loading>
|
||||||
<ds-pagination
|
<ds-pagination
|
||||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(searching$ | async)"
|
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (searching$ | async) !== true"
|
||||||
[paginationOptions]="config"
|
[paginationOptions]="config"
|
||||||
[pageInfoState]="pageInfoState$"
|
[pageInfoState]="pageInfoState$"
|
||||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
</ds-pagination>
|
</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}}
|
{{labelPrefix + 'no-items' | translate}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,31 +1,61 @@
|
|||||||
import { Router } from '@angular/router';
|
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
import {
|
||||||
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
DebugElement,
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
NO_ERRORS_SCHEMA,
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
} from '@angular/core';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import {
|
||||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
ComponentFixture,
|
||||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
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 { RemoteData } from '../../core/data/remote-data';
|
||||||
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
|
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 { getMockFormBuilderService } from '../../shared/mocks/form-builder-service.mock';
|
||||||
import { getMockTranslateService } from '../../shared/mocks/translate.service.mock';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { TranslateLoaderMock } from '../../shared/mocks/translate-loader.mock';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
import {
|
||||||
|
EPersonMock,
|
||||||
|
EPersonMock2,
|
||||||
|
} from '../../shared/testing/eperson.mock';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
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 { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
@@ -35,17 +65,15 @@ import { RouterMock } from '../../shared/mocks/router.mock';
|
|||||||
describe('EPeopleRegistryComponent', () => {
|
describe('EPeopleRegistryComponent', () => {
|
||||||
let component: EPeopleRegistryComponent;
|
let component: EPeopleRegistryComponent;
|
||||||
let fixture: ComponentFixture<EPeopleRegistryComponent>;
|
let fixture: ComponentFixture<EPeopleRegistryComponent>;
|
||||||
let translateService: TranslateService;
|
|
||||||
let builderService: FormBuilderService;
|
let builderService: FormBuilderService;
|
||||||
|
|
||||||
let mockEPeople;
|
let mockEPeople: EPerson[];
|
||||||
let ePersonDataServiceStub: any;
|
let ePersonDataServiceStub: any;
|
||||||
let authorizationService: AuthorizationDataService;
|
let authorizationService: AuthorizationDataService;
|
||||||
let modalService;
|
let modalService: NgbModal;
|
||||||
|
let paginationService: PaginationServiceStub;
|
||||||
|
|
||||||
let paginationService;
|
beforeEach(waitForAsync(async () => {
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
|
||||||
jasmine.getEnv().allowRespy(true);
|
jasmine.getEnv().allowRespy(true);
|
||||||
mockEPeople = [EPersonMock, EPersonMock2];
|
mockEPeople = [EPersonMock, EPersonMock2];
|
||||||
ePersonDataServiceStub = {
|
ePersonDataServiceStub = {
|
||||||
@@ -56,7 +84,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
elementsPerPage: this.allEpeople.length,
|
elementsPerPage: this.allEpeople.length,
|
||||||
totalElements: this.allEpeople.length,
|
totalElements: this.allEpeople.length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), this.allEpeople));
|
}), this.allEpeople));
|
||||||
},
|
},
|
||||||
getActiveEPerson(): Observable<EPerson> {
|
getActiveEPerson(): Observable<EPerson> {
|
||||||
@@ -71,7 +99,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
elementsPerPage: [result].length,
|
elementsPerPage: [result].length,
|
||||||
totalElements: [result].length,
|
totalElements: [result].length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), [result]));
|
}), [result]));
|
||||||
}
|
}
|
||||||
if (scope === 'metadata') {
|
if (scope === 'metadata') {
|
||||||
@@ -80,7 +108,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
elementsPerPage: this.allEpeople.length,
|
elementsPerPage: this.allEpeople.length,
|
||||||
totalElements: this.allEpeople.length,
|
totalElements: this.allEpeople.length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), this.allEpeople));
|
}), this.allEpeople));
|
||||||
}
|
}
|
||||||
const result = this.allEpeople.find((ePerson: EPerson) => {
|
const result = this.allEpeople.find((ePerson: EPerson) => {
|
||||||
@@ -90,14 +118,14 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
elementsPerPage: [result].length,
|
elementsPerPage: [result].length,
|
||||||
totalElements: [result].length,
|
totalElements: [result].length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), [result]));
|
}), [result]));
|
||||||
}
|
}
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||||
elementsPerPage: this.allEpeople.length,
|
elementsPerPage: this.allEpeople.length,
|
||||||
totalElements: this.allEpeople.length,
|
totalElements: this.allEpeople.length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), this.allEpeople));
|
}), this.allEpeople));
|
||||||
},
|
},
|
||||||
deleteEPerson(ePerson: EPerson): Observable<boolean> {
|
deleteEPerson(ePerson: EPerson): Observable<boolean> {
|
||||||
@@ -117,23 +145,17 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
},
|
},
|
||||||
getEPeoplePageRouterLink(): string {
|
getEPeoplePageRouterLink(): string {
|
||||||
return '/access-control/epeople';
|
return '/access-control/epeople';
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||||
isAuthorized: observableOf(true)
|
isAuthorized: observableOf(true),
|
||||||
});
|
});
|
||||||
builderService = getMockFormBuilderService();
|
builderService = getMockFormBuilderService();
|
||||||
translateService = getMockTranslateService();
|
|
||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
TestBed.configureTestingModule({
|
awaitTestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot(), EPeopleRegistryComponent],
|
||||||
loader: {
|
|
||||||
provide: TranslateLoader,
|
|
||||||
useClass: TranslateLoaderMock
|
|
||||||
}
|
|
||||||
}), EPeopleRegistryComponent],
|
|
||||||
providers: [
|
providers: [
|
||||||
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
||||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
||||||
@@ -141,9 +163,9 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
{provide: FormBuilderService, useValue: builderService},
|
{provide: FormBuilderService, useValue: builderService},
|
||||||
{provide: Router, useValue: new RouterMock()},
|
{provide: Router, useValue: new RouterMock()},
|
||||||
{provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
|
{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, {
|
.overrideComponent(EPeopleRegistryComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
@@ -160,7 +182,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(EPeopleRegistryComponent);
|
fixture = TestBed.createComponent(EPeopleRegistryComponent);
|
||||||
component = fixture.componentInstance;
|
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) }) }));
|
spyOn(modalService, 'open').and.returnValue(Object.assign({ componentInstance: Object.assign({ response: observableOf(true) }) }));
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@@ -170,10 +192,10 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display list of ePeople', () => {
|
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);
|
expect(ePeopleIdsFound.length).toEqual(2);
|
||||||
mockEPeople.map((ePerson: EPerson) => {
|
mockEPeople.map((ePerson: EPerson) => {
|
||||||
expect(ePeopleIdsFound.find((foundEl) => {
|
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||||
return (foundEl.nativeElement.textContent.trim() === ePerson.uuid);
|
return (foundEl.nativeElement.textContent.trim() === ePerson.uuid);
|
||||||
})).toBeTruthy();
|
})).toBeTruthy();
|
||||||
});
|
});
|
||||||
@@ -181,7 +203,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
|
|
||||||
describe('search', () => {
|
describe('search', () => {
|
||||||
describe('when searching with scope/query (scope metadata)', () => {
|
describe('when searching with scope/query (scope metadata)', () => {
|
||||||
let ePeopleIdsFound;
|
let ePeopleIdsFound: DebugElement[];
|
||||||
beforeEach(fakeAsync(() => {
|
beforeEach(fakeAsync(() => {
|
||||||
component.search({ scope: 'metadata', query: EPersonMock2.name });
|
component.search({ scope: 'metadata', query: EPersonMock2.name });
|
||||||
tick();
|
tick();
|
||||||
@@ -191,14 +213,14 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
|
|
||||||
it('should display search result', () => {
|
it('should display search result', () => {
|
||||||
expect(ePeopleIdsFound.length).toEqual(1);
|
expect(ePeopleIdsFound.length).toEqual(1);
|
||||||
expect(ePeopleIdsFound.find((foundEl) => {
|
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||||
return (foundEl.nativeElement.textContent.trim() === EPersonMock2.uuid);
|
return (foundEl.nativeElement.textContent.trim() === EPersonMock2.uuid);
|
||||||
})).toBeTruthy();
|
})).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when searching with scope/query (scope email)', () => {
|
describe('when searching with scope/query (scope email)', () => {
|
||||||
let ePeopleIdsFound;
|
let ePeopleIdsFound: DebugElement[];
|
||||||
beforeEach(fakeAsync(() => {
|
beforeEach(fakeAsync(() => {
|
||||||
component.search({ scope: 'email', query: EPersonMock.email });
|
component.search({ scope: 'email', query: EPersonMock.email });
|
||||||
tick();
|
tick();
|
||||||
@@ -208,7 +230,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
|
|
||||||
it('should display search result', () => {
|
it('should display search result', () => {
|
||||||
expect(ePeopleIdsFound.length).toEqual(1);
|
expect(ePeopleIdsFound.length).toEqual(1);
|
||||||
expect(ePeopleIdsFound.find((foundEl) => {
|
expect(ePeopleIdsFound.find((foundEl: DebugElement) => {
|
||||||
return (foundEl.nativeElement.textContent.trim() === EPersonMock.uuid);
|
return (foundEl.nativeElement.textContent.trim() === EPersonMock.uuid);
|
||||||
})).toBeTruthy();
|
})).toBeTruthy();
|
||||||
});
|
});
|
||||||
@@ -224,7 +246,7 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
const deleteButtons = fixture.debugElement.queryAll(By.css('.access-control-deleteEPersonButton'));
|
const deleteButtons = fixture.debugElement.queryAll(By.css('.access-control-deleteEPersonButton'));
|
||||||
deleteButtons[0].triggerEventHandler('click', {
|
deleteButtons[0].triggerEventHandler('click', {
|
||||||
preventDefault: () => {/**/
|
preventDefault: () => {/**/
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
tick();
|
tick();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@@ -240,19 +262,12 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('delete EPerson button when the isAuthorized returns false', () => {
|
|
||||||
let ePeopleDeleteButton;
|
it('should hide delete EPerson button when the isAuthorized returns false', () => {
|
||||||
beforeEach(() => {
|
|
||||||
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
spyOn(authorizationService, 'isAuthorized').and.returnValue(observableOf(false));
|
||||||
component.initialisePage();
|
component.initialisePage();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
|
||||||
|
|
||||||
it('should be disabled', () => {
|
expect(fixture.debugElement.query(By.css('#epeople tr td div button.delete-button'))).toBeNull();
|
||||||
ePeopleDeleteButton = fixture.debugElement.queryAll(By.css('#epeople tr td div button.delete-button'));
|
|
||||||
ePeopleDeleteButton.forEach((deleteButton: DebugElement) => {
|
|
||||||
expect(deleteButton.nativeElement.disabled).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -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 { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||||
import { Router, RouterModule } from '@angular/router';
|
import { Router, RouterModule } from '@angular/router';
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
|
import {
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
BehaviorSubject,
|
||||||
import { buildPaginatedList, PaginatedList } from '../../core/data/paginated-list.model';
|
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 { RemoteData } from '../../core/data/remote-data';
|
||||||
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
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 { hasValue } from '../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
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 { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
|
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
|
||||||
|
import {
|
||||||
|
getEPersonEditRoute,
|
||||||
|
getEPersonsRoute,
|
||||||
|
} from '../access-control-routing-paths';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-epeople-registry',
|
selector: 'ds-epeople-registry',
|
||||||
@@ -79,7 +114,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'elp',
|
id: 'elp',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
// The search form
|
// The search form
|
||||||
@@ -138,7 +173,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
epersonDtoModel.ableToDelete = authorized;
|
epersonDtoModel.ableToDelete = authorized;
|
||||||
epersonDtoModel.eperson = eperson;
|
epersonDtoModel.eperson = eperson;
|
||||||
return epersonDtoModel;
|
return epersonDtoModel;
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
})).pipe(map((dtos: EpersonDtoModel[]) => {
|
})).pipe(map((dtos: EpersonDtoModel[]) => {
|
||||||
return buildPaginatedList(epeople.pageInfo, dtos);
|
return buildPaginatedList(epeople.pageInfo, dtos);
|
||||||
@@ -168,14 +203,14 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
const scope: string = data.scope;
|
const scope: string = data.scope;
|
||||||
if (query != null && this.currentSearchQuery !== query) {
|
if (query != null && this.currentSearchQuery !== query) {
|
||||||
void this.router.navigate([getEPersonsRoute()], {
|
void this.router.navigate([getEPersonsRoute()], {
|
||||||
queryParamsHandling: 'merge'
|
queryParamsHandling: 'merge',
|
||||||
});
|
});
|
||||||
this.currentSearchQuery = query;
|
this.currentSearchQuery = query;
|
||||||
this.paginationService.resetPage(this.config.id);
|
this.paginationService.resetPage(this.config.id);
|
||||||
}
|
}
|
||||||
if (scope != null && this.currentSearchScope !== scope) {
|
if (scope != null && this.currentSearchScope !== scope) {
|
||||||
void this.router.navigate([getEPersonsRoute()], {
|
void this.router.navigate([getEPersonsRoute()], {
|
||||||
queryParamsHandling: 'merge'
|
queryParamsHandling: 'merge',
|
||||||
});
|
});
|
||||||
this.currentSearchScope = scope;
|
this.currentSearchScope = scope;
|
||||||
this.paginationService.resetPage(this.config.id);
|
this.paginationService.resetPage(this.config.id);
|
||||||
@@ -183,15 +218,15 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
|
return this.epersonService.searchByScope(this.currentSearchScope, this.currentSearchQuery, {
|
||||||
currentPage: findListOptions.currentPage,
|
currentPage: findListOptions.currentPage,
|
||||||
elementsPerPage: findListOptions.pageSize
|
elementsPerPage: findListOptions.pageSize,
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
getAllSucceededRemoteData(),
|
getAllSucceededRemoteData(),
|
||||||
).subscribe((peopleRD) => {
|
).subscribe((peopleRD) => {
|
||||||
this.ePeople$.next(peopleRD.payload);
|
this.ePeople$.next(peopleRD.payload);
|
||||||
this.pageInfoState$.next(peopleRD.payload.pageInfo);
|
this.pageInfoState$.next(peopleRD.payload.pageInfo);
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +236,7 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
isActive(eperson: EPerson): Observable<boolean> {
|
isActive(eperson: EPerson): Observable<boolean> {
|
||||||
return this.getActiveEPerson().pipe(
|
return this.getActiveEPerson().pipe(
|
||||||
map((activeEPerson) => eperson === activeEPerson)
|
map((activeEPerson) => eperson === activeEPerson),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 { EPersonMock } from '../../shared/testing/eperson.mock';
|
||||||
|
import {
|
||||||
|
EPeopleRegistryCancelEPersonAction,
|
||||||
|
EPeopleRegistryEditEPersonAction,
|
||||||
|
} from './epeople-registry.actions';
|
||||||
|
import {
|
||||||
|
ePeopleRegistryReducer,
|
||||||
|
EPeopleRegistryState,
|
||||||
|
} from './epeople-registry.reducers';
|
||||||
|
|
||||||
const initialState: EPeopleRegistryState = {
|
const initialState: EPeopleRegistryState = {
|
||||||
editEPerson: null,
|
editEPerson: null,
|
||||||
|
@@ -2,7 +2,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model';
|
|||||||
import {
|
import {
|
||||||
EPeopleRegistryAction,
|
EPeopleRegistryAction,
|
||||||
EPeopleRegistryActionTypes,
|
EPeopleRegistryActionTypes,
|
||||||
EPeopleRegistryEditEPersonAction
|
EPeopleRegistryEditEPersonAction,
|
||||||
} from './epeople-registry.actions';
|
} from './epeople-registry.actions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,13 +30,13 @@ export function ePeopleRegistryReducer(state = initialState, action: EPeopleRegi
|
|||||||
|
|
||||||
case EPeopleRegistryActionTypes.EDIT_EPERSON: {
|
case EPeopleRegistryActionTypes.EDIT_EPERSON: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson
|
editEPerson: (action as EPeopleRegistryEditEPersonAction).eperson,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case EPeopleRegistryActionTypes.CANCEL_EDIT_EPERSON: {
|
case EPeopleRegistryActionTypes.CANCEL_EDIT_EPERSON: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
editEPerson: null
|
editEPerson: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="displayResetPassword" between class="btn-group">
|
<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}}
|
<i class="fa fa-key"></i> {{'admin.access-control.epeople.actions.reset' | translate}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,13 +47,13 @@
|
|||||||
<div *ngIf="epersonService.getActiveEPerson() | async">
|
<div *ngIf="epersonService.getActiveEPerson() | async">
|
||||||
<h2>{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}</h2>
|
<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
|
<ds-pagination
|
||||||
*ngIf="(groups | async)?.payload?.totalElements > 0"
|
*ngIf="(groups$ | async)?.payload?.totalElements > 0"
|
||||||
[paginationOptions]="config"
|
[paginationOptions]="config"
|
||||||
[pageInfoState]="(groups | async)?.payload"
|
[pageInfoState]="groupsPageInfoState$"
|
||||||
[collectionSize]="(groups | async)?.payload?.totalElements"
|
[collectionSize]="(groups$ | async)?.payload?.totalElements"
|
||||||
[hideGear]="true"
|
[hideGear]="true"
|
||||||
[hidePagerWhenSinglePage]="true"
|
[hidePagerWhenSinglePage]="true"
|
||||||
(pageChange)="onPageChange($event)">
|
(pageChange)="onPageChange($event)">
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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">{{group.id}}</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
<a (click)="groupsDataService.startEditingNewGroup(group)"
|
<a (click)="groupsDataService.startEditingNewGroup(group)"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
</ds-pagination>
|
</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>{{messagePrefix + '.memberOfNoGroups' | translate}}</div>
|
||||||
<div>
|
<div>
|
||||||
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
|
<button [routerLink]="[groupsDataService.getGroupRegistryRouterLink()]"
|
||||||
|
@@ -1,28 +1,61 @@
|
|||||||
import { Observable, of as observableOf } from 'rxjs';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import {
|
||||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
|
ComponentFixture,
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
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 { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import {
|
||||||
import { buildPaginatedList, PaginatedList } from '../../../core/data/paginated-list.model';
|
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 { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.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 { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||||
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
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 { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { EPersonFormComponent } from './eperson-form.component';
|
import { EPersonFormComponent } from './eperson-form.component';
|
||||||
import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock';
|
import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
|
||||||
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
|
||||||
import { AuthService } from '../../../core/auth/auth.service';
|
|
||||||
import { AuthServiceStub } from '../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../shared/testing/auth-service.stub';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import {
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
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 { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.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 { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { FormComponent } from '../../../shared/form/form.component';
|
import { FormComponent } from '../../../shared/form/form.component';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
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 { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
@@ -117,7 +154,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
},
|
},
|
||||||
findById(_id: string, _useCachedVersionIfAvailable = true, _reRequestOnStale = true, ..._linksToFollow: FollowLinkConfig<EPerson>[]): Observable<RemoteData<EPerson>> {
|
findById(_id: string, _useCachedVersionIfAvailable = true, _reRequestOnStale = true, ..._linksToFollow: FollowLinkConfig<EPerson>[]): Observable<RemoteData<EPerson>> {
|
||||||
return createSuccessfulRemoteDataObject$(null);
|
return createSuccessfulRemoteDataObject$(null);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
builderService = Object.assign(getMockFormBuilderService(),{
|
builderService = Object.assign(getMockFormBuilderService(),{
|
||||||
createFormGroup(formModel, options = null) {
|
createFormGroup(formModel, options = null) {
|
||||||
@@ -180,7 +217,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
},
|
},
|
||||||
isObject(value) {
|
isObject(value) {
|
||||||
return typeof value === 'object' && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
authService = new AuthServiceStub();
|
authService = new AuthServiceStub();
|
||||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||||
@@ -189,7 +226,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
});
|
});
|
||||||
groupsDataService = jasmine.createSpyObj('groupsDataService', {
|
groupsDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
findListByHref: createSuccessfulRemoteDataObject$(createPaginatedList([])),
|
||||||
getGroupRegistryRouterLink: ''
|
getGroupRegistryRouterLink: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
@@ -200,9 +237,12 @@ describe('EPersonFormComponent', () => {
|
|||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}), EPersonFormComponent],
|
}),
|
||||||
|
EPersonFormComponent,
|
||||||
|
HasNoValuePipe,
|
||||||
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{ provide: GroupDataService, useValue: groupsDataService },
|
{ provide: GroupDataService, useValue: groupsDataService },
|
||||||
@@ -214,9 +254,10 @@ describe('EPersonFormComponent', () => {
|
|||||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||||
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
|
{ provide: EpersonRegistrationService, useValue: epersonRegistrationService },
|
||||||
{ provide: ActivatedRoute, useValue: route },
|
{ provide: ActivatedRoute, useValue: route },
|
||||||
{ provide: Router, useValue: router }
|
{ provide: Router, useValue: router },
|
||||||
|
EPeopleRegistryComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(EPersonFormComponent, {
|
.overrideComponent(EPersonFormComponent, {
|
||||||
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]}
|
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]}
|
||||||
@@ -225,7 +266,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', {
|
epersonRegistrationService = jasmine.createSpyObj('epersonRegistrationService', {
|
||||||
registerEmail: createSuccessfulRemoteDataObject$(null)
|
registerEmail: createSuccessfulRemoteDataObject$(null),
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -257,12 +298,12 @@ describe('EPersonFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'eperson.firstname': [
|
'eperson.firstname': [
|
||||||
{
|
{
|
||||||
value: firstName
|
value: firstName,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
'eperson.lastname': [
|
'eperson.lastname': [
|
||||||
{
|
{
|
||||||
value: lastName
|
value: lastName,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -331,7 +372,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
const ePersonServiceWithEperson = Object.assign(ePersonDataServiceStub,{
|
const ePersonServiceWithEperson = Object.assign(ePersonDataServiceStub,{
|
||||||
getEPersonByEmail(): Observable<RemoteData<EPerson>> {
|
getEPersonByEmail(): Observable<RemoteData<EPerson>> {
|
||||||
return createSuccessfulRemoteDataObject$(EPersonMock);
|
return createSuccessfulRemoteDataObject$(EPersonMock);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
component.formGroup.controls.email.setValue('test@test.com');
|
component.formGroup.controls.email.setValue('test@test.com');
|
||||||
component.formGroup.controls.email.setAsyncValidators(ValidateEmailNotTaken.createValidator(ePersonServiceWithEperson));
|
component.formGroup.controls.email.setAsyncValidators(ValidateEmailNotTaken.createValidator(ePersonServiceWithEperson));
|
||||||
@@ -366,12 +407,12 @@ describe('EPersonFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'eperson.firstname': [
|
'eperson.firstname': [
|
||||||
{
|
{
|
||||||
value: firstName
|
value: firstName,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
'eperson.lastname': [
|
'eperson.lastname': [
|
||||||
{
|
{
|
||||||
value: lastName
|
value: lastName,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -407,19 +448,19 @@ describe('EPersonFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'eperson.firstname': [
|
'eperson.firstname': [
|
||||||
{
|
{
|
||||||
value: firstName
|
value: firstName,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
'eperson.lastname': [
|
'eperson.lastname': [
|
||||||
{
|
{
|
||||||
value: lastName
|
value: lastName,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
email: email,
|
email: email,
|
||||||
canLogIn: canLogIn,
|
canLogIn: canLogIn,
|
||||||
requireCertificate: requireCertificate,
|
requireCertificate: requireCertificate,
|
||||||
_links: undefined
|
_links: undefined,
|
||||||
});
|
});
|
||||||
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
|
spyOn(ePersonDataServiceStub, 'getActiveEPerson').and.returnValue(observableOf(expectedWithId));
|
||||||
component.onSubmit();
|
component.onSubmit();
|
||||||
@@ -439,7 +480,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
spyOn(authService, 'impersonate').and.callThrough();
|
spyOn(authService, 'impersonate').and.callThrough();
|
||||||
ePersonId = 'testEPersonId';
|
ePersonId = 'testEPersonId';
|
||||||
component.epersonInitial = Object.assign(new EPerson(), {
|
component.epersonInitial = Object.assign(new EPerson(), {
|
||||||
id: ePersonId
|
id: ePersonId,
|
||||||
});
|
});
|
||||||
component.impersonate();
|
component.impersonate();
|
||||||
});
|
});
|
||||||
@@ -527,7 +568,7 @@ describe('EPersonFormComponent', () => {
|
|||||||
ePersonEmail = 'person.email@4science.it';
|
ePersonEmail = 'person.email@4science.it';
|
||||||
component.epersonInitial = Object.assign(new EPerson(), {
|
component.epersonInitial = Object.assign(new EPerson(), {
|
||||||
id: ePersonId,
|
id: ePersonId,
|
||||||
email: ePersonEmail
|
email: ePersonEmail,
|
||||||
});
|
});
|
||||||
component.resetPassword();
|
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 { UntypedFormGroup } from '@angular/forms';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {
|
import {
|
||||||
DynamicCheckboxModel,
|
DynamicCheckboxModel,
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
DynamicFormLayout,
|
DynamicFormLayout,
|
||||||
DynamicInputModel
|
DynamicInputModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription } from 'rxjs';
|
import {
|
||||||
import { debounceTime, finalize, map, switchMap, take } from 'rxjs/operators';
|
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 { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||||
import { Group } from '../../../core/eperson/models/group.model';
|
import { Group } from '../../../core/eperson/models/group.model';
|
||||||
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import {
|
import {
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getFirstSucceededRemoteData,
|
getFirstSucceededRemoteData,
|
||||||
getRemoteDataPayload
|
getRemoteDataPayload,
|
||||||
} from '../../../core/shared/operators';
|
} 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 { hasValue } from '../../../shared/empty.util';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
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 { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||||
import { Registration } from '../../../core/shared/registration.model';
|
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 { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||||
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
||||||
|
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-eperson-form',
|
selector: 'ds-eperson-form',
|
||||||
@@ -98,28 +127,28 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
formLayout: DynamicFormLayout = {
|
formLayout: DynamicFormLayout = {
|
||||||
firstName: {
|
firstName: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'row'
|
host: 'row',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
lastName: {
|
lastName: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'row'
|
host: 'row',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
email: {
|
email: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'row'
|
host: 'row',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
canLogIn: {
|
canLogIn: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'col col-sm-6 d-inline-block'
|
host: 'col col-sm-6 d-inline-block',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
requireCertificate: {
|
requireCertificate: {
|
||||||
grid: {
|
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
|
* 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
|
* 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(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'gem',
|
id: 'gem',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -272,23 +306,23 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
required: true,
|
required: true,
|
||||||
errorMessages: {
|
errorMessages: {
|
||||||
emailTaken: 'error.validation.emailTaken',
|
emailTaken: 'error.validation.emailTaken',
|
||||||
pattern: 'error.validation.NotValidEmail'
|
pattern: 'error.validation.NotValidEmail',
|
||||||
},
|
},
|
||||||
hint: emailHint
|
hint: emailHint,
|
||||||
});
|
});
|
||||||
this.canLogIn = new DynamicCheckboxModel(
|
this.canLogIn = new DynamicCheckboxModel(
|
||||||
{
|
{
|
||||||
id: 'canLogIn',
|
id: 'canLogIn',
|
||||||
label: canLogIn,
|
label: canLogIn,
|
||||||
name: 'canLogIn',
|
name: 'canLogIn',
|
||||||
value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true)
|
value: (this.epersonInitial != null ? this.epersonInitial.canLogIn : true),
|
||||||
});
|
});
|
||||||
this.requireCertificate = new DynamicCheckboxModel(
|
this.requireCertificate = new DynamicCheckboxModel(
|
||||||
{
|
{
|
||||||
id: 'requireCertificate',
|
id: 'requireCertificate',
|
||||||
label: requireCertificate,
|
label: requireCertificate,
|
||||||
name: 'requireCertificate',
|
name: 'requireCertificate',
|
||||||
value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false)
|
value: (this.epersonInitial != null ? this.epersonInitial.requireCertificate : false),
|
||||||
});
|
});
|
||||||
this.formModel = [
|
this.formModel = [
|
||||||
this.firstName,
|
this.firstName,
|
||||||
@@ -300,9 +334,9 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
|
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
|
||||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
||||||
if (eperson != null) {
|
if (eperson != null) {
|
||||||
this.groups = this.groupsDataService.findListByHref(eperson._links.groups.href, {
|
this.groups$ = this.groupsDataService.findListByHref(eperson._links.groups.href, {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
elementsPerPage: this.config.pageSize
|
elementsPerPage: this.config.pageSize,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.formGroup.patchValue({
|
this.formGroup.patchValue({
|
||||||
@@ -310,7 +344,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '',
|
lastName: eperson != null ? eperson.firstMetadataValue('eperson.lastname') : '',
|
||||||
email: eperson != null ? eperson.email : '',
|
email: eperson != null ? eperson.email : '',
|
||||||
canLogIn: eperson != null ? eperson.canLogIn : true,
|
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) {
|
if (eperson === null && !!this.formGroup.controls.email) {
|
||||||
@@ -323,11 +357,11 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const activeEPerson$ = this.epersonService.getActiveEPerson();
|
const activeEPerson$ = this.epersonService.getActiveEPerson();
|
||||||
|
|
||||||
this.groups = activeEPerson$.pipe(
|
this.groups$ = activeEPerson$.pipe(
|
||||||
switchMap((eperson) => {
|
switchMap((eperson) => {
|
||||||
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
return observableCombineLatest([observableOf(eperson), this.paginationService.getFindListOptions(this.config.id, {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
elementsPerPage: this.config.pageSize
|
elementsPerPage: this.config.pageSize,
|
||||||
})]);
|
})]);
|
||||||
}),
|
}),
|
||||||
switchMap(([eperson, findListOptions]) => {
|
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 this.groupsDataService.findListByHref(eperson._links.groups.href, findListOptions, true, true, followLink('object'));
|
||||||
}
|
}
|
||||||
return observableOf(undefined);
|
return observableOf(undefined);
|
||||||
})
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.groupsPageInfoState$ = this.groups$.pipe(
|
||||||
|
map(groupsRD => groupsRD.payload.pageInfo),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.canImpersonate$ = activeEPerson$.pipe(
|
this.canImpersonate$ = activeEPerson$.pipe(
|
||||||
@@ -345,10 +383,10 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
return observableOf(false);
|
return observableOf(false);
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
this.canDelete$ = activeEPerson$.pipe(
|
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);
|
this.canReset$ = observableOf(true);
|
||||||
});
|
});
|
||||||
@@ -376,12 +414,12 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'eperson.firstname': [
|
'eperson.firstname': [
|
||||||
{
|
{
|
||||||
value: this.firstName.value
|
value: this.firstName.value,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
'eperson.lastname': [
|
'eperson.lastname': [
|
||||||
{
|
{
|
||||||
value: this.lastName.value
|
value: this.lastName.value,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -394,7 +432,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
this.editEPerson(ePerson, values);
|
this.editEPerson(ePerson, values);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +445,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const response = this.epersonService.create(ePersonToCreate);
|
const response = this.epersonService.create(ePersonToCreate);
|
||||||
response.pipe(
|
response.pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe((rd: RemoteData<EPerson>) => {
|
).subscribe((rd: RemoteData<EPerson>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
this.notificationsService.success(this.translateService.get(this.labelPrefix + 'notification.created.success', { name: this.dsoNameService.getName(ePersonToCreate) }));
|
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: {
|
metadata: {
|
||||||
'eperson.firstname': [
|
'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': [
|
'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) {
|
onPageChange(event) {
|
||||||
this.updateGroups({
|
this.updateGroups({
|
||||||
currentPage: event,
|
currentPage: event,
|
||||||
elementsPerPage: this.config.pageSize
|
elementsPerPage: this.config.pageSize,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,15 +546,15 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
this.canDelete$ = observableOf(false);
|
this.canDelete$ = observableOf(false);
|
||||||
return this.epersonService.deleteEPerson(eperson).pipe(
|
return this.epersonService.deleteEPerson(eperson).pipe(
|
||||||
getFirstCompletedRemoteData(),
|
getFirstCompletedRemoteData(),
|
||||||
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson }))
|
map((restResponse: RemoteData<NoContent>) => ({ restResponse, eperson })),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return observableOf(null);
|
return observableOf(null);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
finalize(() => this.canDelete$ = observableOf(true))
|
finalize(() => this.canDelete$ = observableOf(true)),
|
||||||
);
|
);
|
||||||
})
|
}),
|
||||||
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
).subscribe(({ restResponse, eperson }: { restResponse: RemoteData<NoContent> | null, eperson: EPerson }) => {
|
||||||
if (restResponse?.hasSucceeded) {
|
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) }));
|
||||||
@@ -551,7 +589,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'),
|
this.notificationsService.error(this.translateService.get('forgot-email.form.error.head'),
|
||||||
this.translateService.get('forgot-email.form.error.content', { email: this.epersonInitial.email }));
|
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
|
// Relevant message for email in use
|
||||||
this.subs.push(this.epersonService.searchByScope('email', ePerson.email, {
|
this.subs.push(this.epersonService.searchByScope('email', ePerson.email, {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
elementsPerPage: 0
|
elementsPerPage: 0,
|
||||||
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
||||||
.subscribe((list: PaginatedList<EPerson>) => {
|
.subscribe((list: PaginatedList<EPerson>) => {
|
||||||
if (list.totalElements > 0) {
|
if (list.totalElements > 0) {
|
||||||
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.' + notificationSection + '.failure.emailInUse', {
|
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.' + notificationSection + '.failure.emailInUse', {
|
||||||
name: this.dsoNameService.getName(ePerson),
|
name: this.dsoNameService.getName(ePerson),
|
||||||
email: ePerson.email
|
email: ePerson.email,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -594,7 +632,7 @@ export class EPersonFormComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
private updateGroups(options) {
|
private updateGroups(options) {
|
||||||
this.subs.push(this.epersonService.getActiveEPerson().subscribe((eperson: EPerson) => {
|
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 { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||||
import { getFirstSucceededRemoteData, } from '../../../../core/shared/operators';
|
import { getFirstSucceededRemoteData } from '../../../../core/shared/operators';
|
||||||
|
|
||||||
export class ValidateEmailNotTaken {
|
export class ValidateEmailNotTaken {
|
||||||
|
|
||||||
@@ -17,8 +20,8 @@ export class ValidateEmailNotTaken {
|
|||||||
.pipe(
|
.pipe(
|
||||||
getFirstSucceededRemoteData(),
|
getFirstSucceededRemoteData(),
|
||||||
map(res => {
|
map(res => {
|
||||||
return !!res.payload ? { emailTaken: true } : null;
|
return res.payload ? { emailTaken: true } : null;
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,21 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
import {
|
||||||
import { Observable } from 'rxjs';
|
ActivatedRouteSnapshot,
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
Resolve,
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
RouterStateSnapshot,
|
||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
} from '@angular/router';
|
||||||
import { ResolvedAction } from '../../core/resolving/resolver.actions';
|
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
|
||||||
import { Store } from '@ngrx/store';
|
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>[] = [
|
export const EPERSON_EDIT_FOLLOW_LINKS: FollowLinkConfig<EPerson>[] = [
|
||||||
followLink('groups'),
|
followLink('groups'),
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertTypeEnum.Warning"
|
<ds-alert *ngIf="groupBeingEdited?.permanent" [type]="AlertTypeEnum.Warning"
|
||||||
[content]="messagePrefix + '.alert.permanent'"></ds-alert>
|
[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) })">
|
[content]="(messagePrefix + '.alert.workflowGroup' | translate:{ name: dsoNameService.getName((getLinkedDSO(groupBeingEdited) | async)?.payload), comcol: (getLinkedDSO(groupBeingEdited) | async)?.payload?.type, comcolEditRolesRoute: (getLinkedEditRolesRoute(groupBeingEdited) | async) })">
|
||||||
</ds-alert>
|
</ds-alert>
|
||||||
|
|
||||||
@@ -47,10 +47,10 @@
|
|||||||
</ds-form>
|
</ds-form>
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<ds-members-list *ngIf="groupBeingEdited != null"
|
<ds-members-list *ngIf="groupBeingEdited !== undefined"
|
||||||
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
||||||
</div>
|
</div>
|
||||||
<ds-subgroups-list *ngIf="groupBeingEdited != null"
|
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
|
||||||
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,43 +1,44 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||||
import { UntypedFormControl, UntypedFormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators, } from '@angular/forms';
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router, } from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
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 { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||||
import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service';
|
import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service';
|
||||||
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-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 { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { Group } from '../../../core/eperson/models/group.model';
|
import { Group } from '../../../core/eperson/models/group.model';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||||
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { UUIDService } from '../../../core/shared/uuid.service';
|
import { UUIDService } from '../../../core/shared/uuid.service';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.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 { 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 { FormComponent } from '../../../shared/form/form.component';
|
||||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||||
@@ -70,8 +71,8 @@ describe('GroupFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'dc.description': [
|
'dc.description': [
|
||||||
{
|
{
|
||||||
value: groupDescription
|
value: groupDescription,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -110,7 +111,7 @@ describe('GroupFormComponent', () => {
|
|||||||
create(group: Group): Observable<RemoteData<Group>> {
|
create(group: Group): Observable<RemoteData<Group>> {
|
||||||
this.allGroups = [...this.allGroups, group];
|
this.allGroups = [...this.allGroups, group];
|
||||||
this.createdGroup = Object.assign({}, group, {
|
this.createdGroup = Object.assign({}, group, {
|
||||||
_links: { self: { href: 'group-selflink' } }
|
_links: { self: { href: 'group-selflink' } },
|
||||||
});
|
});
|
||||||
return createSuccessfulRemoteDataObject$(this.createdGroup);
|
return createSuccessfulRemoteDataObject$(this.createdGroup);
|
||||||
},
|
},
|
||||||
@@ -119,15 +120,15 @@ describe('GroupFormComponent', () => {
|
|||||||
},
|
},
|
||||||
getGroupEditPageRouterLinkWithID(id: string) {
|
getGroupEditPageRouterLinkWithID(id: string) {
|
||||||
return `group-edit-page-for-${id}`;
|
return `group-edit-page-for-${id}`;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
authorizationService = jasmine.createSpyObj('authorizationService', {
|
authorizationService = jasmine.createSpyObj('authorizationService', {
|
||||||
isAuthorized: observableOf(true)
|
isAuthorized: observableOf(true),
|
||||||
});
|
});
|
||||||
dsoDataServiceStub = {
|
dsoDataServiceStub = {
|
||||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||||
return null;
|
return null;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
builderService = Object.assign(getMockFormBuilderService(),{
|
builderService = Object.assign(getMockFormBuilderService(),{
|
||||||
createFormGroup(formModel, options = null) {
|
createFormGroup(formModel, options = null) {
|
||||||
@@ -190,7 +191,7 @@ describe('GroupFormComponent', () => {
|
|||||||
},
|
},
|
||||||
isObject(value) {
|
isObject(value) {
|
||||||
return typeof value === 'object' && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
translateService = getMockTranslateService();
|
translateService = getMockTranslateService();
|
||||||
router = new RouterMock();
|
router = new RouterMock();
|
||||||
@@ -200,8 +201,8 @@ describe('GroupFormComponent', () => {
|
|||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}), GroupFormComponent],
|
}), GroupFormComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
@@ -219,12 +220,12 @@ describe('GroupFormComponent', () => {
|
|||||||
{ provide: HALEndpointService, useValue: {} },
|
{ provide: HALEndpointService, useValue: {} },
|
||||||
{
|
{
|
||||||
provide: ActivatedRoute,
|
provide: ActivatedRoute,
|
||||||
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) }
|
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) },
|
||||||
},
|
},
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(GroupFormComponent, {
|
.overrideComponent(GroupFormComponent, {
|
||||||
remove: { imports: [
|
remove: { imports: [
|
||||||
@@ -270,8 +271,8 @@ describe('GroupFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'dc.description': [
|
'dc.description': [
|
||||||
{
|
{
|
||||||
value: groupDescription
|
value: groupDescription,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -286,11 +287,11 @@ describe('GroupFormComponent', () => {
|
|||||||
const operations = [{
|
const operations = [{
|
||||||
op: 'add',
|
op: 'add',
|
||||||
path: '/metadata/dc.description',
|
path: '/metadata/dc.description',
|
||||||
value: 'testDescription'
|
value: 'testDescription',
|
||||||
}, {
|
}, {
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
path: '/name',
|
path: '/name',
|
||||||
value: 'newGroupName'
|
value: 'newGroupName',
|
||||||
}];
|
}];
|
||||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||||
});
|
});
|
||||||
@@ -302,7 +303,7 @@ describe('GroupFormComponent', () => {
|
|||||||
const operations = [{
|
const operations = [{
|
||||||
op: 'add',
|
op: 'add',
|
||||||
path: '/metadata/dc.description',
|
path: '/metadata/dc.description',
|
||||||
value: 'testDescription'
|
value: 'testDescription',
|
||||||
}];
|
}];
|
||||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||||
});
|
});
|
||||||
@@ -314,7 +315,7 @@ describe('GroupFormComponent', () => {
|
|||||||
const operations = [{
|
const operations = [{
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
path: '/name',
|
path: '/name',
|
||||||
value: 'newGroupName'
|
value: 'newGroupName',
|
||||||
}];
|
}];
|
||||||
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
expect(groupsDataServiceStub.patch).toHaveBeenCalledWith(expected, operations);
|
||||||
});
|
});
|
||||||
@@ -351,8 +352,8 @@ describe('GroupFormComponent', () => {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'dc.description': [
|
'dc.description': [
|
||||||
{
|
{
|
||||||
value: groupDescription
|
value: groupDescription,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -389,7 +390,7 @@ describe('GroupFormComponent', () => {
|
|||||||
const groupsDataServiceStubWithGroup = Object.assign(groupsDataServiceStub,{
|
const groupsDataServiceStubWithGroup = Object.assign(groupsDataServiceStub,{
|
||||||
searchGroups(query: string): Observable<RemoteData<PaginatedList<Group>>> {
|
searchGroups(query: string): Observable<RemoteData<PaginatedList<Group>>> {
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [expected]));
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), [expected]));
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
component.formGroup.controls.groupName.setValue('testName');
|
component.formGroup.controls.groupName.setValue('testName');
|
||||||
component.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(groupsDataServiceStubWithGroup));
|
component.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(groupsDataServiceStubWithGroup));
|
||||||
@@ -413,7 +414,7 @@ describe('GroupFormComponent', () => {
|
|||||||
|
|
||||||
component.canEdit$ = observableOf(true);
|
component.canEdit$ = observableOf(true);
|
||||||
component.groupBeingEdited = {
|
component.groupBeingEdited = {
|
||||||
permanent: false
|
permanent: false,
|
||||||
} as Group;
|
} as Group;
|
||||||
|
|
||||||
fixture.detectChanges();
|
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 { UntypedFormGroup } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router, } from '@angular/router';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {
|
import {
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
DynamicFormLayout,
|
DynamicFormLayout,
|
||||||
DynamicInputModel,
|
DynamicInputModel,
|
||||||
DynamicTextAreaModel
|
DynamicTextAreaModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import {
|
import { Operation } from 'fast-json-patch';
|
||||||
combineLatest as observableCombineLatest,
|
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription, } from 'rxjs';
|
||||||
Observable,
|
import { catchError, debounceTime, filter, map, switchMap, take, } from 'rxjs/operators';
|
||||||
of as observableOf,
|
|
||||||
Subscription,
|
import { environment } from '../../../../environments/environment';
|
||||||
} from 'rxjs';
|
|
||||||
import { catchError, map, switchMap, take, filter, debounceTime } from 'rxjs/operators';
|
|
||||||
import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
||||||
import { getCommunityEditRolesRoute } from '../../../community-page/community-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 { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
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 { Collection } from '../../../core/shared/collection.model';
|
||||||
import { Community } from '../../../core/shared/community.model';
|
import { Community } from '../../../core/shared/community.model';
|
||||||
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../core/shared/dspace-object.model';
|
||||||
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import {
|
import {
|
||||||
getRemoteDataPayload,
|
|
||||||
getFirstSucceededRemoteData,
|
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getFirstSucceededRemoteDataPayload
|
getFirstSucceededRemoteData,
|
||||||
|
getFirstSucceededRemoteDataPayload,
|
||||||
|
getRemoteDataPayload,
|
||||||
} from '../../../core/shared/operators';
|
} from '../../../core/shared/operators';
|
||||||
import { AlertType } from '../../../shared/alert/alert-type';
|
import { AlertType } from '../../../shared/alert/alert-type';
|
||||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
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 { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { getGroupEditRoute, getGroupsRoute, } from '../../access-control-routing-paths';
|
||||||
import { Operation } from 'fast-json-patch';
|
|
||||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
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 { FormComponent } from '../../../shared/form/form.component';
|
||||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||||
import { AsyncPipe, NgIf } from '@angular/common';
|
import { AsyncPipe, NgIf } from '@angular/common';
|
||||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||||
import { MembersListComponent } from './members-list/members-list.component';
|
import { MembersListComponent } from './members-list/members-list.component';
|
||||||
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
||||||
import { getGroupEditRoute, getGroupsRoute } from '../../access-control-routing-paths';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-group-form',
|
selector: 'ds-group-form',
|
||||||
@@ -100,13 +96,13 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
formLayout: DynamicFormLayout = {
|
formLayout: DynamicFormLayout = {
|
||||||
groupName: {
|
groupName: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'row'
|
host: 'row',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
groupDescription: {
|
groupDescription: {
|
||||||
grid: {
|
grid: {
|
||||||
host: 'row'
|
host: 'row',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -193,7 +189,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
observableCombineLatest([
|
observableCombineLatest([
|
||||||
this.translateService.get(`${this.messagePrefix}.groupName`),
|
this.translateService.get(`${this.messagePrefix}.groupName`),
|
||||||
this.translateService.get(`${this.messagePrefix}.groupCommunity`),
|
this.translateService.get(`${this.messagePrefix}.groupCommunity`),
|
||||||
this.translateService.get(`${this.messagePrefix}.groupDescription`)
|
this.translateService.get(`${this.messagePrefix}.groupDescription`),
|
||||||
]).subscribe(([groupName, groupCommunity, groupDescription]) => {
|
]).subscribe(([groupName, groupCommunity, groupDescription]) => {
|
||||||
this.groupName = new DynamicInputModel({
|
this.groupName = new DynamicInputModel({
|
||||||
id: 'groupName',
|
id: 'groupName',
|
||||||
@@ -224,7 +220,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
];
|
];
|
||||||
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
|
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.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(this.groupDataService));
|
||||||
this.groupNameValueChangeSubscribe = this.groupName.valueChanges.pipe(debounceTime(300)).subscribe(() => {
|
this.groupNameValueChangeSubscribe = this.groupName.valueChanges.pipe(debounceTime(300)).subscribe(() => {
|
||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
@@ -236,7 +232,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
this.groupDataService.getActiveGroup(),
|
this.groupDataService.getActiveGroup(),
|
||||||
this.canEdit$,
|
this.canEdit$,
|
||||||
this.groupDataService.getActiveGroup()
|
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]) => {
|
]).subscribe(([activeGroup, canEdit, linkedObject]) => {
|
||||||
|
|
||||||
if (activeGroup != null) {
|
if (activeGroup != null) {
|
||||||
@@ -271,7 +267,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -299,9 +295,9 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
metadata: {
|
metadata: {
|
||||||
'dc.description': [
|
'dc.description': [
|
||||||
{
|
{
|
||||||
value: this.groupDescription.value
|
value: this.groupDescription.value,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (group === null) {
|
if (group === null) {
|
||||||
@@ -309,7 +305,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
this.editGroup(group);
|
this.editGroup(group);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +316,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
createNewGroup(values) {
|
createNewGroup(values) {
|
||||||
const groupToCreate = Object.assign(new Group(), values);
|
const groupToCreate = Object.assign(new Group(), values);
|
||||||
this.groupDataService.create(groupToCreate).pipe(
|
this.groupDataService.create(groupToCreate).pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe((rd: RemoteData<Group>) => {
|
).subscribe((rd: RemoteData<Group>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.created.success', { name: groupToCreate.name }));
|
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
|
// Relevant message for group name in use
|
||||||
this.subs.push(this.groupDataService.searchGroups(group.name, {
|
this.subs.push(this.groupDataService.searchGroups(group.name, {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
elementsPerPage: 0
|
elementsPerPage: 0,
|
||||||
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
}).pipe(getFirstSucceededRemoteData(), getRemoteDataPayload())
|
||||||
.subscribe((list: PaginatedList<Group>) => {
|
.subscribe((list: PaginatedList<Group>) => {
|
||||||
if (list.totalElements > 0) {
|
if (list.totalElements > 0) {
|
||||||
@@ -371,7 +367,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
operations = [...operations, {
|
operations = [...operations, {
|
||||||
op: 'add',
|
op: 'add',
|
||||||
path: '/metadata/dc.description',
|
path: '/metadata/dc.description',
|
||||||
value: this.groupDescription.value
|
value: this.groupDescription.value,
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,12 +375,12 @@ export class GroupFormComponent implements OnInit, OnDestroy {
|
|||||||
operations = [...operations, {
|
operations = [...operations, {
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
path: '/name',
|
path: '/name',
|
||||||
value: this.groupName.value
|
value: this.groupName.value,
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.groupDataService.patch(group, operations).pipe(
|
this.groupDataService.patch(group, operations).pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe((rd: RemoteData<Group>) => {
|
).subscribe((rd: RemoteData<Group>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
this.notificationsService.success(this.translateService.get(this.messagePrefix + '.notification.edited.success', { name: this.dsoNameService.getName(rd.payload) }));
|
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);
|
return getCollectionEditRolesRoute(rd.payload.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
</ds-pagination>
|
</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">
|
role="alert">
|
||||||
{{messagePrefix + '.no-members-yet' | translate}}
|
{{messagePrefix + '.no-members-yet' | translate}}
|
||||||
</div>
|
</div>
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
|
|
||||||
</ds-pagination>
|
</ds-pagination>
|
||||||
|
|
||||||
<div *ngIf="(ePeopleSearch | async)?.totalElements == 0 && searchDone"
|
<div *ngIf="(ePeopleSearch | async)?.totalElements === 0 && searchDone"
|
||||||
class="alert alert-info w-100 mb-2"
|
class="alert alert-info w-100 mb-2"
|
||||||
role="alert">
|
role="alert">
|
||||||
{{messagePrefix + '.no-items' | translate}}
|
{{messagePrefix + '.no-items' | translate}}
|
||||||
|
@@ -1,38 +1,41 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf, } from 'rxjs';
|
||||||
|
|
||||||
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { RestResponse } from '../../../../core/cache/response.models';
|
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 { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
||||||
import { Group } from '../../../../core/eperson/models/group.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 { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
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 { 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 { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
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', () => {
|
describe('MembersListComponent', () => {
|
||||||
let component: MembersListComponent;
|
let component: MembersListComponent;
|
||||||
@@ -112,7 +115,7 @@ describe('MembersListComponent', () => {
|
|||||||
// Add eperson to list of non-members
|
// Add eperson to list of non-members
|
||||||
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
this.epersonNonMembers = [...this.epersonNonMembers, epersonToDelete];
|
||||||
return observableOf(new RestResponse(true, 200, 'Success'));
|
return observableOf(new RestResponse(true, 200, 'Success'));
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
builderService = getMockFormBuilderService();
|
builderService = getMockFormBuilderService();
|
||||||
translateService = getMockTranslateService();
|
translateService = getMockTranslateService();
|
||||||
@@ -123,8 +126,8 @@ describe('MembersListComponent', () => {
|
|||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}), MembersListComponent],
|
}), MembersListComponent],
|
||||||
providers: [MembersListComponent,
|
providers: [MembersListComponent,
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
@@ -136,7 +139,7 @@ describe('MembersListComponent', () => {
|
|||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(MembersListComponent, {
|
.overrideComponent(MembersListComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
|
@@ -4,26 +4,29 @@ import { Router, RouterLink } from '@angular/router';
|
|||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
import { map, switchMap, take } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
|
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||||
import {
|
import {
|
||||||
getAllCompletedRemoteData,
|
getAllCompletedRemoteData,
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getRemoteDataPayload
|
getRemoteDataPayload,
|
||||||
} from '../../../../core/shared/operators';
|
} from '../../../../core/shared/operators';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
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 { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
||||||
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
||||||
|
|
||||||
|
// todo: optimize imports
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keys to keep track of specific subscriptions
|
* Keys to keep track of specific subscriptions
|
||||||
*/
|
*/
|
||||||
@@ -96,7 +99,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
|||||||
remove: {
|
remove: {
|
||||||
css: 'btn-outline-danger',
|
css: 'btn-outline-danger',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
icon: 'fas fa-trash-alt fa-fw'
|
icon: 'fas fa-trash-alt fa-fw',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,7 +118,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
|||||||
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'sml',
|
id: 'sml',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* Pagination config used to display the list of EPerson Membes of active group being edited
|
* 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(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'ml',
|
id: 'ml',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -184,8 +187,8 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
|||||||
switchMap((currentPagination) => {
|
switchMap((currentPagination) => {
|
||||||
return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, {
|
return this.ePersonDataService.findListByHref(this.groupBeingEdited._links.epersons.href, {
|
||||||
currentPage: currentPagination.currentPage,
|
currentPage: currentPagination.currentPage,
|
||||||
elementsPerPage: currentPagination.pageSize
|
elementsPerPage: currentPagination.pageSize,
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
getAllCompletedRemoteData(),
|
getAllCompletedRemoteData(),
|
||||||
@@ -274,7 +277,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
return this.ePersonDataService.searchNonMembers(this.currentSearchQuery, this.groupBeingEdited.id, {
|
return this.ePersonDataService.searchNonMembers(this.currentSearchQuery, this.groupBeingEdited.id, {
|
||||||
currentPage: paginationOptions.currentPage,
|
currentPage: paginationOptions.currentPage,
|
||||||
elementsPerPage: paginationOptions.pageSize
|
elementsPerPage: paginationOptions.pageSize,
|
||||||
}, false, true);
|
}, false, true);
|
||||||
}),
|
}),
|
||||||
getAllCompletedRemoteData(),
|
getAllCompletedRemoteData(),
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ds-pagination>
|
</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">
|
role="alert">
|
||||||
{{messagePrefix + '.no-subgroups-yet' | translate}}
|
{{messagePrefix + '.no-subgroups-yet' | translate}}
|
||||||
</div>
|
</div>
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ds-pagination>
|
</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">
|
role="alert">
|
||||||
{{messagePrefix + '.no-items' | translate}}
|
{{messagePrefix + '.no-items' | translate}}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,38 +1,37 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA, DebugElement } from '@angular/core';
|
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
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 { 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 { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { Group } from '../../../../core/eperson/models/group.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 { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.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 { 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 { 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 { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
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', () => {
|
describe('SubgroupsListComponent', () => {
|
||||||
let component: SubgroupsListComponent;
|
let component: SubgroupsListComponent;
|
||||||
@@ -59,7 +58,7 @@ describe('SubgroupsListComponent', () => {
|
|||||||
},
|
},
|
||||||
subgroups: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/subgroups' },
|
subgroups: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/subgroups' },
|
||||||
object: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/object' },
|
object: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/object' },
|
||||||
epersons: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/epersons' }
|
epersons: { href: 'https://rest.api/server/api/eperson/groups/activegroupid/epersons' },
|
||||||
},
|
},
|
||||||
_name: 'activegroupname',
|
_name: 'activegroupname',
|
||||||
id: 'activegroupid',
|
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 { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
import { BehaviorSubject, Observable, Subscription, } from 'rxjs';
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
import { map, switchMap, take, } from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
import {
|
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||||
getAllCompletedRemoteData,
|
import { NoContent } from '../../../../core/shared/NoContent.model';
|
||||||
getFirstCompletedRemoteData
|
import { getAllCompletedRemoteData, getFirstCompletedRemoteData, } from '../../../../core/shared/operators';
|
||||||
} from '../../../../core/shared/operators';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
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 { followLink } from '../../../../shared/utils/follow-link-config.model';
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
@@ -63,6 +62,8 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
subGroups$: BehaviorSubject<RemoteData<PaginatedList<Group>>> = new BehaviorSubject(undefined);
|
subGroups$: BehaviorSubject<RemoteData<PaginatedList<Group>>> = new BehaviorSubject(undefined);
|
||||||
|
|
||||||
|
subGroupsPageInfoState$: Observable<PageInfo>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of active subscriptions
|
* Map of active subscriptions
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +75,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
|||||||
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
configSearch: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'ssgl',
|
id: 'ssgl',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* Pagination config used to display the list of subgroups of currently active group being edited
|
* 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(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'sgl',
|
id: 'sgl',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
// The search form
|
// The search form
|
||||||
@@ -119,6 +120,9 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
|||||||
this.search({ query: '' });
|
this.search({ query: '' });
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
this.subGroupsPageInfoState$ = this.subGroups$.pipe(
|
||||||
|
map(subGroupsRD => subGroupsRD?.payload?.pageInfo),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -134,12 +138,12 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
|||||||
this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
this.paginationService.getCurrentPagination(this.config.id, this.config).pipe(
|
||||||
switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, {
|
switchMap((config) => this.groupDataService.findListByHref(this.groupBeingEdited._links.subgroups.href, {
|
||||||
currentPage: config.currentPage,
|
currentPage: config.currentPage,
|
||||||
elementsPerPage: config.pageSize
|
elementsPerPage: config.pageSize,
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
followLink('object')
|
followLink('object'),
|
||||||
))
|
)),
|
||||||
).subscribe((rd: RemoteData<PaginatedList<Group>>) => {
|
).subscribe((rd: RemoteData<PaginatedList<Group>>) => {
|
||||||
this.subGroups$.next(rd);
|
this.subGroups$.next(rd);
|
||||||
}));
|
}));
|
||||||
@@ -208,7 +212,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
return this.groupDataService.searchNonMemberGroups(this.currentSearchQuery, this.groupBeingEdited.id, {
|
return this.groupDataService.searchNonMemberGroups(this.currentSearchQuery, this.groupBeingEdited.id, {
|
||||||
currentPage: paginationOptions.currentPage,
|
currentPage: paginationOptions.currentPage,
|
||||||
elementsPerPage: paginationOptions.pageSize
|
elementsPerPage: paginationOptions.pageSize,
|
||||||
}, false, true, followLink('object'));
|
}, false, true, followLink('object'));
|
||||||
}),
|
}),
|
||||||
getAllCompletedRemoteData(),
|
getAllCompletedRemoteData(),
|
||||||
|
@@ -1,10 +1,13 @@
|
|||||||
import { AbstractControl, ValidationErrors } from '@angular/forms';
|
import {
|
||||||
|
AbstractControl,
|
||||||
|
ValidationErrors,
|
||||||
|
} from '@angular/forms';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
|
||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
|
import { getFirstSucceededRemoteListPayload } from '../../../../core/shared/operators';
|
||||||
|
|
||||||
export class ValidateGroupExists {
|
export class ValidateGroupExists {
|
||||||
|
|
||||||
@@ -17,7 +20,7 @@ export class ValidateGroupExists {
|
|||||||
return (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => {
|
return (control: AbstractControl): Promise<ValidationErrors | null> | Observable<ValidationErrors | null> => {
|
||||||
return groupDataService.searchGroups(control.value, {
|
return groupDataService.searchGroups(control.value, {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
elementsPerPage: 100
|
elementsPerPage: 100,
|
||||||
})
|
})
|
||||||
.pipe(
|
.pipe(
|
||||||
getFirstSucceededRemoteListPayload(),
|
getFirstSucceededRemoteListPayload(),
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
import { GroupPageGuard } from './group-page.guard';
|
import {
|
||||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
ActivatedRouteSnapshot,
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
Router,
|
||||||
import { ActivatedRouteSnapshot, Router } from '@angular/router';
|
} from '@angular/router';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
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 { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||||
|
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
||||||
|
import { GroupPageGuard } from './group-page.guard';
|
||||||
|
|
||||||
describe('GroupPageGuard', () => {
|
describe('GroupPageGuard', () => {
|
||||||
const groupsEndpointUrl = 'https://test.org/api/eperson/groups';
|
const groupsEndpointUrl = 'https://test.org/api/eperson/groups';
|
||||||
@@ -13,7 +17,7 @@ describe('GroupPageGuard', () => {
|
|||||||
const routeSnapshotWithGroupId = {
|
const routeSnapshotWithGroupId = {
|
||||||
params: {
|
params: {
|
||||||
groupId: groupUuid,
|
groupId: groupUuid,
|
||||||
}
|
},
|
||||||
} as unknown as ActivatedRouteSnapshot;
|
} as unknown as ActivatedRouteSnapshot;
|
||||||
|
|
||||||
let guard: GroupPageGuard;
|
let guard: GroupPageGuard;
|
||||||
@@ -50,10 +54,10 @@ describe('GroupPageGuard', () => {
|
|||||||
|
|
||||||
it('should return true', (done) => {
|
it('should return true', (done) => {
|
||||||
guard.canActivate(
|
guard.canActivate(
|
||||||
routeSnapshotWithGroupId, { url: 'current-url'} as any
|
routeSnapshotWithGroupId, { url: 'current-url' } as any,
|
||||||
).subscribe((result) => {
|
).subscribe((result) => {
|
||||||
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
||||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined
|
FeatureID.CanManageGroup, groupEndpointUrl, undefined,
|
||||||
);
|
);
|
||||||
expect(result).toBeTrue();
|
expect(result).toBeTrue();
|
||||||
done();
|
done();
|
||||||
@@ -68,10 +72,10 @@ describe('GroupPageGuard', () => {
|
|||||||
|
|
||||||
it('should not return true', (done) => {
|
it('should not return true', (done) => {
|
||||||
guard.canActivate(
|
guard.canActivate(
|
||||||
routeSnapshotWithGroupId, { url: 'current-url'} as any
|
routeSnapshotWithGroupId, { url: 'current-url' } as any,
|
||||||
).subscribe((result) => {
|
).subscribe((result) => {
|
||||||
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
expect(authorizationService.isAuthorized).toHaveBeenCalledWith(
|
||||||
FeatureID.CanManageGroup, groupEndpointUrl, undefined
|
FeatureID.CanManageGroup, groupEndpointUrl, undefined,
|
||||||
);
|
);
|
||||||
expect(result).not.toBeTrue();
|
expect(result).not.toBeTrue();
|
||||||
done();
|
done();
|
||||||
|
@@ -1,15 +1,23 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
|
import {
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
ActivatedRouteSnapshot,
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
Router,
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
RouterStateSnapshot,
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
} from '@angular/router';
|
||||||
import { SomeFeatureAuthorizationGuard } from '../../core/data/feature-authorization/feature-authorization-guard/some-feature-authorization.guard';
|
import {
|
||||||
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
} from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
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({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class GroupPageGuard extends SomeFeatureAuthorizationGuard {
|
export class GroupPageGuard extends SomeFeatureAuthorizationGuard {
|
||||||
|
|
||||||
@@ -28,7 +36,7 @@ export class GroupPageGuard extends SomeFeatureAuthorizationGuard {
|
|||||||
|
|
||||||
getObjectUrl(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<string> {
|
getObjectUrl(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<string> {
|
||||||
return this.halEndpointService.getEndpoint(this.groupsEndpoint).pipe(
|
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 */
|
/* eslint-disable max-classes-per-file */
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
|
|
||||||
import { Group } from '../../core/eperson/models/group.model';
|
import { Group } from '../../core/eperson/models/group.model';
|
||||||
import { type } from '../../shared/ngrx/type';
|
import { type } from '../../shared/ngrx/type';
|
||||||
|
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
import { GroupMock } from '../../shared/testing/group-mock';
|
import { GroupMock } from '../../shared/testing/group-mock';
|
||||||
import { GroupRegistryCancelGroupAction, GroupRegistryEditGroupAction } from './group-registry.actions';
|
import {
|
||||||
import { groupRegistryReducer, GroupRegistryState } from './group-registry.reducers';
|
GroupRegistryCancelGroupAction,
|
||||||
|
GroupRegistryEditGroupAction,
|
||||||
|
} from './group-registry.actions';
|
||||||
|
import {
|
||||||
|
groupRegistryReducer,
|
||||||
|
GroupRegistryState,
|
||||||
|
} from './group-registry.reducers';
|
||||||
|
|
||||||
const initialState: GroupRegistryState = {
|
const initialState: GroupRegistryState = {
|
||||||
editGroup: null,
|
editGroup: null,
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { Group } from '../../core/eperson/models/group.model';
|
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.
|
* The metadata registry state.
|
||||||
@@ -27,13 +31,13 @@ export function groupRegistryReducer(state = initialState, action: GroupRegistry
|
|||||||
|
|
||||||
case GroupRegistryActionTypes.EDIT_GROUP: {
|
case GroupRegistryActionTypes.EDIT_GROUP: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
editGroup: (action as GroupRegistryEditGroupAction).group
|
editGroup: (action as GroupRegistryEditGroupAction).group,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case GroupRegistryActionTypes.CANCEL_EDIT_GROUP: {
|
case GroupRegistryActionTypes.CANCEL_EDIT_GROUP: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
editGroup: null
|
editGroup: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<ds-themed-loading *ngIf="loading$ | async"></ds-themed-loading>
|
<ds-themed-loading *ngIf="loading$ | async"></ds-themed-loading>
|
||||||
<ds-pagination
|
<ds-pagination
|
||||||
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && !(loading$ | async)"
|
*ngIf="(pageInfoState$ | async)?.totalElements > 0 && (loading$ | async) !== true"
|
||||||
[paginationOptions]="config"
|
[paginationOptions]="config"
|
||||||
[pageInfoState]="pageInfoState$"
|
[pageInfoState]="pageInfoState$"
|
||||||
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
[collectionSize]="(pageInfoState$ | async)?.totalElements"
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</ds-pagination>
|
</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}}
|
{{messagePrefix + 'no-items' | translate}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -1,43 +1,44 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
||||||
import { BrowserModule, By } from '@angular/platform-browser';
|
import { BrowserModule, By, } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule, } from '@ngx-translate/core';
|
||||||
import { Observable, of, of as observableOf } from 'rxjs';
|
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 { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-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 { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
import { Group } from '../../core/eperson/models/group.model';
|
import { Group } from '../../core/eperson/models/group.model';
|
||||||
|
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||||
import { RouteService } from '../../core/services/route.service';
|
import { RouteService } from '../../core/services/route.service';
|
||||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
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 { NoContent } from '../../core/shared/NoContent.model';
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { DSONameServiceMock, UNDEFINED_NAME } from '../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock, UNDEFINED_NAME, } from '../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock';
|
||||||
|
import { GroupMock, GroupMock2, } from '../../shared/testing/group-mock';
|
||||||
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface';
|
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', () => {
|
describe('GroupsRegistryComponent', () => {
|
||||||
let component: GroupsRegistryComponent;
|
let component: GroupsRegistryComponent;
|
||||||
@@ -83,24 +84,24 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 0,
|
totalElements: 0,
|
||||||
totalPages: 0,
|
totalPages: 0,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), []));
|
}), []));
|
||||||
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/epersons':
|
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/epersons':
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 1,
|
totalElements: 1,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), [EPersonMock]));
|
}), [EPersonMock]));
|
||||||
default:
|
default:
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 0,
|
totalElements: 0,
|
||||||
totalPages: 0,
|
totalPages: 0,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), []));
|
}), []));
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
groupsDataServiceStub = {
|
groupsDataServiceStub = {
|
||||||
allGroups: mockGroups,
|
allGroups: mockGroups,
|
||||||
@@ -111,21 +112,21 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 0,
|
totalElements: 0,
|
||||||
totalPages: 0,
|
totalPages: 0,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), []));
|
}), []));
|
||||||
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/groups':
|
case 'https://dspace.4science.it/dspace-spring-rest/api/eperson/groups/testgroupid/groups':
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 1,
|
totalElements: 1,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), [GroupMock2]));
|
}), [GroupMock2]));
|
||||||
default:
|
default:
|
||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo({
|
||||||
elementsPerPage: 1,
|
elementsPerPage: 1,
|
||||||
totalElements: 0,
|
totalElements: 0,
|
||||||
totalPages: 0,
|
totalPages: 0,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), []));
|
}), []));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -141,7 +142,7 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
elementsPerPage: this.allGroups.length,
|
elementsPerPage: this.allGroups.length,
|
||||||
totalElements: this.allGroups.length,
|
totalElements: this.allGroups.length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), this.allGroups));
|
}), this.allGroups));
|
||||||
}
|
}
|
||||||
const result = this.allGroups.find((group: Group) => {
|
const result = this.allGroups.find((group: Group) => {
|
||||||
@@ -151,7 +152,7 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
elementsPerPage: [result].length,
|
elementsPerPage: [result].length,
|
||||||
totalElements: [result].length,
|
totalElements: [result].length,
|
||||||
totalPages: 1,
|
totalPages: 1,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
}), [result]));
|
}), [result]));
|
||||||
},
|
},
|
||||||
delete(objectId: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
delete(objectId: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
||||||
@@ -161,7 +162,7 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
dsoDataServiceStub = {
|
dsoDataServiceStub = {
|
||||||
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
findByHref(href: string): Observable<RemoteData<DSpaceObject>> {
|
||||||
return createSuccessfulRemoteDataObject$(undefined);
|
return createSuccessfulRemoteDataObject$(undefined);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||||
@@ -176,8 +177,8 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}), GroupsRegistryComponent],
|
}), GroupsRegistryComponent],
|
||||||
providers: [GroupsRegistryComponent,
|
providers: [GroupsRegistryComponent,
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
@@ -195,7 +196,7 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -248,16 +249,16 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
|
|
||||||
it('should not check the canManageGroup permissions', () => {
|
it('should not check the canManageGroup permissions', () => {
|
||||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||||
FeatureID.CanManageGroup, mockGroups[0].self
|
FeatureID.CanManageGroup, mockGroups[0].self,
|
||||||
);
|
);
|
||||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
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(
|
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
||||||
FeatureID.CanManageGroup, mockGroups[1].self
|
FeatureID.CanManageGroup, mockGroups[1].self,
|
||||||
);
|
);
|
||||||
expect(authorizationService.isAuthorized).not.toHaveBeenCalledWith(
|
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 { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||||
import { Router, RouterLink } from '@angular/router';
|
import { Router, RouterLink } from '@angular/router';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
@@ -8,36 +8,37 @@ import {
|
|||||||
EMPTY,
|
EMPTY,
|
||||||
Observable,
|
Observable,
|
||||||
of as observableOf,
|
of as observableOf,
|
||||||
Subscription
|
Subscription,
|
||||||
} from 'rxjs';
|
} 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 { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
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 { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
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 { 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 { RouteService } from '../../core/services/route.service';
|
||||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||||
|
import { NoContent } from '../../core/shared/NoContent.model';
|
||||||
import {
|
import {
|
||||||
getAllSucceededRemoteData,
|
getAllSucceededRemoteData,
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getFirstSucceededRemoteData,
|
getFirstSucceededRemoteData,
|
||||||
getRemoteDataPayload
|
getRemoteDataPayload,
|
||||||
} from '../../core/shared/operators';
|
} from '../../core/shared/operators';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { hasValue } from '../../shared/empty.util';
|
import { hasValue } from '../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
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 { 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 { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase } from '@angular/common';
|
import { AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase } from '@angular/common';
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
@@ -75,7 +76,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
|||||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'gl',
|
id: 'gl',
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
currentPage: 1
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,7 +174,7 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
|||||||
this.canManageGroup$(isSiteAdmin, group),
|
this.canManageGroup$(isSiteAdmin, group),
|
||||||
this.hasLinkedDSO(group),
|
this.hasLinkedDSO(group),
|
||||||
this.getSubgroups(group),
|
this.getSubgroups(group),
|
||||||
this.getMembers(group)
|
this.getMembers(group),
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([canDelete, canManageGroup, hasLinkedDSO, subgroups, members]:
|
map(([canDelete, canManageGroup, hasLinkedDSO, subgroups, members]:
|
||||||
[boolean, boolean, boolean, RemoteData<PaginatedList<Group>>, RemoteData<PaginatedList<EPerson>>]) => {
|
[boolean, boolean, boolean, RemoteData<PaginatedList<Group>>, RemoteData<PaginatedList<EPerson>>]) => {
|
||||||
@@ -184,8 +185,8 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
|||||||
groupDtoModel.subgroups = subgroups.payload;
|
groupDtoModel.subgroups = subgroups.payload;
|
||||||
groupDtoModel.epersons = members.payload;
|
groupDtoModel.epersons = members.payload;
|
||||||
return groupDtoModel;
|
return groupDtoModel;
|
||||||
}
|
},
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
@@ -193,9 +194,9 @@ export class GroupsRegistryComponent implements OnInit, OnDestroy {
|
|||||||
})]).pipe(defaultIfEmpty([]), map((dtos: GroupDtoModel[]) => {
|
})]).pipe(defaultIfEmpty([]), map((dtos: GroupDtoModel[]) => {
|
||||||
return buildPaginatedList(groups.pageInfo, dtos);
|
return buildPaginatedList(groups.pageInfo, dtos);
|
||||||
}));
|
}));
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
})
|
}),
|
||||||
).subscribe((value: PaginatedList<GroupDtoModel>) => {
|
).subscribe((value: PaginatedList<GroupDtoModel>) => {
|
||||||
this.groupsDto$.next(value);
|
this.groupsDto$.next(value);
|
||||||
this.pageInfoState$.next(value.pageInfo);
|
this.pageInfoState$.next(value.pageInfo);
|
||||||
|
@@ -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 { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
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', () => {
|
describe('AdminCurationTasksComponent', () => {
|
||||||
let comp: 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 { Location } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
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 { 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 { 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', () => {
|
describe('BatchImportPageComponent', () => {
|
||||||
let component: BatchImportPageComponent;
|
let component: BatchImportPageComponent;
|
||||||
@@ -31,14 +40,14 @@ describe('BatchImportPageComponent', () => {
|
|||||||
notificationService = new NotificationsServiceStub();
|
notificationService = new NotificationsServiceStub();
|
||||||
scriptService = jasmine.createSpyObj('scriptService',
|
scriptService = jasmine.createSpyObj('scriptService',
|
||||||
{
|
{
|
||||||
invoke: createSuccessfulRemoteDataObject$({ processId: '46' })
|
invoke: createSuccessfulRemoteDataObject$({ processId: '46' }),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
router = jasmine.createSpyObj('router', {
|
router = jasmine.createSpyObj('router', {
|
||||||
navigateByUrl: jasmine.createSpy('navigateByUrl')
|
navigateByUrl: jasmine.createSpy('navigateByUrl'),
|
||||||
});
|
});
|
||||||
locationStub = jasmine.createSpyObj('location', {
|
locationStub = jasmine.createSpyObj('location', {
|
||||||
back: jasmine.createSpy('back')
|
back: jasmine.createSpy('back'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +66,7 @@ describe('BatchImportPageComponent', () => {
|
|||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: Location, useValue: locationStub },
|
{ provide: Location, useValue: locationStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -108,7 +117,7 @@ describe('BatchImportPageComponent', () => {
|
|||||||
it('metadata-import script is invoked with --zip fileName and the mockFile', () => {
|
it('metadata-import script is invoked with --zip fileName and the mockFile', () => {
|
||||||
const parameterValues: ProcessParameter[] = [
|
const parameterValues: ProcessParameter[] = [
|
||||||
Object.assign(new ProcessParameter(), { name: '--add' }),
|
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]);
|
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', () => {
|
it('metadata-import script is invoked with --url and the file url', () => {
|
||||||
const parameterValues: ProcessParameter[] = [
|
const parameterValues: ProcessParameter[] = [
|
||||||
Object.assign(new ProcessParameter(), { name: '--add' }),
|
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]);
|
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 { Component } from '@angular/core';
|
||||||
import { Location, NgIf } from '@angular/common';
|
import { Location, NgIf } from '@angular/common';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
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 { BATCH_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
import { Router } from '@angular/router';
|
||||||
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 { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
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 { FormsModule } from '@angular/forms';
|
||||||
import { UiSwitchModule } from 'ngx-ui-switch';
|
import { UiSwitchModule } from 'ngx-ui-switch';
|
||||||
import {
|
import {
|
||||||
@@ -104,7 +115,7 @@ export class BatchImportPageComponent {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const parameterValues: ProcessParameter[] = [
|
const parameterValues: ProcessParameter[] = [
|
||||||
Object.assign(new ProcessParameter(), { name: '--add' })
|
Object.assign(new ProcessParameter(), { name: '--add' }),
|
||||||
];
|
];
|
||||||
if (this.isUpload) {
|
if (this.isUpload) {
|
||||||
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name }));
|
parameterValues.push(Object.assign(new ProcessParameter(), { name: '--zip', value: this.fileObject.name }));
|
||||||
|
@@ -1,19 +1,31 @@
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
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 { FormsModule } from '@angular/forms';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
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 { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
|
import {
|
||||||
|
createFailedRemoteDataObject$,
|
||||||
|
createSuccessfulRemoteDataObject$,
|
||||||
|
} from '../../shared/remote-data.utils';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
import { FileValueAccessorDirective } from '../../shared/utils/file-value-accessor.directive';
|
||||||
import { FileValidator } from '../../shared/utils/require-file.validator';
|
import { FileValidator } from '../../shared/utils/require-file.validator';
|
||||||
import { MetadataImportPageComponent } from './metadata-import-page.component';
|
import { MetadataImportPageComponent } from './metadata-import-page.component';
|
||||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
|
||||||
|
|
||||||
describe('MetadataImportPageComponent', () => {
|
describe('MetadataImportPageComponent', () => {
|
||||||
let comp: MetadataImportPageComponent;
|
let comp: MetadataImportPageComponent;
|
||||||
@@ -28,14 +40,14 @@ describe('MetadataImportPageComponent', () => {
|
|||||||
notificationService = new NotificationsServiceStub();
|
notificationService = new NotificationsServiceStub();
|
||||||
scriptService = jasmine.createSpyObj('scriptService',
|
scriptService = jasmine.createSpyObj('scriptService',
|
||||||
{
|
{
|
||||||
invoke: createSuccessfulRemoteDataObject$({ processId: '45' })
|
invoke: createSuccessfulRemoteDataObject$({ processId: '45' }),
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
router = jasmine.createSpyObj('router', {
|
router = jasmine.createSpyObj('router', {
|
||||||
navigateByUrl: jasmine.createSpy('navigateByUrl')
|
navigateByUrl: jasmine.createSpy('navigateByUrl'),
|
||||||
});
|
});
|
||||||
locationStub = jasmine.createSpyObj('location', {
|
locationStub = jasmine.createSpyObj('location', {
|
||||||
back: jasmine.createSpy('back')
|
back: jasmine.createSpy('back'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +66,7 @@ describe('MetadataImportPageComponent', () => {
|
|||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: Location, useValue: locationStub },
|
{ provide: Location, useValue: locationStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -2,18 +2,22 @@ import { Location } from '@angular/common';
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { METADATA_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
|
||||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
import {
|
||||||
import { isNotEmpty } from '../../shared/empty.util';
|
METADATA_IMPORT_SCRIPT_NAME,
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
ScriptDataService,
|
||||||
|
} from '../../core/data/processes/script-data.service';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { Process } from '../../process-page/processes/process.model';
|
|
||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||||
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
FileDropzoneNoUploaderComponent
|
FileDropzoneNoUploaderComponent
|
||||||
} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
} 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({
|
@Component({
|
||||||
selector: 'ds-metadata-import-page',
|
selector: 'ds-metadata-import-page',
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes ,
|
||||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
} from '@angular/router';
|
||||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
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 { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||||
|
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||||
|
|
||||||
const moduleRoutes: Routes = [
|
const moduleRoutes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -17,13 +17,13 @@ const moduleRoutes: Routes = [
|
|||||||
path: 'new',
|
path: 'new',
|
||||||
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
||||||
component: LdnServiceFormComponent,
|
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',
|
path: 'edit/:serviceId',
|
||||||
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
resolve: { breadcrumb: NavigationBreadcrumbResolver },
|
||||||
component: LdnServiceFormComponent,
|
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)
|
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||||
.map((relatedRoute) => {
|
.map((relatedRoute) => {
|
||||||
return {path: relatedRoute.path, data: relatedRoute.data};
|
return {path: relatedRoute.path, data: relatedRoute.data};
|
||||||
})
|
}),
|
||||||
}};
|
}};
|
||||||
});
|
});
|
||||||
|
@@ -1,15 +1,14 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule
|
FormsModule,
|
||||||
],
|
],
|
||||||
providers: [LdnItemfiltersService]
|
providers: [LdnItemfiltersService],
|
||||||
})
|
})
|
||||||
export class AdminLdnServicesModule {
|
export class AdminLdnServicesModule {
|
||||||
}
|
}
|
||||||
|
@@ -102,9 +102,14 @@
|
|||||||
id="ldnUrl"
|
id="ldnUrl"
|
||||||
name="ldnUrl"
|
name="ldnUrl"
|
||||||
type="text">
|
type="text">
|
||||||
<div *ngIf="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched" class="error-text">
|
<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 }}
|
{{ 'ldn-new-service.form.error.ldnurl' | translate }}
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="formModel.get('ldnUrl').errors['ldnUrlAlreadyAssociated']" class="error-text">
|
||||||
|
{{ 'ldn-new-service.form.error.ldnurl.ldnUrlAlreadyAssociated' | translate }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,23 +1,49 @@
|
|||||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
import {
|
||||||
|
ChangeDetectorRef,
|
||||||
import {NgbDropdownModule, NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
EventEmitter,
|
||||||
import {LdnServiceFormComponent} from './ldn-service-form.component';
|
} from '@angular/core';
|
||||||
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
import {
|
||||||
import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
ComponentFixture,
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
fakeAsync,
|
||||||
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
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 { 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 { 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 { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||||
import {RouterStub} from '../../../shared/testing/router.stub';
|
import { LdnServiceFormComponent } from './ldn-service-form.component';
|
||||||
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 { By } from '@angular/platform-browser';
|
|
||||||
|
|
||||||
describe('LdnServiceFormEditComponent', () => {
|
describe('LdnServiceFormEditComponent', () => {
|
||||||
let component: LdnServiceFormComponent;
|
let component: LdnServiceFormComponent;
|
||||||
@@ -52,9 +78,9 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
'pattern': '',
|
'pattern': '',
|
||||||
'patternLabel': 'Select a pattern',
|
'patternLabel': 'Select a pattern',
|
||||||
'constraint': '',
|
'constraint': '',
|
||||||
'automatic': false
|
'automatic': false,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +89,7 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
instant: () => 'translated-text',
|
instant: () => 'translated-text',
|
||||||
onLangChange: new EventEmitter(),
|
onLangChange: new EventEmitter(),
|
||||||
onTranslationChange: new EventEmitter(),
|
onTranslationChange: new EventEmitter(),
|
||||||
onDefaultLangChange: new EventEmitter()
|
onDefaultLangChange: new EventEmitter(),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@@ -77,11 +103,11 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
findAll: () => of(['item1', 'item2']),
|
findAll: () => of(['item1', 'item2']),
|
||||||
};
|
};
|
||||||
cdRefStub = Object.assign({
|
cdRefStub = Object.assign({
|
||||||
detectChanges: () => fixture.detectChanges()
|
detectChanges: () => fixture.detectChanges(),
|
||||||
});
|
});
|
||||||
modalService = {
|
modalService = {
|
||||||
open: () => {/*comment*/
|
open: () => {/*comment*/
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -102,7 +128,7 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
FormBuilder,
|
FormBuilder,
|
||||||
RouteService,
|
RouteService,
|
||||||
provideMockStore({}),
|
provideMockStore({}),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
@@ -195,13 +221,13 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
it('should check patterns', () => {
|
it('should check patterns', () => {
|
||||||
const arrValid = new FormArray([
|
const arrValid = new FormArray([
|
||||||
new FormGroup({
|
new FormGroup({
|
||||||
pattern: new FormControl('pattern')
|
pattern: new FormControl('pattern'),
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const arrInvalid = new FormArray([
|
const arrInvalid = new FormArray([
|
||||||
new FormGroup({
|
new FormGroup({
|
||||||
pattern: new FormControl('')
|
pattern: new FormControl(''),
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@@ -1,35 +1,28 @@
|
|||||||
import {
|
import { animate, state, style, transition, trigger, } from '@angular/animations';
|
||||||
ChangeDetectorRef,
|
import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, } from '@angular/core';
|
||||||
Component,
|
|
||||||
OnDestroy,
|
|
||||||
OnInit,
|
|
||||||
TemplateRef,
|
|
||||||
ViewChild
|
|
||||||
} from '@angular/core';
|
|
||||||
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||||
import {animate, state, style, transition, trigger} from '@angular/animations';
|
|
||||||
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
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 { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
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 { 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 { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
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 { NotifyServicePattern } from '../ldn-services-model/ldn-service-patterns.model';
|
||||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
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
|
* Component for editing LDN service through a form that allows to create or edit the properties of a service
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +58,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
public areControlsInitialized: boolean;
|
public areControlsInitialized: boolean;
|
||||||
public itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
public itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
||||||
public config: FindListOptions = Object.assign(new FindListOptions(), {
|
public config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||||
elementsPerPage: 20
|
elementsPerPage: 20,
|
||||||
});
|
});
|
||||||
public markedForDeletionInboundPattern: number[] = [];
|
public markedForDeletionInboundPattern: number[] = [];
|
||||||
public selectedInboundPatterns: string[];
|
public selectedInboundPatterns: string[];
|
||||||
@@ -88,7 +81,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
protected modalService: NgbModal,
|
protected modalService: NgbModal,
|
||||||
private notificationService: NotificationsService,
|
private notificationService: NotificationsService,
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
protected paginationService: PaginationService
|
protected paginationService: PaginationService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.formModel = this.formBuilder.group({
|
this.formModel = this.formBuilder.group({
|
||||||
@@ -108,7 +101,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.routeSubscription = this.route.params.pipe(
|
this.routeSubscription = this.route.params.pipe(
|
||||||
combineLatestWith(this.route.url)
|
combineLatestWith(this.route.url),
|
||||||
).subscribe(([params, segment]) => {
|
).subscribe(([params, segment]) => {
|
||||||
this.serviceId = params.serviceId;
|
this.serviceId = params.serviceId;
|
||||||
this.isNewService = segment[0].path === 'new';
|
this.isNewService = segment[0].path === 'new';
|
||||||
@@ -169,7 +162,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
const ldnServiceData = this.ldnServicesService.create(values);
|
const ldnServiceData = this.ldnServicesService.create(values);
|
||||||
|
|
||||||
ldnServiceData.pipe(
|
ldnServiceData.pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe((rd: RemoteData<LdnService>) => {
|
).subscribe((rd: RemoteData<LdnService>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
this.notificationService.success(this.translateService.get('ldn-service-notification.created.success.title'),
|
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.closeModal();
|
||||||
this.sendBack();
|
this.sendBack();
|
||||||
} else {
|
} else {
|
||||||
|
if (!this.formModel.errors) {
|
||||||
|
this.setLdnUrlError();
|
||||||
|
}
|
||||||
this.notificationService.error(this.translateService.get('ldn-service-notification.created.failure.title'),
|
this.notificationService.error(this.translateService.get('ldn-service-notification.created.failure.title'),
|
||||||
this.translateService.get('ldn-service-notification.created.failure.body'));
|
this.translateService.get('ldn-service-notification.created.failure.body'));
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
@@ -206,7 +202,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
fetchServiceData(serviceId: string): void {
|
fetchServiceData(serviceId: string): void {
|
||||||
this.ldnServicesService.findById(serviceId).pipe(
|
this.ldnServicesService.findById(serviceId).pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe(
|
).subscribe(
|
||||||
(data: RemoteData<LdnService>) => {
|
(data: RemoteData<LdnService>) => {
|
||||||
if (data.hasSucceeded) {
|
if (data.hasSucceeded) {
|
||||||
@@ -221,18 +217,18 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
type: this.ldnService.type,
|
type: this.ldnService.type,
|
||||||
enabled: this.ldnService.enabled,
|
enabled: this.ldnService.enabled,
|
||||||
lowerIp: this.ldnService.lowerIp,
|
lowerIp: this.ldnService.lowerIp,
|
||||||
upperIp: this.ldnService.upperIp
|
upperIp: this.ldnService.upperIp,
|
||||||
});
|
});
|
||||||
this.filterPatternObjectsAndAssignLabel('notifyServiceInboundPatterns');
|
this.filterPatternObjectsAndAssignLabel('notifyServiceInboundPatterns');
|
||||||
let notifyServiceInboundPatternsFormArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
const notifyServiceInboundPatternsFormArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||||
notifyServiceInboundPatternsFormArray.controls.forEach(
|
notifyServiceInboundPatternsFormArray.controls.forEach(
|
||||||
control => {
|
control => {
|
||||||
const controlFormGroup = control as FormGroup;
|
const controlFormGroup = control as FormGroup;
|
||||||
const controlConstraint = controlFormGroup.get('constraint').value;
|
const controlConstraint = controlFormGroup.get('constraint').value;
|
||||||
controlFormGroup.patchValue({
|
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;
|
const PatternsArray = this.formModel.get(formArrayName) as FormArray;
|
||||||
PatternsArray.clear();
|
PatternsArray.clear();
|
||||||
|
|
||||||
let servicesToUse = this.ldnService.notifyServiceInboundPatterns;
|
const servicesToUse = this.ldnService.notifyServiceInboundPatterns;
|
||||||
|
|
||||||
servicesToUse.forEach((patternObj: NotifyServicePattern) => {
|
servicesToUse.forEach((patternObj: NotifyServicePattern) => {
|
||||||
let patternFormGroup;
|
const patternFormGroup = this.initializeInboundPatternFormGroup();
|
||||||
patternFormGroup = this.initializeInboundPatternFormGroup();
|
|
||||||
const newPatternObjWithLabel = Object.assign(new NotifyServicePattern(), {
|
const newPatternObjWithLabel = Object.assign(new NotifyServicePattern(), {
|
||||||
...patternObj,
|
...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);
|
patternFormGroup.patchValue(newPatternObjWithLabel);
|
||||||
|
|
||||||
@@ -282,7 +277,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
this.deletedInboundPatterns.forEach(index => {
|
this.deletedInboundPatterns.forEach(index => {
|
||||||
const removeOperation: Operation = {
|
const removeOperation: Operation = {
|
||||||
op: 'remove',
|
op: 'remove',
|
||||||
path: `notifyServiceInboundPatterns[${index}]`
|
path: `notifyServiceInboundPatterns[${index}]`,
|
||||||
};
|
};
|
||||||
patchOperations.push(removeOperation);
|
patchOperations.push(removeOperation);
|
||||||
});
|
});
|
||||||
@@ -325,7 +320,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray);
|
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray);
|
||||||
filterArray.controls[index].patchValue({
|
filterArray.controls[index].patchValue({
|
||||||
constraint: filterValue,
|
constraint: filterValue,
|
||||||
constraintFormatted: this.translateService.instant((filterValue !== '' ? filterValue : 'ldn.no-filter') + '.label')
|
constraintFormatted: this.translateService.instant((filterValue !== '' ? filterValue : 'ldn.no-filter') + '.label'),
|
||||||
});
|
});
|
||||||
filterArray.markAllAsTouched();
|
filterArray.markAllAsTouched();
|
||||||
}
|
}
|
||||||
@@ -355,12 +350,12 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe(
|
this.ldnServicesService.patch(this.ldnService, [patchOperation]).pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe(
|
).subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.formModel.get('enabled').setValue(newStatus);
|
this.formModel.get('enabled').setValue(newStatus);
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.detectChanges();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,7 +401,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.ldnServicesService.patch(this.ldnService, patchOperations).pipe(
|
this.ldnServicesService.patch(this.ldnService, patchOperations).pipe(
|
||||||
getFirstCompletedRemoteData()
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe(
|
).subscribe(
|
||||||
(rd: RemoteData<LdnService>) => {
|
(rd: RemoteData<LdnService>) => {
|
||||||
if (rd.hasSucceeded) {
|
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.notificationService.success(this.translateService.get('admin.registries.services-formats.modify.success.head'),
|
||||||
this.translateService.get('admin.registries.services-formats.modify.success.content'));
|
this.translateService.get('admin.registries.services-formats.modify.success.content'));
|
||||||
} else {
|
} else {
|
||||||
|
if (!this.formModel.errors) {
|
||||||
|
this.setLdnUrlError();
|
||||||
|
}
|
||||||
this.notificationService.error(this.translateService.get('admin.registries.services-formats.modify.failure.head'),
|
this.notificationService.error(this.translateService.get('admin.registries.services-formats.modify.failure.head'),
|
||||||
this.translateService.get('admin.registries.services-formats.modify.failure.content'));
|
this.translateService.get('admin.registries.services-formats.modify.failure.content'));
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
@@ -541,7 +539,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
constraint: '',
|
constraint: '',
|
||||||
constraintFormatted: '',
|
constraintFormatted: '',
|
||||||
automatic: false,
|
automatic: false,
|
||||||
isNew: true
|
isNew: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.isNewService) {
|
if (this.isNewService) {
|
||||||
@@ -564,4 +562,14 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
|||||||
automatic: '',
|
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 {
|
||||||
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
Observable,
|
||||||
import {RemoteData} from '../../../core/data/remote-data';
|
of,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import {Observable, of} from 'rxjs';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
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 = {
|
export const mockLdnService: LdnService = {
|
||||||
uuid: '1',
|
uuid: '1',
|
||||||
@@ -31,7 +35,7 @@ export const mockLdnService: LdnService = {
|
|||||||
type: LDN_SERVICE,
|
type: LDN_SERVICE,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get self(): string {
|
get self(): string {
|
||||||
@@ -68,7 +72,7 @@ export const mockLdnServices: LdnService[] = [{
|
|||||||
type: LDN_SERVICE,
|
type: LDN_SERVICE,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get self(): string {
|
get self(): string {
|
||||||
@@ -100,12 +104,12 @@ export const mockLdnServices: LdnService[] = [{
|
|||||||
type: LDN_SERVICE,
|
type: LDN_SERVICE,
|
||||||
_links: {
|
_links: {
|
||||||
self: {
|
self: {
|
||||||
href: 'http://localhost/api/ldn/ldnservices/1'
|
href: 'http://localhost/api/ldn/ldnservices/1',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get self(): string {
|
get self(): string {
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
export const mockLdnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>> = of((mockLdnServices as unknown) as RemoteData<PaginatedList<LdnService>>);
|
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 { 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 { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.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 { 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 { FindAllData } from '../../../core/data/base/find-all-data';
|
||||||
import { testFindAllDataImplementation } from '../../../core/data/base/find-all-data.spec';
|
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', () => {
|
describe('LdnItemfiltersService test', () => {
|
||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
||||||
@@ -60,12 +64,12 @@ describe('LdnItemfiltersService test', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
halService = jasmine.createSpyObj('halService', {
|
halService = jasmine.createSpyObj('halService', {
|
||||||
getEndpoint: of(endpointURL)
|
getEndpoint: of(endpointURL),
|
||||||
});
|
});
|
||||||
|
|
||||||
rdbService = jasmine.createSpyObj('rdbService', {
|
rdbService = jasmine.createSpyObj('rdbService', {
|
||||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
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 { Injectable } from '@angular/core';
|
||||||
import {dataService} from '../../../core/data/base/data-service.decorator';
|
import { Observable } from 'rxjs';
|
||||||
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 { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.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 { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.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 { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import {Observable} from 'rxjs';
|
import { LDN_SERVICE_CONSTRAINT_FILTERS } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import {RemoteData} from '../../../core/data/remote-data';
|
|
||||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
||||||
|
@@ -1,32 +1,35 @@
|
|||||||
import { TestScheduler } from 'rxjs/testing';
|
import {
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
cold,
|
||||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
getTestScheduler,
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
} from 'jasmine-marbles';
|
||||||
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 as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { FindAllData } from '../../../core/data/base/find-all-data';
|
|
||||||
import { testFindAllDataImplementation } from '../../../core/data/base/find-all-data.spec';
|
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { LdnServicesService } from './ldn-services-data.service';
|
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
||||||
import { testDeleteDataImplementation } from '../../../core/data/base/delete-data.spec';
|
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||||
import { DeleteData } from '../../../core/data/base/delete-data';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
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 { CreateData } from '../../../core/data/base/create-data';
|
import { CreateData } from '../../../core/data/base/create-data';
|
||||||
import { testCreateDataImplementation } from '../../../core/data/base/create-data.spec';
|
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 { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { mockLdnService } from '../ldn-service-serviceMock/ldnServicesRD$-mock';
|
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 { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
|
import { mockLdnService } from '../ldn-service-serviceMock/ldnServicesRD$-mock';
|
||||||
|
import { LdnServicesService } from './ldn-services-data.service';
|
||||||
|
|
||||||
describe('LdnServicesService test', () => {
|
describe('LdnServicesService test', () => {
|
||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
||||||
@@ -73,12 +76,13 @@ describe('LdnServicesService test', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
halService = jasmine.createSpyObj('halService', {
|
halService = jasmine.createSpyObj('halService', {
|
||||||
getEndpoint: observableOf(endpointURL)
|
getEndpoint: observableOf(endpointURL),
|
||||||
});
|
});
|
||||||
|
|
||||||
rdbService = jasmine.createSpyObj('rdbService', {
|
rdbService = jasmine.createSpyObj('rdbService', {
|
||||||
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
buildSingle: createSuccessfulRemoteDataObject$({}, 500),
|
||||||
buildList: cold('a', { a: remoteDataMocks.Success })
|
buildFromRequestUUID: createSuccessfulRemoteDataObject$({}, 500),
|
||||||
|
buildList: cold('a', { a: remoteDataMocks.Success }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -111,6 +115,20 @@ describe('LdnServicesService test', () => {
|
|||||||
done();
|
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 { 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 {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 { Operation } from 'fast-json-patch';
|
||||||
import {RestRequestMethod} from '../../../core/data/rest-request-method';
|
import { Observable } from 'rxjs';
|
||||||
import {CreateData, CreateDataImpl} from '../../../core/data/base/create-data';
|
import {
|
||||||
import {LdnServiceConstrain} from '../ldn-services-model/ldn-service.constrain.model';
|
map,
|
||||||
import {SearchDataImpl} from '../../../core/data/base/search-data';
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
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.
|
* Injectable service responsible for fetching/sending data from/to the REST API on the ldnservices endpoint.
|
||||||
@@ -200,7 +213,7 @@ export class LdnServicesService extends IdentifiableDataService<LdnService> impl
|
|||||||
map((endpoint: string) => {
|
map((endpoint: string) => {
|
||||||
const body = this.getInvocationFormData(parameters, files);
|
const body = this.getInvocationFormData(parameters, files);
|
||||||
return new MultipartPostRequest(requestId, endpoint, body);
|
return new MultipartPostRequest(requestId, endpoint, body);
|
||||||
})
|
}),
|
||||||
).subscribe((request: RestRequest) => this.requestService.send(request));
|
).subscribe((request: RestRequest) => this.requestService.send(request));
|
||||||
|
|
||||||
return this.rdbService.buildFromRequestUUID<LdnService>(requestId);
|
return this.rdbService.buildFromRequestUUID<LdnService>(requestId);
|
||||||
|
@@ -1,19 +1,32 @@
|
|||||||
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
|
import {
|
||||||
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
ChangeDetectorRef,
|
||||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
EventEmitter,
|
||||||
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service.stub';
|
NO_ERRORS_SCHEMA,
|
||||||
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
import {
|
||||||
import {PaginationService} from '../../../core/pagination/pagination.service';
|
TranslateModule,
|
||||||
import {PaginationServiceStub} from '../../../shared/testing/pagination-service.stub';
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import {LdnServicesOverviewComponent} from './ldn-services-directory.component';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
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 { 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', () => {
|
describe('LdnServicesOverviewComponent', () => {
|
||||||
let component: LdnServicesOverviewComponent;
|
let component: LdnServicesOverviewComponent;
|
||||||
@@ -21,37 +34,40 @@ describe('LdnServicesOverviewComponent', () => {
|
|||||||
let ldnServicesService;
|
let ldnServicesService;
|
||||||
let paginationService;
|
let paginationService;
|
||||||
let modalService: NgbModal;
|
let modalService: NgbModal;
|
||||||
let notificationsService: NotificationsService;
|
|
||||||
let translateService: TranslateService;
|
|
||||||
|
|
||||||
const translateServiceStub = {
|
const translateServiceStub = {
|
||||||
get: () => of('translated-text'),
|
get: () => of('translated-text'),
|
||||||
onLangChange: new EventEmitter(),
|
onLangChange: new EventEmitter(),
|
||||||
onTranslationChange: new EventEmitter(),
|
onTranslationChange: new EventEmitter(),
|
||||||
onDefaultLangChange: new EventEmitter()
|
onDefaultLangChange: new EventEmitter(),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
ldnServicesService = jasmine.createSpyObj('LdnServicesService', ['findAll', 'delete', 'patch']);
|
ldnServicesService = jasmine.createSpyObj('ldnServicesService', {
|
||||||
|
'findAll': createSuccessfulRemoteDataObject$({}),
|
||||||
|
'delete': createSuccessfulRemoteDataObject$({}),
|
||||||
|
'patch': createSuccessfulRemoteDataObject$({}),
|
||||||
|
});
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: LdnServicesService,
|
provide: LdnServicesService,
|
||||||
useValue: ldnServicesService
|
useValue: ldnServicesService,
|
||||||
},
|
},
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{
|
{
|
||||||
provide: NgbModal, useValue: {
|
provide: NgbModal, useValue: {
|
||||||
open: () => {
|
open: () => {
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ provide: ChangeDetectorRef, useValue: {} },
|
{ provide: ChangeDetectorRef, useValue: {} },
|
||||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
{ provide: TranslateService, useValue: translateServiceStub },
|
{ provide: TranslateService, useValue: translateServiceStub },
|
||||||
]
|
],
|
||||||
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -61,8 +77,6 @@ describe('LdnServicesOverviewComponent', () => {
|
|||||||
ldnServicesService = TestBed.inject(LdnServicesService);
|
ldnServicesService = TestBed.inject(LdnServicesService);
|
||||||
paginationService = TestBed.inject(PaginationService);
|
paginationService = TestBed.inject(PaginationService);
|
||||||
modalService = TestBed.inject(NgbModal);
|
modalService = TestBed.inject(NgbModal);
|
||||||
notificationsService = TestBed.inject(NotificationsService);
|
|
||||||
translateService = TestBed.inject(TranslateService);
|
|
||||||
component.modalRef = jasmine.createSpyObj({ close: null });
|
component.modalRef = jasmine.createSpyObj({ close: null });
|
||||||
component.isProcessingSub = jasmine.createSpyObj({ unsubscribe: null });
|
component.isProcessingSub = jasmine.createSpyObj({ unsubscribe: null });
|
||||||
component.ldnServicesRD$ = of({} as RemoteData<PaginatedList<LdnService>>);
|
component.ldnServicesRD$ = of({} as RemoteData<PaginatedList<LdnService>>);
|
||||||
@@ -140,4 +154,22 @@ describe('LdnServicesOverviewComponent', () => {
|
|||||||
expect(deleteSpy).toHaveBeenCalledWith(serviceId);
|
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,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
ViewChild
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {Observable, Subscription} from 'rxjs';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {RemoteData} from '../../../core/data/remote-data';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
import { Operation } from 'fast-json-patch';
|
||||||
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
import { Observable, Subscription, } from 'rxjs';
|
||||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
import { map, switchMap, } from 'rxjs/operators';
|
||||||
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 { 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 { PaginationService } from 'src/app/core/pagination/pagination.service';
|
||||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import {hasValue} from '../../../shared/empty.util';
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
import {Operation} from 'fast-json-patch';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
||||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
||||||
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||||
import { RouterLink } from '@angular/router';
|
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.
|
* The `LdnServicesOverviewComponent` is a component that provides an overview of LDN (Linked Data Notifications) services.
|
||||||
@@ -58,11 +59,11 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
|||||||
@ViewChild('deleteModal', { static: true }) deleteModal: TemplateRef<any>;
|
@ViewChild('deleteModal', { static: true }) deleteModal: TemplateRef<any>;
|
||||||
ldnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>>;
|
ldnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>>;
|
||||||
config: FindListOptions = Object.assign(new FindListOptions(), {
|
config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||||
elementsPerPage: 10
|
elementsPerPage: 10,
|
||||||
});
|
});
|
||||||
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'po',
|
id: 'po',
|
||||||
pageSize: 10
|
pageSize: 10,
|
||||||
});
|
});
|
||||||
isProcessingSub: Subscription;
|
isProcessingSub: Subscription;
|
||||||
modalRef: any;
|
modalRef: any;
|
||||||
@@ -88,8 +89,8 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
|||||||
setLdnServices() {
|
setLdnServices() {
|
||||||
this.ldnServicesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
|
this.ldnServicesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
|
||||||
switchMap((config) => this.ldnServicesService.findAll(config, false, false).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);
|
remoteData.payload.page = remoteData.payload.page.filter(service => service.id.toString() !== serviceId);
|
||||||
}
|
}
|
||||||
return remoteData;
|
return remoteData;
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
this.cdRef.detectChanges();
|
this.cdRef.detectChanges();
|
||||||
this.closeModal();
|
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.notificationService.error(this.translateService.get('ldn-enable-service.notification.error.title'),
|
||||||
this.translateService.get('ldn-enable-service.notification.error.content'));
|
this.translateService.get('ldn-enable-service.notification.error.content'));
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,14 @@
|
|||||||
import {autoserialize, deserialize, inheritSerialization} from 'cerialize';
|
import {
|
||||||
import {LDN_SERVICE_CONSTRAINT_FILTER} from './ldn-service.resource-type';
|
autoserialize,
|
||||||
import {CacheableObject} from '../../../core/cache/cacheable-object.model';
|
deserialize,
|
||||||
|
inheritSerialization,
|
||||||
|
} from 'cerialize';
|
||||||
|
|
||||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||||
import {excludeFromEquals} from '../../../core/utilities/equals.decorators';
|
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
||||||
import { ResourceType } from '../../../core/shared/resource-type';
|
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. */
|
/** A single filter value and its properties. */
|
||||||
@typedObject
|
@typedObject
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
import {ResourceType} from '../../../core/shared/resource-type';
|
import {
|
||||||
import {CacheableObject} from '../../../core/cache/cacheable-object.model';
|
autoserialize,
|
||||||
import {autoserialize, deserialize, deserializeAs, inheritSerialization} from 'cerialize';
|
deserialize,
|
||||||
import {LDN_SERVICE} from './ldn-service.resource-type';
|
deserializeAs,
|
||||||
import {excludeFromEquals} from '../../../core/utilities/equals.decorators';
|
inheritSerialization,
|
||||||
import {typedObject} from '../../../core/cache/builders/build-decorators';
|
} from 'cerialize';
|
||||||
import {NotifyServicePattern} from './ldn-service-patterns.model';
|
|
||||||
|
|
||||||
|
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
|
* LDN Services bounded to each selected pattern, relation set in service creation
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
import {
|
||||||
|
ActivatedRouteSnapshot,
|
||||||
|
Resolve,
|
||||||
|
RouterStateSnapshot,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for the route parameters.
|
* Interface for the route parameters.
|
||||||
@@ -26,7 +30,7 @@ export class NotificationsSuggestionTargetsPageResolver implements Resolve<Notif
|
|||||||
return {
|
return {
|
||||||
pageId: route.queryParams.pageId,
|
pageId: route.queryParams.pageId,
|
||||||
pageSize: parseInt(route.queryParams.pageSize, 10),
|
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 { CommonModule } from '@angular/common';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
NotificationsSuggestionTargetsPageComponent
|
async,
|
||||||
} from '../../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page.component';
|
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', () => {
|
describe('NotificationsSuggestionTargetsPageComponent', () => {
|
||||||
let component: NotificationsSuggestionTargetsPageComponent;
|
let component: NotificationsSuggestionTargetsPageComponent;
|
||||||
@@ -16,12 +18,12 @@ describe('NotificationsSuggestionTargetsPageComponent', () => {
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
NotificationsSuggestionTargetsPageComponent
|
NotificationsSuggestionTargetsPageComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
NotificationsSuggestionTargetsPageComponent
|
NotificationsSuggestionTargetsPageComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.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 { CommonModule } from '@angular/common';
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
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 { Router } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
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 { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
|
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
|
import {
|
||||||
|
createFailedRemoteDataObject$,
|
||||||
|
createSuccessfulRemoteDataObject$,
|
||||||
|
} from '../../../../shared/remote-data.utils';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
||||||
@@ -43,7 +52,7 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
notificationService = new NotificationsServiceStub();
|
notificationService = new NotificationsServiceStub();
|
||||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||||
createBitstreamFormat: createSuccessfulRemoteDataObject$({}),
|
createBitstreamFormat: createSuccessfulRemoteDataObject$({}),
|
||||||
clearBitStreamFormatRequests: observableOf(null)
|
clearBitStreamFormatRequests: observableOf(null),
|
||||||
});
|
});
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -55,7 +64,7 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
{ provide: FormService, useValue: getMockFormService() },
|
{ provide: FormService, useValue: getMockFormService() },
|
||||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(AddBitstreamFormatComponent, {
|
.overrideComponent(AddBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
@@ -90,7 +99,7 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
notificationService = new NotificationsServiceStub();
|
notificationService = new NotificationsServiceStub();
|
||||||
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
bitstreamFormatDataService = jasmine.createSpyObj('bitstreamFormatDataService', {
|
||||||
createBitstreamFormat: createFailedRemoteDataObject$('Error', 500),
|
createBitstreamFormat: createFailedRemoteDataObject$('Error', 500),
|
||||||
clearBitStreamFormatRequests: observableOf(null)
|
clearBitStreamFormatRequests: observableOf(null),
|
||||||
});
|
});
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -102,7 +111,7 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
{ provide: FormService, useValue: getMockFormService() },
|
{ provide: FormService, useValue: getMockFormService() },
|
||||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(AddBitstreamFormatComponent, {
|
.overrideComponent(AddBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
|
@@ -1,13 +1,19 @@
|
|||||||
import { Router } from '@angular/router';
|
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
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 { RemoteData } from '../../../../core/data/remote-data';
|
||||||
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
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.
|
* This component renders the page to create a new bitstream format.
|
||||||
@@ -50,7 +56,7 @@ export class AddBitstreamFormatComponent {
|
|||||||
this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'),
|
this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'),
|
||||||
this.translateService.get('admin.registries.bitstream-formats.create.failure.content'));
|
this.translateService.get('admin.registries.bitstream-formats.create.failure.content'));
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
/* eslint-disable max-classes-per-file */
|
||||||
import { Action } from '@ngrx/store';
|
import { Action } from '@ngrx/store';
|
||||||
import { type } from '../../../shared/ngrx/type';
|
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
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
|
* 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'),
|
SELECT_FORMAT: type('dspace/bitstream-formats-registry/SELECT_FORMAT'),
|
||||||
DESELECT_FORMAT: type('dspace/bitstream-formats-registry/DESELECT_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 { Action } from '@ngrx/store';
|
||||||
|
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||||
import { bitstreamFormatReducer, BitstreamFormatRegistryState } from './bitstream-format.reducers';
|
|
||||||
import {
|
import {
|
||||||
BitstreamFormatsRegistryDeselectAction,
|
BitstreamFormatsRegistryDeselectAction,
|
||||||
BitstreamFormatsRegistryDeselectAllAction,
|
BitstreamFormatsRegistryDeselectAllAction,
|
||||||
BitstreamFormatsRegistrySelectAction
|
BitstreamFormatsRegistrySelectAction,
|
||||||
} from './bitstream-format.actions';
|
} from './bitstream-format.actions';
|
||||||
|
import {
|
||||||
|
bitstreamFormatReducer,
|
||||||
|
BitstreamFormatRegistryState,
|
||||||
|
} from './bitstream-format.reducers';
|
||||||
|
|
||||||
const bitstreamFormat1: BitstreamFormat = new BitstreamFormat();
|
const bitstreamFormat1: BitstreamFormat = new BitstreamFormat();
|
||||||
bitstreamFormat1.id = 'test-uuid-1';
|
bitstreamFormat1.id = 'test-uuid-1';
|
||||||
@@ -16,15 +20,15 @@ bitstreamFormat2.id = 'test-uuid-2';
|
|||||||
bitstreamFormat2.shortDescription = 'test-short-2';
|
bitstreamFormat2.shortDescription = 'test-short-2';
|
||||||
|
|
||||||
const initialState: BitstreamFormatRegistryState = {
|
const initialState: BitstreamFormatRegistryState = {
|
||||||
selectedBitstreamFormats: []
|
selectedBitstreamFormats: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const bitstream1SelectedState: BitstreamFormatRegistryState = {
|
const bitstream1SelectedState: BitstreamFormatRegistryState = {
|
||||||
selectedBitstreamFormats: [bitstreamFormat1]
|
selectedBitstreamFormats: [bitstreamFormat1],
|
||||||
};
|
};
|
||||||
|
|
||||||
const bitstream1and2SelectedState: BitstreamFormatRegistryState = {
|
const bitstream1and2SelectedState: BitstreamFormatRegistryState = {
|
||||||
selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2]
|
selectedBitstreamFormats: [bitstreamFormat1, bitstreamFormat2],
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('BitstreamFormatReducer', () => {
|
describe('BitstreamFormatReducer', () => {
|
||||||
|
@@ -3,7 +3,7 @@ import {
|
|||||||
BitstreamFormatsRegistryAction,
|
BitstreamFormatsRegistryAction,
|
||||||
BitstreamFormatsRegistryActionTypes,
|
BitstreamFormatsRegistryActionTypes,
|
||||||
BitstreamFormatsRegistryDeselectAction,
|
BitstreamFormatsRegistryDeselectAction,
|
||||||
BitstreamFormatsRegistrySelectAction
|
BitstreamFormatsRegistrySelectAction,
|
||||||
} from './bitstream-format.actions';
|
} from './bitstream-format.actions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,21 +32,21 @@ export function bitstreamFormatReducer(state = initialState, action: BitstreamFo
|
|||||||
|
|
||||||
case BitstreamFormatsRegistryActionTypes.SELECT_FORMAT: {
|
case BitstreamFormatsRegistryActionTypes.SELECT_FORMAT: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat]
|
selectedBitstreamFormats: [...state.selectedBitstreamFormats, (action as BitstreamFormatsRegistrySelectAction).bitstreamFormat],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case BitstreamFormatsRegistryActionTypes.DESELECT_FORMAT: {
|
case BitstreamFormatsRegistryActionTypes.DESELECT_FORMAT: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
selectedBitstreamFormats: state.selectedBitstreamFormats.filter(
|
selectedBitstreamFormats: state.selectedBitstreamFormats.filter(
|
||||||
(selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat
|
(selectedBitstreamFormats) => selectedBitstreamFormats !== (action as BitstreamFormatsRegistryDeselectAction).bitstreamFormat,
|
||||||
)
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case BitstreamFormatsRegistryActionTypes.DESELECT_ALL_FORMAT: {
|
case BitstreamFormatsRegistryActionTypes.DESELECT_ALL_FORMAT: {
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
selectedBitstreamFormats: []
|
selectedBitstreamFormats: [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</ds-pagination>
|
</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}}
|
{{'admin.registries.bitstream-formats.no-items' | translate}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -2,30 +2,42 @@ import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
|||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { of, of as observableOf } from 'rxjs';
|
import { of, of as observableOf } from 'rxjs';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import {
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import {
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
cold,
|
||||||
|
getTestScheduler,
|
||||||
|
hot,
|
||||||
|
} from 'jasmine-marbles';
|
||||||
|
import { of as observableOf } from 'rxjs';
|
||||||
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
|
|
||||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
||||||
import { cold, getTestScheduler, hot } from 'jasmine-marbles';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import {
|
import {
|
||||||
createFailedRemoteDataObject$,
|
createFailedRemoteDataObject$,
|
||||||
createNoContentRemoteDataObject$,
|
createNoContentRemoteDataObject$,
|
||||||
createSuccessfulRemoteDataObject,
|
createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$
|
createSuccessfulRemoteDataObject$,
|
||||||
} from '../../../shared/remote-data.utils';
|
} from '../../../shared/remote-data.utils';
|
||||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||||
|
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
|
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
@@ -84,7 +96,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
bitstreamFormat1,
|
bitstreamFormat1,
|
||||||
bitstreamFormat2,
|
bitstreamFormat2,
|
||||||
bitstreamFormat3,
|
bitstreamFormat3,
|
||||||
bitstreamFormat4
|
bitstreamFormat4,
|
||||||
];
|
];
|
||||||
const mockFormatsRD = createSuccessfulRemoteDataObject(createPaginatedList(mockFormatsList));
|
const mockFormatsRD = createSuccessfulRemoteDataObject(createPaginatedList(mockFormatsList));
|
||||||
|
|
||||||
@@ -101,7 +113,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
deselectBitstreamFormat: {},
|
deselectBitstreamFormat: {},
|
||||||
deselectAllBitstreamFormats: {},
|
deselectAllBitstreamFormats: {},
|
||||||
delete: createSuccessfulRemoteDataObject$({}),
|
delete: createSuccessfulRemoteDataObject$({}),
|
||||||
clearBitStreamFormatRequests: observableOf('cleared')
|
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
@@ -129,7 +141,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
{provide: GroupDataService, useValue: groupDataService},
|
{provide: GroupDataService, useValue: groupDataService},
|
||||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -244,7 +256,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
deselectBitstreamFormat: {},
|
deselectBitstreamFormat: {},
|
||||||
deselectAllBitstreamFormats: {},
|
deselectAllBitstreamFormats: {},
|
||||||
delete: createNoContentRemoteDataObject$(),
|
delete: createNoContentRemoteDataObject$(),
|
||||||
clearBitStreamFormatRequests: observableOf('cleared')
|
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
@@ -314,7 +326,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
deselectBitstreamFormat: {},
|
deselectBitstreamFormat: {},
|
||||||
deselectAllBitstreamFormats: {},
|
deselectAllBitstreamFormats: {},
|
||||||
delete: createFailedRemoteDataObject$(),
|
delete: createFailedRemoteDataObject$(),
|
||||||
clearBitStreamFormatRequests: observableOf('cleared')
|
clearBitStreamFormatRequests: observableOf('cleared'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
@@ -11,10 +11,37 @@ import { Router, RouterLink } from '@angular/router';
|
|||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
combineLatest as observableCombineLatest,
|
||||||
|
Observable,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
map,
|
||||||
|
mergeMap,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
toArray,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
|
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||||
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders a list of bitstream formats
|
* This component renders a list of bitstream formats
|
||||||
@@ -46,7 +73,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
|||||||
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'rbp',
|
id: 'rbp',
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
pageSizeOptions: [20, 40, 60, 80, 100]
|
pageSizeOptions: [20, 40, 60, 80, 100],
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(private notificationsService: NotificationsService,
|
constructor(private notificationsService: NotificationsService,
|
||||||
@@ -75,7 +102,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
|||||||
map((response: RemoteData<NoContent>) => response.hasSucceeded),
|
map((response: RemoteData<NoContent>) => response.hasSucceeded),
|
||||||
)),
|
)),
|
||||||
// wait for all responses to come in and return them as a single array
|
// wait for all responses to come in and return them as a single array
|
||||||
toArray()
|
toArray(),
|
||||||
).subscribe((results: boolean[]) => {
|
).subscribe((results: boolean[]) => {
|
||||||
// Count the number of succeeded and failed deletions
|
// Count the number of succeeded and failed deletions
|
||||||
const successResponses = results.filter((result: boolean) => result);
|
const successResponses = results.filter((result: boolean) => result);
|
||||||
@@ -112,7 +139,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
|||||||
return this.bitstreamFormatService.getSelectedBitstreamFormats().pipe(
|
return this.bitstreamFormatService.getSelectedBitstreamFormats().pipe(
|
||||||
map((bitstreamFormats: BitstreamFormat[]) => {
|
map((bitstreamFormats: BitstreamFormat[]) => {
|
||||||
return bitstreamFormats.find((selectedFormat) => selectedFormat.id === bitstreamFormat.id) != null;
|
return bitstreamFormats.find((selectedFormat) => selectedFormat.id === bitstreamFormat.id) != null;
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +165,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const messages = observableCombineLatest(
|
const messages = observableCombineLatest(
|
||||||
this.translateService.get(`${prefix}.${suffix}.head`),
|
this.translateService.get(`${prefix}.${suffix}.head`),
|
||||||
this.translateService.get(`${prefix}.${suffix}.amount`, {amount: amount})
|
this.translateService.get(`${prefix}.${suffix}.amount`, { amount: amount }),
|
||||||
);
|
);
|
||||||
messages.subscribe(([head, content]) => {
|
messages.subscribe(([head, content]) => {
|
||||||
|
|
||||||
@@ -155,7 +182,7 @@ export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
|||||||
this.bitstreamFormats = this.paginationService.getFindListOptions(this.pageConfig.id, this.pageConfig).pipe(
|
this.bitstreamFormats = this.paginationService.getFindListOptions(this.pageConfig.id, this.pageConfig).pipe(
|
||||||
switchMap((findListOptions: FindListOptions) => {
|
switchMap((findListOptions: FindListOptions) => {
|
||||||
return this.bitstreamFormatService.findAll(findListOptions);
|
return this.bitstreamFormatService.findAll(findListOptions);
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user