Merge remote-tracking branch 'github/main' into DURACOM-191-20240304-align-to-main

# Conflicts:
#	src/app/admin/admin-notifications/admin-notifications-routing.module.ts
#	src/app/admin/admin-notifications/admin-notifications.module.ts
#	src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component.spec.ts
#	src/app/admin/admin-notifications/admin-quality-assurance-source-page-component/admin-quality-assurance-source-page.component.ts
#	src/app/admin/admin-notifications/admin-quality-assurance-topics-page/admin-quality-assurance-topics-page.component.spec.ts
#	src/app/admin/admin-routing.module.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-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.module.ts
#	src/app/app-routing.module.ts
#	src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts
#	src/app/browse-by/browse-by-date-page/themed-browse-by-date-page.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-page/themed-browse-by-metadata-page.component.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-data-type.ts
#	src/app/browse-by/browse-by-switcher/browse-by-decorator.spec.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-switcher/themed-browse-by-switcher.component.ts
#	src/app/browse-by/browse-by-taxonomy-page/themed-browse-by-taxonomy-page.component.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-page/browse-by-title-page.component.ts
#	src/app/browse-by/browse-by-title-page/themed-browse-by-title-page.component.ts
#	src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts
#	src/app/browse-by/browse-by.module.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/community-page/community-page-routing.module.ts
#	src/app/community-page/community-page.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-collection-list/themed-community-page-sub-collection-list.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/community-page/sections/sub-com-col-section/sub-community-list/themed-community-page-sub-community-list.component.ts
#	src/app/core/data/processes/process-data.service.ts
#	src/app/core/shared/non-hierarchical-browse-definition.ts
#	src/app/core/submission/vocabularies/vocabulary.data.service.ts
#	src/app/core/submission/workspaceitem-data.service.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.ts
#	src/app/dso-shared/dso-shared.module.ts
#	src/app/footer/footer.component.spec.ts
#	src/app/header-nav-wrapper/header-navbar-wrapper.component.ts
#	src/app/header/header.component.ts
#	src/app/home-page/home-page.component.ts
#	src/app/home-page/home-page.module.ts
#	src/app/info/info-routing.module.ts
#	src/app/item-page/alerts/item-alerts.component.spec.ts
#	src/app/item-page/alerts/item-alerts.component.ts
#	src/app/item-page/field-components/metadata-values/metadata-values.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-shared.module.ts
#	src/app/item-page/simple/item-page.component.spec.ts
#	src/app/item-page/simple/item-page.component.ts
#	src/app/menu.resolver.spec.ts
#	src/app/my-dspace-page/my-dspace-page.module.ts
#	src/app/navbar/expandable-navbar-section/expandable-navbar-section.component.ts
#	src/app/navbar/navbar.component.spec.ts
#	src/app/notifications/notifications.module.ts
#	src/app/notifications/qa/events/quality-assurance-events.component.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/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.ts
#	src/app/process-page/overview/process-overview.component.spec.ts
#	src/app/process-page/overview/process-overview.component.ts
#	src/app/process-page/process-page-shared.module.ts
#	src/app/profile-page/profile-page.module.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-topics-page/quality-assurance-topics-page.component.ts
#	src/app/root/root.component.ts
#	src/app/search-page/configuration-search-page.component.ts
#	src/app/shared/auth-nav-menu/auth-nav-menu.component.spec.ts
#	src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts
#	src/app/shared/comcol/comcol.module.ts
#	src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts
#	src/app/shared/dso-selector/modal-wrappers/dso-selector-modal-wrapper.component.spec.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/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts
#	src/app/shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/dynamic-lookup-relation-modal.component.ts
#	src/app/shared/menu/menu-item/external-link-menu-item.component.ts
#	src/app/shared/menu/menu-item/link-menu-item.component.ts
#	src/app/shared/menu/menu-item/onclick-menu-item.component.ts
#	src/app/shared/menu/menu-item/text-menu-item.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/metadata-representation/metadata-representation.directive.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/claimed-task/switcher/claimed-task-actions.directive.ts
#	src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.spec.ts
#	src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts
#	src/app/shared/object-collection/shared/listable-object/listable-object.directive.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-filters.component.spec.ts
#	src/app/shared/search/search-filters/search-filters.component.ts
#	src/app/shared/search/search-settings/search-settings.component.spec.ts
#	src/app/shared/search/search.component.spec.ts
#	src/app/shared/search/search.component.ts
#	src/app/shared/search/themed-search.component.ts
#	src/app/shared/shared.module.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/text/starts-with-text.component.spec.ts
#	src/app/shared/testing/vocabulary-service.stub.ts
#	src/app/submission/form/submission-form.component.html
#	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/section-upload.component.html
#	src/app/submission/sections/upload/section-upload.component.ts
#	src/app/submission/submission.module.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/advanced-workflow-action/advanced-workflow-actions-loader/advanced-workflow-actions-loader.component.ts
#	src/app/workflowitems-edit-page/workflowitems-edit-page.module.ts
#	src/config/app-config.interface.ts
#	src/themes/custom/app/browse-by/browse-by-date-page/browse-by-date-page.component.ts
#	src/themes/custom/app/browse-by/browse-by-metadata-page/browse-by-metadata-page.component.ts
#	src/themes/custom/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts
#	src/themes/custom/app/browse-by/browse-by-taxonomy-page/browse-by-taxonomy-page.component.ts
#	src/themes/custom/app/browse-by/browse-by-title-page/browse-by-title-page.component.ts
#	src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts
#	src/themes/custom/app/community-page/sub-community-list/community-page-sub-community-list.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
This commit is contained in:
Andrea Barbasso
2024-03-04 15:04:33 +01:00
670 changed files with 32800 additions and 4491 deletions

