dmp&dataset overview: 'remove user from dmp' update

This commit is contained in:
gpapavgeri 2020-07-09 16:01:49 +03:00
parent 052430d97c
commit dd0f158769
2 changed files with 15 additions and 7 deletions

View File

@ -49,8 +49,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
hasDOIToken = false; hasDOIToken = false;
researchers: ResearcherModel[]; researchers: ResearcherModel[];
users: UserInfoListingModel[]; users: UserInfoListingModel[];
lockStatus = false; lockStatus: Boolean;
// lockStatus: Boolean;
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
@ -92,7 +91,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
.subscribe(data => { .subscribe(data => {
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
}); });
// this.checkLockStatus(this.dataset.id); this.checkLockStatus(this.dataset.id);
this.setIsUserOwner(); this.setIsUserOwner();
const breadCrumbs = []; const breadCrumbs = [];
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'), url: "/datasets" }); breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'), url: "/datasets" });
@ -121,7 +120,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
.subscribe(data => { .subscribe(data => {
this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data); this.datasetWizardModel = new DatasetWizardEditorModel().fromModel(data);
}); });
// this.checkLockStatus(this.dataset.id); this.checkLockStatus(this.dataset.id);
this.setIsUserOwner(); this.setIsUserOwner();
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" });
@ -158,7 +157,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
this.location.back(); this.location.back();
} }
reloadComponent(): void { reloadPage(): void {
this.router.navigateByUrl('/datasets', { skipLocationChange: true }).then(() => { this.router.navigateByUrl('/datasets', { skipLocationChange: true }).then(() => {
this.router.navigate([`/datasets/overview/${this.dataset.id}`]); this.router.navigate([`/datasets/overview/${this.dataset.id}`]);
}); });
@ -394,7 +393,7 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit {
.subscribe( .subscribe(
complete => { complete => {
this.onCallbackSuccess(); this.onCallbackSuccess();
this.reloadComponent(); this.reloadPage();
}, },
error => this.onDeleteCallbackError(error) error => this.onDeleteCallbackError(error)
); );

View File

@ -577,10 +577,19 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.location.back(); this.location.back();
} }
reloadPage(): void {
this.router.navigateByUrl('/plans', { skipLocationChange: true }).then(() => {
this.router.navigate([`/plans/overview/${this.dmp.id}`]);
});
}
updateUsers() { updateUsers() {
return this.dmpService.updateUsers(this.dmp.id, this.dmp.users).pipe(takeUntil(this._destroyed)) return this.dmpService.updateUsers(this.dmp.id, this.dmp.users).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => { this.onCallbackSuccess() }, complete => {
this.onCallbackSuccess();
this.reloadPage();
},
error => this.onDeleteCallbackError(error) error => this.onDeleteCallbackError(error)
); );
} }