SUPPORT-8957: fix account action
This commit is contained in:
parent
ac46025a0c
commit
07cedf50c7
4 changed files with 34 additions and 14 deletions
|
|
@ -1,19 +1,24 @@
|
||||||
import {
|
import {
|
||||||
AnalyticalScope,
|
AnalyticalScope,
|
||||||
Behavior,
|
Behavior,
|
||||||
NotNull,
|
NotNull, ObjectRef,
|
||||||
SaveButton
|
SaveButton, TextField, Visible
|
||||||
} from "@webbpm/base-package";
|
} from "@webbpm/base-package";
|
||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import {FormField} from "../field/FormField";
|
import {FormField} from "../field/FormField";
|
||||||
import {AccountAction} from "../enum/AccountAction";
|
import {AccountAction} from "../enum/AccountAction";
|
||||||
import {AuthorizationService} from "../../../modules/app/service/authorization.service";
|
import {AuthorizationService} from "../../../modules/app/service/authorization.service";
|
||||||
|
import {ApplicationKind} from "../enum/ApplicationKind";
|
||||||
|
|
||||||
@AnalyticalScope(SaveButton)
|
@AnalyticalScope(SaveButton)
|
||||||
export class UserManagementService extends Behavior {
|
export class UserManagementService extends Behavior {
|
||||||
|
|
||||||
@NotNull()
|
@NotNull()
|
||||||
public action: AccountAction;
|
public action: AccountAction;
|
||||||
|
@Visible("action == AccountAction.EDIT")
|
||||||
|
@NotNull("action == AccountAction.EDIT")
|
||||||
|
@ObjectRef()
|
||||||
|
public applicationKind: TextField;
|
||||||
|
|
||||||
private button: SaveButton;
|
private button: SaveButton;
|
||||||
private httpClient: HttpClient;
|
private httpClient: HttpClient;
|
||||||
|
|
@ -34,14 +39,20 @@ export class UserManagementService extends Behavior {
|
||||||
case AccountAction.CREATE:
|
case AccountAction.CREATE:
|
||||||
this.doRequest("user", jsonObj);
|
this.doRequest("user", jsonObj);
|
||||||
break;
|
break;
|
||||||
case AccountAction.EDIT_PERSON:
|
case AccountAction.EDIT:
|
||||||
this.doRequest("user/person", jsonObj);
|
let kind = this.applicationKind.getValue();
|
||||||
break;
|
|
||||||
case AccountAction.EDIT_ACCOUNT:
|
switch (kind) {
|
||||||
this.doRequest("user/account", jsonObj);
|
case ApplicationKind.EDIT_USER_MAIN:
|
||||||
break;
|
this.doRequest("user/person", jsonObj);
|
||||||
case AccountAction.EDIT_ROLES:
|
break;
|
||||||
this.doRequest("user/roles", jsonObj);
|
case ApplicationKind.EDIT_USER_ACCOUNT:
|
||||||
|
this.doRequest("user/account", jsonObj);
|
||||||
|
break;
|
||||||
|
case ApplicationKind.EDIT_USER_ROLES:
|
||||||
|
this.doRequest("user/roles", jsonObj);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AccountAction.DEACTIVATE:
|
case AccountAction.DEACTIVATE:
|
||||||
this.doRequest("users/deactivation", jsonObj);
|
this.doRequest("users/deactivation", jsonObj);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
export enum AccountAction {
|
export enum AccountAction {
|
||||||
CREATE = "CREATE",
|
CREATE = "CREATE",
|
||||||
EDIT_PERSON = "EDIT_PERSON",
|
EDIT = "EDIT",
|
||||||
EDIT_ACCOUNT = "EDIT_ACCOUNT",
|
|
||||||
EDIT_ROLES = "EDIT_ROLES",
|
|
||||||
DEACTIVATE = "DEACTIVATE"
|
DEACTIVATE = "DEACTIVATE"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export enum ApplicationKind {
|
||||||
|
EDIT_USER_MAIN = "EDIT_USER_MAIN",
|
||||||
|
EDIT_USER_ACCOUNT = "EDIT_USER_ACCOUNT",
|
||||||
|
EDIT_USER_ROLES = "EDIT_USER_ROLES"
|
||||||
|
}
|
||||||
|
|
@ -7624,7 +7624,13 @@
|
||||||
<entry>
|
<entry>
|
||||||
<key>action</key>
|
<key>action</key>
|
||||||
<value>
|
<value>
|
||||||
<simple>"CREATE"</simple>
|
<simple>"EDIT"</simple>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<key>applicationKind</key>
|
||||||
|
<value>
|
||||||
|
<simple>{"objectId":"9e772048-b43f-42f1-a370-2519dd4f6ad7","packageName":"component.field","className":"TextField","type":"TS"}</simple>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue