Dataset overview update - finalize / reverse & delete comments
This commit is contained in:
parent
75a04a36d7
commit
5fd5ec9d63
|
@ -90,9 +90,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.dataset = data;
|
this.dataset = data;
|
||||||
this.researchers = this.dataset.dmp.researchers;
|
this.researchers = this.dataset.dmp.researchers;
|
||||||
this.users = this.dataset.dmp.users;
|
this.users = this.dataset.dmp.users;
|
||||||
// this.getDmpResearchers();
|
|
||||||
// this.getDmpUsers();
|
|
||||||
// this.getDatasetWizardModel(this.dataset.id);
|
|
||||||
this.checkLockStatus(this.dataset.id);
|
this.checkLockStatus(this.dataset.id);
|
||||||
this.setIsUserOwner();
|
this.setIsUserOwner();
|
||||||
const breadCrumbs = [];
|
const breadCrumbs = [];
|
||||||
|
@ -118,10 +115,6 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
|
||||||
this.dataset = data;
|
this.dataset = data;
|
||||||
this.researchers = this.dataset.dmp.researchers;
|
this.researchers = this.dataset.dmp.researchers;
|
||||||
this.users = this.dataset.dmp.users;
|
this.users = this.dataset.dmp.users;
|
||||||
// this.getDmpResearchers();
|
|
||||||
// this.getDmpUsers();
|
|
||||||
// this.getDatasetWizardModel(this.dataset.id);
|
|
||||||
// this.checkLockStatus(this.dataset.id);
|
|
||||||
const breadCrumbs = [];
|
const breadCrumbs = [];
|
||||||
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC DATASETS'), url: "/explore" });
|
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 });
|
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) {
|
checkLockStatus(id: string) {
|
||||||
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
|
this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(lockStatus => this.lockStatus = lockStatus);
|
.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]));
|
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() {
|
setIsUserOwner() {
|
||||||
if (this.dataset) {
|
if (this.dataset) {
|
||||||
const principal: Principal = this.authentication.current();
|
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 => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.getDatasetWizardModel(this.dataset.id);
|
dataset.status = DatasetStatus.Finalized;
|
||||||
this.datasetWizardModel.status = DatasetStatus.Finalized;
|
this.datasetWizardService.getSingle(dataset.id)
|
||||||
this.datasetWizardService.createDataset(this.datasetWizardModel)
|
.pipe(takeUntil(this._destroyed))
|
||||||
|
.subscribe(data => {
|
||||||
|
this.datasetWizardModel = data;
|
||||||
|
this.datasetWizardModel.status = DatasetStatus.Finalized;
|
||||||
|
this.datasetWizardService.createDataset(this.datasetWizardModel)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => this.onUpdateCallbackSuccess(),
|
data => this.onUpdateCallbackSuccess(),
|
||||||
error => this.onUpdateCallbackError(error)
|
error => this.onUpdateCallbackError(error)
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -515,14 +491,18 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.getDatasetWizardModel(this.dataset.id);
|
this.datasetWizardService.getSingle(dataset.id)
|
||||||
this.datasetWizardModel.status = DatasetStatus.Draft;
|
.pipe(takeUntil(this._destroyed))
|
||||||
this.datasetWizardService.createDataset(this.datasetWizardModel)
|
.subscribe(data => {
|
||||||
|
this.datasetWizardModel = data;
|
||||||
|
this.datasetWizardModel.status = DatasetStatus.Draft;
|
||||||
|
this.datasetWizardService.createDataset(this.datasetWizardModel)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => this.onUpdateCallbackSuccess(),
|
data => this.onUpdateCallbackSuccess(),
|
||||||
error => this.onUpdateCallbackError(error)
|
error => this.onUpdateCallbackError(error)
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue