BP 661: added protocol to user actions;removed protocol from duration actions
diff --git a/src/app/masterdata-management/components/standbygroup/standbygroup.component.ts b/src/app/masterdata-management/components/standbygroup/standbygroup.component.ts
index cc57d0a..15a801e 100644
--- a/src/app/masterdata-management/components/standbygroup/standbygroup.component.ts
+++ b/src/app/masterdata-management/components/standbygroup/standbygroup.component.ts
@@ -31,6 +31,7 @@
import { ProtocolDialogComponent } from '@schedule/dialogs/protocol-dialog/protocol-dialog.component';
import { CopyDialogComponent } from '@masterdata/selection-dialogs/copy-dialog/copy-dialog.component';
import { AuthenticationService } from '@core/services/authentication.service';
+import { ProtocolMessageObject } from '@shared/model/ProtocolMessageObject';
@Component({
@@ -310,8 +311,6 @@
FormUtil.markAsPristineAndUntouched(this.standbyDurationsForm);
this.standbyDurations = standbydurationRes.data;
this.standbyDurationsModalRef.close();
- this.modalProtocolRef = this.modalService.open(ProtocolDialogComponent, { windowClass: 'modal-xl', backdrop: 'static' });
- this.modalProtocolRef.componentInstance.protocol = standbydurationRes;
}
);
return true;
@@ -377,8 +376,11 @@
delete dataToMove[i].notes;
delete dataToMove[i].modificationDate;
}
- this.masterDataService.addStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: UserObject[]) => {
- this.moveUserAndUpdate(resUser);
+ this.masterDataService.addStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: ProtocolObject) => {
+ this.moveUserAndUpdate(resUser.data);
+ if (saveButtonLabel === 'Daten ändern' && dataToMove.length === 1) {
+ this.openProtocol(resUser);
+ }
});
}
this.userModalRef.close();
@@ -396,8 +398,8 @@
delete dataToMove[i].position;
delete dataToMove[i].id;
}
- this.masterDataService.addStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: UserObject[]) => {
- this.moveUserAndUpdate(resUser);
+ this.masterDataService.addStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: ProtocolObject) => {
+ this.moveUserAndUpdate(resUser.data);
});
}
@@ -405,8 +407,9 @@
this.userModalWarningRef = this.modalService.open(LoosingDataDialogComponent);
this.userModalWarningRef.componentInstance.decision.subscribe(resUserModal => {
if (resUserModal) {
- this.masterDataService.deleteStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: UserObject[]) => {
- this.moveUserAndUpdate(resUser);
+ this.masterDataService.deleteStandbyGroupUser(this.instanceId, dataToMove).subscribe((resUser: ProtocolObject) => {
+ this.moveUserAndUpdate(resUser.data);
+ this.openProtocol(resUser);
});
}
this.userModalWarningRef.close();
@@ -511,6 +514,13 @@
* UTIL METHODS
*/
+ openProtocol(protocolObject: ProtocolObject) {
+ if (protocolObject.lsMsg.length > 0) {
+ this.modalProtocolRef = this.modalService.open(ProtocolDialogComponent, { windowClass: 'modal-xl', backdrop: 'static' });
+ this.modalProtocolRef.componentInstance.protocol = protocolObject;
+ }
+ }
+
close() {
if (this.isModal) {
this.modalAction.next('close');
diff --git a/src/app/masterdata-management/services/masterdata.service.ts b/src/app/masterdata-management/services/masterdata.service.ts
index 02992e4..6531126 100644
--- a/src/app/masterdata-management/services/masterdata.service.ts
+++ b/src/app/masterdata-management/services/masterdata.service.ts
@@ -62,11 +62,11 @@
}
addStandbyGroupUser(id: number, userObjArray: UserObject[]) {
- return this.http.put(`${this.utilService.readConfig('basePath')}/standbygroup/${id}/user/save/list`, userObjArray);
+ return this.http.put<ProtocolObject>(`${this.utilService.readConfig('basePath')}/standbygroup/${id}/user/save/list`, userObjArray);
}
deleteStandbyGroupUser(id: number, userObjArray: UserObject[]) {
- return this.http.put<UserObject[]>(`${this.utilService.readConfig('basePath')}/standbygroup/${id}/user/delete/list`, userObjArray);
+ return this.http.put<ProtocolObject>(`${this.utilService.readConfig('basePath')}/standbygroup/${id}/user/delete/list`, userObjArray);
}
addUserRegion(id: number, regionObjArray: RegionObject[]) {
diff --git a/src/app/shared/model/ProtocolObject.ts b/src/app/shared/model/ProtocolObject.ts
index 4d82777..84bb40f 100644
--- a/src/app/shared/model/ProtocolObject.ts
+++ b/src/app/shared/model/ProtocolObject.ts
@@ -8,9 +8,8 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { ProtocolMessageObject } from '@shared/model/ProtocolMessageObject';
-import { StandbyDurationObject } from './StandbyDurationObject';
export class ProtocolObject {
lsMsg: Array<ProtocolMessageObject>;
- data?: Array<StandbyDurationObject>;
+ data?: Array<any>;
}