Dataset overview update - finalize / reverse & delete comments

This commit is contained in:
gpapavgeri 2020-08-05 13:58:20 +03:00
parent 75a04a36d7
commit 5fd5ec9d63
1 changed files with 15 additions and 35 deletions

View File

@ -90,9 +90,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
this.dataset = data;
this.researchers = this.dataset.dmp.researchers;
this.users = this.dataset.dmp.users;
// this.getDmpResearchers();
// this.getDmpUsers();
// this.getDatasetWizardModel(this.dataset.id);
this.checkLockStatus(this.dataset.id);
this.setIsUserOwner();
const breadCrumbs = [];
@ -118,10 +115,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
this.dataset = data;
this.researchers = this.dataset.dmp.researchers;
this.users = this.dataset.dmp.users;
// this.getDmpResearchers();
// this.getDmpUsers();
// this.getDatasetWizardModel(this.dataset.id);
// this.checkLockStatus(this.dataset.id);
const breadCrumbs = [];
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC DATASETS'), url: "/explore" });
breadCrumbs.push({ parentComponentName: 'DatasetListingComponent', label: this.dataset.label, url: '/datasets/publicOverview/' + this.dataset.id });
@ -138,14 +131,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
});
}
getDatasetWizardModel(id: string) {
this.datasetWizardService.getSingle(id)
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.datasetWizardModel = data;
});
}
checkLockStatus(id: string) {
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
.subscribe(lockStatus => this.lockStatus = lockStatus);
@ -170,20 +155,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
this.router.navigateByUrl('/reload', { skipLocationChange: true }).then(() => this.router.navigate([path]));
}
// getDmpResearchers() {
// this.dmpService.getSingle(this.dataset.dmp.id).pipe(takeUntil(this._destroyed))
// .subscribe(data => {
// this.researchers = data.researchers;
// });
// }
// getDmpUsers() {
// this.dmpService.getSingle(this.dataset.dmp.id).pipe(takeUntil(this._destroyed))
// .subscribe(data => {
// this.users = data.users;
// });
// }
setIsUserOwner() {
if (this.dataset) {
const principal: Principal = this.authentication.current();
@ -487,14 +458,19 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.getDatasetWizardModel(this.dataset.id);
this.datasetWizardModel.status = DatasetStatus.Finalized;
this.datasetWizardService.createDataset(this.datasetWizardModel)
dataset.status = DatasetStatus.Finalized;
this.datasetWizardService.getSingle(dataset.id)
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.datasetWizardModel = data;
this.datasetWizardModel.status = DatasetStatus.Finalized;
this.datasetWizardService.createDataset(this.datasetWizardModel)
.pipe(takeUntil(this._destroyed))
.subscribe(
data => this.onUpdateCallbackSuccess(),
error => this.onUpdateCallbackError(error)
);
});
}
});
}
@ -515,14 +491,18 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.getDatasetWizardModel(this.dataset.id);
this.datasetWizardModel.status = DatasetStatus.Draft;
this.datasetWizardService.createDataset(this.datasetWizardModel)
this.datasetWizardService.getSingle(dataset.id)
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.datasetWizardModel = data;
this.datasetWizardModel.status = DatasetStatus.Draft;
this.datasetWizardService.createDataset(this.datasetWizardModel)
.pipe(takeUntil(this._destroyed))
.subscribe(
data => this.onUpdateCallbackSuccess(),
error => this.onUpdateCallbackError(error)
);
});
}
});
}