front changes to match with changes on back-end previous commit

This commit is contained in:
apapachristou 2020-10-02 10:15:02 +03:00
parent 58ef4800c2
commit 716610e7c3
2 changed files with 14 additions and 14 deletions

View File

@ -66,8 +66,8 @@ export class DmpService {
return this.http.get<DmpModel>(this.actionUrl + id + '/unlock', { headers: this.headers });
}
createDmp(dataManagementPlanModel: DmpModel): Observable<String> {
return this.http.post<String>(this.actionUrl, dataManagementPlanModel, { headers: this.headers });
createDmp(dataManagementPlanModel: DmpModel): Observable<DmpModel> {
return this.http.post<DmpModel>(this.actionUrl, dataManagementPlanModel, { headers: this.headers });
}
createDmpWithDatasets(dataManagementPlanModel: DmpModel): Observable<String> {

View File

@ -400,11 +400,11 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
// this.onDatasetSubmit();
// }
// else {
if (!this.isFormValid()) {
this.showValidationErrorsDialog();
return;
}
this.onSubmit(addNew, showAddDatasetDialog);
if (!this.isFormValid()) {
this.showValidationErrorsDialog();
return;
}
this.onSubmit(addNew, showAddDatasetDialog);
// }
}
@ -477,10 +477,10 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
);
}
onCallbackSuccess(id?: String, datasetId?: string): void {
onCallbackSuccess(dmp?: DmpModel, datasetId?: string): void {
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
if (id != null) {
datasetId ? this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', id], { queryParams: { dataset: datasetId } }); }) : this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', id]); })
if (dmp.id != null) {
datasetId ? this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', dmp.id], { queryParams: { dataset: datasetId } }); }) : this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', dmp.id]); })
} else {
this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans']); });
}
@ -492,9 +492,9 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
//this.validateAllFormFields(this.formGroup);
}
onCallbackSuccessAddNew(id?: String) {
onCallbackSuccessAddNew(dmp?: DmpModel) {
// this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
this.router.navigate(['/datasets', 'new', id]);
this.router.navigate(['/datasets', 'new', dmp.id]);
}
public setErrorModel(validationErrorModel: ValidationErrorModel) {
@ -704,7 +704,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
return this.formGroup.get('profiles') && this.formGroup.get('profiles').value && this.formGroup.get('profiles').value.length > 0;
}
addDatasetOpenDialog(id: String) {
addDatasetOpenDialog(dmp: DmpModel) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
maxWidth: '500px',
restoreFocus: false,
@ -721,7 +721,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
// this.router.navigate(['datasets/new/' + id]);
this.addDataset();
} else {
id != null ? this.router.navigate(['/plans', 'edit', id]) : this.router.navigate(['/plans']);
dmp.id != null ? this.router.navigate(['/plans', 'edit', dmp.id]) : this.router.navigate(['/plans']);
}
});
}