SUPPORT-9037: fix rejection

This commit is contained in:
gulnaz 2025-03-24 17:51:41 +03:00
parent db89ec8861
commit 06ebc0b667
3 changed files with 78 additions and 9 deletions

View file

@ -4,7 +4,7 @@ import {
NotNull,
ObjectRef,
SaveButton,
TextField
TextField, Visible
} from "@webbpm/base-package";
import {HttpClient} from "@angular/common/http";
import {FormField} from "../field/FormField";
@ -21,6 +21,7 @@ export class UserManagementService extends Behavior {
private button: SaveButton;
private httpClient: HttpClient;
private onClickFunction: Function;
private sendToErvu: boolean = false;
initialize() {
super.initialize();
@ -28,7 +29,7 @@ export class UserManagementService extends Behavior {
this.httpClient = this.injector.get(HttpClient);
let authService = this.injector.get(AuthorizationService);
this.onClickFunction = () => {
if (!authService.hasRole('security_administrator')) {
if (!authService.hasRole('security_administrator') || !this.sendToErvu) {
return;
}
let jsonObj = this.collectData();
@ -57,6 +58,11 @@ export class UserManagementService extends Behavior {
}
}
@Visible()
public allowSendToErvu(): void {
this.sendToErvu = true;
}
private collectData(): any {
let jsonObj = {};
let fields: FormField[] = this.button.form.getScriptsInChildren(FormField);

View file

@ -3381,13 +3381,6 @@
</properties>
</scripts>
</children>
<children id="c64879eb-413b-4590-bccb-876139b24881">
<prototypeId>69af9ec9-d640-499a-bf05-cda6ce64a81f</prototypeId>
<componentRootId>c64879eb-413b-4590-bccb-876139b24881</componentRootId>
<name>Примечание по изменениям</name>
<container>false</container>
<removed>true</removed>
</children>
</children>
<children id="405b8a64-7843-4f9c-a96e-a65ec5afde54">
<prototypeId>69af9ec9-d640-499a-bf05-cda6ce64a81f</prototypeId>
@ -8814,6 +8807,41 @@
</value>
</entry>
</complex>
</value>
</item>
<item id="dea3a357-5874-4978-9def-254041b94a12" removed="false">
<value>
<complex>
<entry>
<key>behavior</key>
<value>
<simple>{"objectId":"dd6db966-9599-4483-9eae-12718b7f081b","packageName":"account_applications.component.button","className":"UserManagementService","type":"TS"}</simple>
</value>
</entry>
<entry>
<key>method</key>
<value>
<simple>"allowSendToErvu"</simple>
</value>
</entry>
<entry>
<key>value</key>
<value>
<complex>
<entry>
<key>staticValue</key>
<value>
<implRef type="TS">
<className>boolean</className>
<packageName></packageName>
</implRef>
<simple>true</simple>
</value>
</entry>
</complex>
</value>
</entry>
</complex>
</value>
</item>
<item id="361a327e-26a5-4319-a658-2630ebf31ea6" removed="false">

View file

@ -8362,6 +8362,41 @@
</value>
</entry>
</complex>
</value>
</item>
<item id="0879733b-dd43-420d-9aac-28a5672f7698" removed="false">
<value>
<complex>
<entry>
<key>behavior</key>
<value>
<simple>{"objectId":"dd6db966-9599-4483-9eae-12718b7f081b","packageName":"account_applications.component.button","className":"UserManagementService","type":"TS"}</simple>
</value>
</entry>
<entry>
<key>method</key>
<value>
<simple>"allowSendToErvu"</simple>
</value>
</entry>
<entry>
<key>value</key>
<value>
<complex>
<entry>
<key>staticValue</key>
<value>
<implRef type="TS">
<className>boolean</className>
<packageName></packageName>
</implRef>
<simple>true</simple>
</value>
</entry>
</complex>
</value>
</entry>
</complex>
</value>
</item>
<item id="361a327e-26a5-4319-a658-2630ebf31ea6" removed="false">