View File

@@ -1,16 +1,5 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { RemoteData } from '../../core/data/remote-data';
import { PaginatedList } from '../../core/data/paginated-list.model';
import { Process } from '../processes/process.model';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { getFirstSucceededRemoteDataPayload } from '../../core/shared/operators';
import { EPerson } from '../../core/eperson/models/eperson.model';
import { map, switchMap } from 'rxjs/operators';
import { ProcessDataService } from '../../core/data/processes/process-data.service';
import { PaginationService } from '../../core/pagination/pagination.service';
import { FindListOptions } from '../../core/data/find-list-options.model';
import { Component, OnDestroy, OnInit, TemplateRef } from '@angular/core';
import { Subscription } from 'rxjs';
import { ProcessBulkDeleteService } from './process-bulk-delete.service';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { hasValue } from '../../shared/empty.util';
@@ -20,6 +9,8 @@ import { VarDirective } from '../../shared/utils/var.directive';
import { PaginationComponent } from '../../shared/pagination/pagination.component';
import { RouterLink } from '@angular/router';
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
import { ProcessOverviewService, ProcessSortField } from './process-overview.service';
import { ProcessStatus } from '../processes/process-status.model';
@Component({
selector: 'ds-process-overview',
@@ -32,72 +23,25 @@ import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
*/
export class ProcessOverviewComponent implements OnInit, OnDestroy {
/**
* List of all processes
*/
processesRD$: Observable<RemoteData<PaginatedList<Process>>>;
// Enums are redeclared here so they can be used in the template
protected readonly ProcessStatus = ProcessStatus;
protected readonly ProcessSortField = ProcessSortField;
/**
* The current pagination configuration for the page used by the FindAll method
*/
config: FindListOptions = Object.assign(new FindListOptions(), {
elementsPerPage: 20
});
/**
* The current pagination configuration for the page
*/
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
id: 'po',
pageSize: 20
});
/**
* Date format to use for start and end time of processes
*/
dateFormat = 'yyyy-MM-dd HH:mm:ss';
processesToDelete: string[] = [];
private modalRef: any;
isProcessingSub: Subscription;
constructor(protected processService: ProcessDataService,
protected paginationService: PaginationService,
protected ePersonService: EPersonDataService,
constructor(protected processOverviewService: ProcessOverviewService,
protected modalService: NgbModal,
public processBulkDeleteService: ProcessBulkDeleteService,
protected dsoNameService: DSONameService,
) {
}
ngOnInit(): void {
this.setProcesses();
this.processBulkDeleteService.clearAllProcesses();
}
/**
* Send a request to fetch all processes for the current page
*/
setProcesses() {
this.processesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
switchMap((config) => this.processService.findAll(config, true, false))
);
}
/**
* Get the name of an EPerson by ID
* @param id ID of the EPerson
*/
getEpersonName(id: string): Observable<string> {
return this.ePersonService.findById(id).pipe(
getFirstSucceededRemoteDataPayload(),
map((eperson: EPerson) => this.dsoNameService.getName(eperson)),
);
}
ngOnDestroy(): void {
this.paginationService.clearPagination(this.pageConfig.id);
if (hasValue(this.isProcessingSub)) {
this.isProcessingSub.unsubscribe();
}
@@ -107,7 +51,7 @@ export class ProcessOverviewComponent implements OnInit, OnDestroy {
* Open a given modal.
* @param content - the modal content.
*/
openDeleteModal(content) {
openDeleteModal(content: TemplateRef<any>) {
this.modalRef = this.modalService.open(content);
}
@@ -133,7 +77,6 @@ export class ProcessOverviewComponent implements OnInit, OnDestroy {
.subscribe((isProcessing) => {
if (!isProcessing) {
this.closeModal();
this.setProcesses();
}
});
}