dmp delete
This commit is contained in:
parent
18a6c7cc85
commit
b3bf19be0b
|
@ -88,7 +88,7 @@
|
||||||
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
|
||||||
<!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
|
<!-- <button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button> -->
|
||||||
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
|
||||||
<button *ngIf="!isNew" mat-raised-button color="primary" type="button" (click)="openConfirm(formGroup.get('label').value)">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
<button *ngIf="!isNew" mat-raised-button color="primary" type="button" (click)="openConfirm(formGroup.get('label').value, formGroup.get('id').value)">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
|
@ -225,7 +225,7 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
openConfirm(dmpLabel): void {
|
openConfirm(dmpLabel, id): void {
|
||||||
this._dialogService.openConfirm({
|
this._dialogService.openConfirm({
|
||||||
message: 'Are you sure you want to delete the "' + dmpLabel +'"',
|
message: 'Are you sure you want to delete the "' + dmpLabel +'"',
|
||||||
disableClose: true || false, // defaults to false
|
disableClose: true || false, // defaults to false
|
||||||
|
@ -236,7 +236,9 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
|
||||||
// width: '500px', //OPTIONAL, defaults to 400px
|
// width: '500px', //OPTIONAL, defaults to 400px
|
||||||
}).afterClosed().subscribe((accept: boolean) => {
|
}).afterClosed().subscribe((accept: boolean) => {
|
||||||
if (accept) {
|
if (accept) {
|
||||||
// DO SOMETHING
|
this.dataManagementPlanService.delete(id).subscribe(()=>{
|
||||||
|
this.router.navigate(['/dmps'])
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// DO SOMETHING ELSE
|
// DO SOMETHING ELSE
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,4 +52,8 @@ export class DataManagementPlanService {
|
||||||
createDataManagementPlanClone(dataManagementPlanModel: DataManagementPlanModel, id:String): Observable<DataManagementPlanModel> {
|
createDataManagementPlanClone(dataManagementPlanModel: DataManagementPlanModel, id:String): Observable<DataManagementPlanModel> {
|
||||||
return this.http.post<DataManagementPlanModel>(this.actionUrl + 'clone/' + id , dataManagementPlanModel, { headers: this.headers });
|
return this.http.post<DataManagementPlanModel>(this.actionUrl + 'clone/' + id , dataManagementPlanModel, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete(id: String): Observable<DataManagementPlanModel> {
|
||||||
|
return this.http.delete<DataManagementPlanModel>(this.actionUrl + 'delete/' + id, { headers: this.headers });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue