mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 23:43:01 +00:00
[CSTPER-3620] Workflow Actions refresh entire MyDSpace page instead of just WorkflowItem
Removed abstraction on claimed-search-result-list-element components
This commit is contained in:
@@ -1,51 +0,0 @@
|
|||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
|
||||||
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
|
||||||
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
|
||||||
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
|
||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
|
||||||
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
|
||||||
import { followLink } from '../../../utils/follow-link-config.model';
|
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This component renders claimed task object for the search result in the list view.
|
|
||||||
* The task can be claimed, claimed declined or claimed approved.
|
|
||||||
*/
|
|
||||||
export abstract class AbstractClaimedSearchResultListElementComponent extends SearchResultListElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A boolean representing if to show submitter information
|
|
||||||
*/
|
|
||||||
public showSubmitter = true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represent item's status
|
|
||||||
*/
|
|
||||||
public status = MyDspaceItemStatusType.VALIDATION;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The workflowitem object that belonging to the result object
|
|
||||||
*/
|
|
||||||
public workflowitemRD$: Observable<RemoteData<WorkflowItem>>;
|
|
||||||
|
|
||||||
protected constructor(
|
|
||||||
protected linkService: LinkService,
|
|
||||||
protected truncatableService: TruncatableService
|
|
||||||
) {
|
|
||||||
super(truncatableService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize all instance variables
|
|
||||||
*/
|
|
||||||
ngOnInit() {
|
|
||||||
super.ngOnInit();
|
|
||||||
this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true,
|
|
||||||
followLink('item'), followLink('submitter')
|
|
||||||
), followLink('action'));
|
|
||||||
this.workflowitemRD$ = this.dso.workflowitem as Observable<RemoteData<WorkflowItem>>;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -3,10 +3,16 @@ import { LocationStrategy, PathLocationStrategy } from '@angular/common';
|
|||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
import { ClaimedApprovedTaskSearchResult } from '../../../../object-collection/shared/claimed-approved-task-search-result.model';
|
||||||
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { AbstractClaimedSearchResultListElementComponent } from '../abstract-claimed-search-result-list-element.component';
|
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { RemoteData } from '../../../../../core/data/remote-data';
|
||||||
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
|
import { followLink } from '../../../../utils/follow-link-config.model';
|
||||||
|
import { SearchResultListElementComponent } from '../../../search-result-list-element/search-result-list-element.component';
|
||||||
|
import { ClaimedTaskSearchResult} from '../../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task approved object for the search result in the list view.
|
* This component renders claimed task approved object for the search result in the list view.
|
||||||
@@ -17,20 +23,40 @@ import { MyDspaceItemStatusType } from '../../../../object-collection/shared/myd
|
|||||||
templateUrl: './claimed-approved-search-result-list-element.component.html',
|
templateUrl: './claimed-approved-search-result-list-element.component.html',
|
||||||
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
||||||
})
|
})
|
||||||
|
|
||||||
@listableObjectComponent(ClaimedApprovedTaskSearchResult, ViewMode.ListElement)
|
@listableObjectComponent(ClaimedApprovedTaskSearchResult, ViewMode.ListElement)
|
||||||
export class ClaimedApprovedSearchResultListElementComponent extends AbstractClaimedSearchResultListElementComponent {
|
export class ClaimedApprovedSearchResultListElementComponent extends SearchResultListElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A boolean representing if to show submitter information
|
||||||
|
*/
|
||||||
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represent item's status
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.APPROVED;
|
public status = MyDspaceItemStatusType.VALIDATION;
|
||||||
|
|
||||||
constructor(
|
/**
|
||||||
|
* The workflowitem object that belonging to the result object
|
||||||
|
*/
|
||||||
|
public workflowitemRD$: Observable<RemoteData<WorkflowItem>>;
|
||||||
|
|
||||||
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService
|
protected truncatableService: TruncatableService
|
||||||
) {
|
) {
|
||||||
super(linkService, truncatableService);
|
super(truncatableService);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize all instance variables
|
||||||
|
*/
|
||||||
|
ngOnInit() {
|
||||||
|
super.ngOnInit();
|
||||||
|
this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true,
|
||||||
|
followLink('item'), followLink('submitter')
|
||||||
|
), followLink('action'));
|
||||||
|
this.workflowitemRD$ = this.dso.workflowitem as Observable<RemoteData<WorkflowItem>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,19 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
|
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
|
||||||
|
|
||||||
import { AbstractClaimedSearchResultListElementComponent } from '../abstract-claimed-search-result-list-element.component';
|
|
||||||
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model';
|
import { ClaimedDeclinedTaskSearchResult } from '../../../../object-collection/shared/claimed-declined-task-search-result.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../truncatable/truncatable.service';
|
||||||
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
import { MyDspaceItemStatusType } from '../../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { RemoteData } from '../../../../../core/data/remote-data';
|
||||||
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
|
import { followLink } from '../../../../utils/follow-link-config.model';
|
||||||
|
import { SearchResultListElementComponent } from '../../../search-result-list-element/search-result-list-element.component';
|
||||||
|
import { ClaimedTaskSearchResult } from '../../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
|
import { ClaimedTask } from '../../../../../core/tasks/models/claimed-task-object.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders claimed task declined object for the search result in the list view.
|
* This component renders claimed task declined object for the search result in the list view.
|
||||||
@@ -18,20 +24,40 @@ import { MyDspaceItemStatusType } from '../../../../object-collection/shared/myd
|
|||||||
templateUrl: './claimed-declined-search-result-list-element.component.html',
|
templateUrl: './claimed-declined-search-result-list-element.component.html',
|
||||||
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
||||||
})
|
})
|
||||||
|
|
||||||
@listableObjectComponent(ClaimedDeclinedTaskSearchResult, ViewMode.ListElement)
|
@listableObjectComponent(ClaimedDeclinedTaskSearchResult, ViewMode.ListElement)
|
||||||
export class ClaimedDeclinedSearchResultListElementComponent extends AbstractClaimedSearchResultListElementComponent {
|
export class ClaimedDeclinedSearchResultListElementComponent extends SearchResultListElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A boolean representing if to show submitter information
|
||||||
|
*/
|
||||||
|
public showSubmitter = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent item's status
|
* Represent item's status
|
||||||
*/
|
*/
|
||||||
public status = MyDspaceItemStatusType.DECLINED;
|
public status = MyDspaceItemStatusType.VALIDATION;
|
||||||
|
|
||||||
constructor(
|
/**
|
||||||
|
* The workflowitem object that belonging to the result object
|
||||||
|
*/
|
||||||
|
public workflowitemRD$: Observable<RemoteData<WorkflowItem>>;
|
||||||
|
|
||||||
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService
|
protected truncatableService: TruncatableService
|
||||||
) {
|
) {
|
||||||
super(linkService, truncatableService);
|
super(truncatableService);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize all instance variables
|
||||||
|
*/
|
||||||
|
ngOnInit() {
|
||||||
|
super.ngOnInit();
|
||||||
|
this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true,
|
||||||
|
followLink('item'), followLink('submitter')
|
||||||
|
), followLink('action'));
|
||||||
|
this.workflowitemRD$ = this.dso.workflowitem as Observable<RemoteData<WorkflowItem>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,13 @@ import { listableObjectComponent } from '../../../object-collection/shared/lista
|
|||||||
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
import { ClaimedTaskSearchResult } from '../../../object-collection/shared/claimed-task-search-result.model';
|
||||||
import { LinkService } from '../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../core/cache/builders/link.service';
|
||||||
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
import { TruncatableService } from '../../../truncatable/truncatable.service';
|
||||||
import { AbstractClaimedSearchResultListElementComponent } from './abstract-claimed-search-result-list-element.component';
|
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
|
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
|
||||||
|
import { followLink } from '../../../utils/follow-link-config.model';
|
||||||
|
import { SearchResultListElementComponent } from '../../search-result-list-element/search-result-list-element.component';
|
||||||
|
import { ClaimedTask } from '../../../../core/tasks/models/claimed-task-object.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-claimed-search-result-list-element',
|
selector: 'ds-claimed-search-result-list-element',
|
||||||
@@ -15,13 +21,39 @@ import { AbstractClaimedSearchResultListElementComponent } from './abstract-clai
|
|||||||
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
providers: [Location, { provide: LocationStrategy, useClass: PathLocationStrategy }]
|
||||||
})
|
})
|
||||||
@listableObjectComponent(ClaimedTaskSearchResult, ViewMode.ListElement)
|
@listableObjectComponent(ClaimedTaskSearchResult, ViewMode.ListElement)
|
||||||
export class ClaimedSearchResultListElementComponent extends AbstractClaimedSearchResultListElementComponent {
|
export class ClaimedSearchResultListElementComponent extends SearchResultListElementComponent<ClaimedTaskSearchResult, ClaimedTask> {
|
||||||
|
|
||||||
constructor(
|
/**
|
||||||
|
* A boolean representing if to show submitter information
|
||||||
|
*/
|
||||||
|
public showSubmitter = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represent item's status
|
||||||
|
*/
|
||||||
|
public status = MyDspaceItemStatusType.VALIDATION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The workflowitem object that belonging to the result object
|
||||||
|
*/
|
||||||
|
public workflowitemRD$: Observable<RemoteData<WorkflowItem>>;
|
||||||
|
|
||||||
|
public constructor(
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
protected truncatableService: TruncatableService
|
protected truncatableService: TruncatableService
|
||||||
) {
|
) {
|
||||||
super(linkService, truncatableService);
|
super(truncatableService);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize all instance variables
|
||||||
|
*/
|
||||||
|
ngOnInit() {
|
||||||
|
super.ngOnInit();
|
||||||
|
this.linkService.resolveLinks(this.dso, followLink('workflowitem', null, true,
|
||||||
|
followLink('item'), followLink('submitter')
|
||||||
|
), followLink('action'));
|
||||||
|
this.workflowitemRD$ = this.dso.workflowitem as Observable<RemoteData<WorkflowItem>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
import { SearchResult } from '../../search/search-result.model';
|
import { SearchResult } from '../../search/search-result.model';
|
||||||
|
Reference in New Issue
Block a user