diff --git a/dmp-frontend/src/app/core/model/version/version-listing.model.ts b/dmp-frontend/src/app/core/model/version/version-listing.model.ts new file mode 100644 index 000000000..571f2d361 --- /dev/null +++ b/dmp-frontend/src/app/core/model/version/version-listing.model.ts @@ -0,0 +1,5 @@ +export interface VersionListingModel { + id: string; + groupId: string; + version: number; +} diff --git a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts index e97f1ec25..40d9f4391 100644 --- a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts +++ b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts @@ -20,6 +20,7 @@ import { RequestItem } from '../../query/request-item'; import { BaseHttpService } from '../http/base-http.service'; import { ConfigurationService } from '../configuration/configuration.service'; import { UserInfoListingModel } from '@app/core/model/user/user-info-listing'; +import { VersionListingModel } from '@app/core/model/version/version-listing.model'; @Injectable() export class DmpService { @@ -57,6 +58,10 @@ export class DmpService { return this.http.get(this.actionUrl + 'publicOverview/' + id, { headers: this.headers }) } + getAllVersions(id: string): Observable { + return this.http.get(this.actionUrl + 'versions/' + id, { headers: this.headers }) + } + unlock(id: String): Observable { return this.http.get(this.actionUrl + id + '/unlock', { headers: this.headers }); } diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 92357e3fa..7cb6b9f44 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -30,10 +30,15 @@ lock_outline {{'DMP-OVERVIEW.LOCKED' | translate}} - + --> + + + {{'DMP-LISTING.VERSION' | translate}} {{version.version}} + +
{{'GENERAL.STATUSES.EDIT' | translate}} : {{dmp.modifiedTime | date:"longDate"}}
@@ -426,4 +431,4 @@ ---> \ No newline at end of file +--> diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 3b0330271..cadb8c4ed 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -35,6 +35,7 @@ import { LockService } from '@app/core/services/lock/lock.service'; import { ReturnStatement, ConditionalExpr } from '@angular/compiler'; import { LockModel } from '@app/core/model/lock/lock.model'; import { Guid } from '@common/types/guid'; +import { VersionListingModel } from '@app/core/model/version/version-listing.model'; @Component({ selector: 'app-dmp-overview', @@ -54,6 +55,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { hasDOIToken = false; lockStatus: Boolean; textMessage: any; + versions: VersionListingModel[]; @ViewChild('doi', { static: false }) doi: ElementRef; @@ -94,6 +96,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.dmp = data; this.checkLockStatus(this.dmp.id); this.setIsUserOwner(); + this.getAllVersions(this.dmp); const breadCrumbs = []; breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DMPS'), url: "/plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id }); @@ -117,6 +120,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { this.dmp = data; this.checkLockStatus(this.dmp.id); this.setIsUserOwner(); + this.getAllVersions(this.dmp); const breadCrumbs = []; breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id }); @@ -374,6 +378,13 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { }); } + getAllVersions(dmp: DmpOverviewModel) { + this.dmpService.getAllVersions(dmp.id) + .pipe(takeUntil(this._destroyed)) + .subscribe(items => { + this.versions = items; + }); + } showConfirmationDOIDialog(dmp: DmpOverviewModel) { const dialogRef = this.dialog.open(ConfirmationDialogComponent, { @@ -585,7 +596,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { if (result) { - const list= this.dmp.users; + const list = this.dmp.users; const index = this.dmp.users.indexOf(user); if (index > -1) { this.dmp.users.splice(index, 1); @@ -619,7 +630,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { } } - + // advancedClicked() {