Fixes status on DMP and Dataset Listing Items
This commit is contained in:
parent
825f792a5d
commit
237ae94f10
|
@ -14,5 +14,5 @@ export interface DatasetListingModel {
|
|||
status: Number;
|
||||
created: Date;
|
||||
modified: Date;
|
||||
finalizedDat: Date;
|
||||
finalizedAt: Date;
|
||||
}
|
||||
|
|
|
@ -11,11 +11,13 @@ export interface DmpListingModel {
|
|||
profile: String;
|
||||
creationTime: String;
|
||||
modifiedTime: String;
|
||||
finalizedDat: Date;
|
||||
publishedAt: Date;
|
||||
finalizedAt: Date;
|
||||
organisations: String;
|
||||
groupId: string;
|
||||
version: number;
|
||||
datasets: any[];
|
||||
associatedProfiles: any[];
|
||||
users: any[];
|
||||
public: boolean;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</div>
|
||||
</div>
|
||||
<p *ngIf="isDraft">{{'DATASET-LISTING.COLUMNS.LAST-EDITED' | translate}} {{ dataset.modified | date: "shortDate"}}</p>
|
||||
<p *ngIf="!isDraft">{{'DATASET-LISTING.COLUMNS.PUBLISHED' | translate}} {{ dataset.finalizedDat | date: "shortDate"}}</p>
|
||||
<p *ngIf="!isDraft">{{'DATASET-LISTING.COLUMNS.FINALIZED' | translate}} {{ dataset.finalizedAt | date: "shortDate"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="info">
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
<div matTooltip="{{profile.label}}" class="chip ml-2 mr-2">{{profile.label}}</div>
|
||||
</div>
|
||||
<p *ngIf="isDraft">{{'DMP-PROFILE-LISTING.COLUMNS.LAST-EDITED' | translate}} {{dmp.modifiedTime | date: "shortDate"}}</p>
|
||||
<p *ngIf="!isDraft">{{'DMP-PROFILE-LISTING.COLUMNS.PUBLISHED' | translate}} {{dmp.finalizedDat | date: "shortDate"}}</p>
|
||||
<p *ngIf="isFinalized && !isPublished">{{'TYPES.DMP.FINALISED' | translate}} {{dmp.finalizedAt | date: "shortDate"}}</p>
|
||||
<p *ngIf="isPublished">{{'DMP-PROFILE-LISTING.COLUMNS.PUBLISHED' | translate}} {{dmp.publishedAt | date: "shortDate"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row d-flex align-items-center my-1">
|
||||
|
|
|
@ -28,6 +28,8 @@ export class DmpListingItemComponent implements OnInit {
|
|||
@Output() onClick: EventEmitter<DmpListingModel> = new EventEmitter();
|
||||
|
||||
isDraft: boolean;
|
||||
isFinalized: boolean;
|
||||
isPublished: boolean;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
|
@ -38,8 +40,17 @@ export class DmpListingItemComponent implements OnInit {
|
|||
private translate: TranslateService) { }
|
||||
|
||||
ngOnInit() {
|
||||
if (this.dmp.status == DmpStatus.Draft) { this.isDraft = true }
|
||||
else { this.isDraft = false }
|
||||
if (this.dmp.status == DmpStatus.Draft) {
|
||||
this.isDraft = true;
|
||||
this.isFinalized = false;
|
||||
this.isPublished = false;
|
||||
}
|
||||
else if (this.dmp.status == DmpStatus.Finalized) {
|
||||
this.isDraft = false;
|
||||
this.isFinalized = true;
|
||||
this.isPublished = false;
|
||||
if (this.dmp.public == true) { this.isPublished = true }
|
||||
}
|
||||
}
|
||||
|
||||
openShareDialog(rowId: any, rowName: any) {
|
||||
|
|
|
@ -360,6 +360,7 @@
|
|||
"DESCRIPTION": "Description",
|
||||
"CREATED": "Created",
|
||||
"PUBLISHED": "Published",
|
||||
"FINALIZED": "Finalized",
|
||||
"LAST-EDITED": "Last Edited",
|
||||
"ACTIONS": "Actions",
|
||||
"DMP": "DMP",
|
||||
|
|
Loading…
Reference in New Issue