The collection is displayed in the workflow task

This commit is contained in:
cris
2023-01-28 17:48:39 +00:00
parent 480370b8ed
commit 8eab0f743f
4 changed files with 62 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
<ds-themed-item-list-preview [item]="item$.value"
[object]="object"
[showSubmitter]="showSubmitter"
[workflowItem]="workflowitem$.value"
[status]="status"></ds-themed-item-list-preview>
<div class="row">

View File

@@ -0,0 +1,16 @@
<div>
<div class="row" *ngIf="collection">
<div class="col-12">
<div class="col-12">
<i>
<small>{{"collection.listelement.badge" | translate}}:</small>
</i>
&nbsp;
<a [href]="uiBaseUrl+'/collections/'+collection.uuid">
{{collection.metadata["dc.title"][0]["value"]}}
</a>
</div>
</div>
</div>
<ng-template #vcr></ng-template>
</div>

View File

@@ -1,9 +1,13 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectorRef, Component, ComponentFactoryResolver, Input } from '@angular/core';
import { ThemedComponent } from '../../../theme-support/themed.component';
import { ItemListPreviewComponent } from './item-list-preview.component';
import { Item } from '../../../../core/shared/item.model';
import { MyDspaceItemStatusType } from '../../../object-collection/shared/mydspace-item-status/my-dspace-item-status-type';
import { SearchResult } from '../../../search/models/search-result.model';
import { WorkflowItem } from 'src/app/core/submission/models/workflowitem.model';
import { ThemeService } from 'src/app/shared/theme-support/theme.service';
import { CollectionDataService } from 'src/app/core/data/collection-data.service';
import { environment } from '../../../../../../src/environments/environment';
/**
* Themed wrapper for ItemListPreviewComponent
@@ -11,7 +15,7 @@ import { SearchResult } from '../../../search/models/search-result.model';
@Component({
selector: 'ds-themed-item-list-preview',
styleUrls: [],
templateUrl: '../../../theme-support/themed.component.html',
templateUrl: 'themed-item-list-preview.component.html'
})
export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPreviewComponent> {
protected inAndOutputNames: (keyof ItemListPreviewComponent & keyof this)[] = ['item', 'object', 'status', 'showSubmitter'];
@@ -24,6 +28,43 @@ export class ThemedItemListPreviewComponent extends ThemedComponent<ItemListPrev
@Input() showSubmitter = false;
@Input() workflowItem: WorkflowItem;
collection: any = null;
uiBaseUrl: string = environment.ui.baseUrl;
constructor(
protected resolver: ComponentFactoryResolver,
protected cdr: ChangeDetectorRef,
protected themeService: ThemeService,
protected collectionDataService: CollectionDataService
){
super(resolver, cdr, themeService)
}
ngOnInit() {
super.ngOnInit()
this.getCollectionName()
}
protected getCollectionName(): void {
if (!this.item) {
return;
}
const collectionId = this.workflowItem?.sections.collection;
if (!collectionId) {
return;
}
this.collectionDataService.findByHref(`${environment.rest.baseUrl}/api/core/collections/${collectionId}`).subscribe(collection => {
this.collection = collection?.payload;
console.log("collection", this.collection)
});
}
protected getComponentName(): string {
return 'ItemListPreviewComponent';

View File

@@ -2,6 +2,7 @@
<ds-themed-item-list-preview [item]="item$.value"
[object]="object"
[showSubmitter]="showSubmitter"
[workflowItem]="workflowitem$.value"
[status]="status"></ds-themed-item-list-preview>
<div class="row">
<div [ngClass]="showThumbnails ? 'offset-3 offset-md-2 pl-3' : ''">