@masterteam/users-groups 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterteam/users-groups",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"directory": "../../../dist/masterteam/users-groups",
|
|
6
6
|
"linkDirectory": false,
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"tailwindcss": "^4.2.2",
|
|
21
21
|
"tailwindcss-primeui": "^0.6.1",
|
|
22
22
|
"@ngxs/store": "^20.1.0",
|
|
23
|
-
"@masterteam/
|
|
24
|
-
"@masterteam/
|
|
25
|
-
"@masterteam/
|
|
23
|
+
"@masterteam/icons": "^0.0.15",
|
|
24
|
+
"@masterteam/components": "^0.0.165",
|
|
25
|
+
"@masterteam/forms": "^0.0.74"
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"exports": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
3
3
|
import * as rxjs from 'rxjs';
|
|
4
|
+
import * as _masterteam_users_groups from '@masterteam/users-groups';
|
|
4
5
|
import { TranslocoService } from '@jsverse/transloco';
|
|
5
6
|
import { PageHeaderTab } from '@masterteam/components/page-header';
|
|
6
|
-
import * as _masterteam_users_groups from '@masterteam/users-groups';
|
|
7
7
|
import { TableAction, ColumnDef } from '@masterteam/components/table';
|
|
8
8
|
import { ModalService } from '@masterteam/components/modal';
|
|
9
9
|
import { FormControl } from '@angular/forms';
|
|
@@ -30,6 +30,7 @@ interface User {
|
|
|
30
30
|
mobile?: string;
|
|
31
31
|
ext?: number;
|
|
32
32
|
isExternal?: boolean;
|
|
33
|
+
isLinkedToCurrentApplication?: boolean;
|
|
33
34
|
email?: string;
|
|
34
35
|
}
|
|
35
36
|
interface Group {
|
|
@@ -43,6 +44,46 @@ interface Group {
|
|
|
43
44
|
isActivated?: boolean;
|
|
44
45
|
applicationId?: number;
|
|
45
46
|
}
|
|
47
|
+
interface Role {
|
|
48
|
+
id: string;
|
|
49
|
+
key?: string;
|
|
50
|
+
name?: TranslatedField | string;
|
|
51
|
+
moduleId?: number;
|
|
52
|
+
moduleType?: string;
|
|
53
|
+
sourceId?: number;
|
|
54
|
+
applicationId?: number;
|
|
55
|
+
extraInfo?: any[];
|
|
56
|
+
}
|
|
57
|
+
interface Permission {
|
|
58
|
+
id: number;
|
|
59
|
+
name?: string | TranslatedField;
|
|
60
|
+
moduleId?: number;
|
|
61
|
+
applicationId?: number;
|
|
62
|
+
moduleType?: string;
|
|
63
|
+
command?: string;
|
|
64
|
+
}
|
|
65
|
+
interface Accessibility {
|
|
66
|
+
id: number;
|
|
67
|
+
moduleKey?: string;
|
|
68
|
+
moduleName?: TranslatedField | string;
|
|
69
|
+
category?: string;
|
|
70
|
+
name?: TranslatedField | string;
|
|
71
|
+
enableMFACheck?: boolean;
|
|
72
|
+
createdAt?: ApiDateValue;
|
|
73
|
+
applicationId?: number;
|
|
74
|
+
groups?: any[];
|
|
75
|
+
}
|
|
76
|
+
interface UserSummary {
|
|
77
|
+
user?: User | null;
|
|
78
|
+
groups: Group[];
|
|
79
|
+
roles: Role[];
|
|
80
|
+
permissions: Permission[];
|
|
81
|
+
accessibilities: Accessibility[];
|
|
82
|
+
groupsCount?: number;
|
|
83
|
+
rolesCount?: number;
|
|
84
|
+
permissionsCount?: number;
|
|
85
|
+
accessibilitiesCount?: number;
|
|
86
|
+
}
|
|
46
87
|
interface TranslatedField {
|
|
47
88
|
display?: string;
|
|
48
89
|
en?: string;
|
|
@@ -58,6 +99,8 @@ declare enum UsersGroupsActionKey {
|
|
|
58
99
|
CreateUser = "createUser",
|
|
59
100
|
UpdateUser = "updateUser",
|
|
60
101
|
DeleteUser = "deleteUser",
|
|
102
|
+
LinkUserToApplication = "linkUserToApplication",
|
|
103
|
+
GetUserSummary = "getUserSummary",
|
|
61
104
|
AddUserToGroup = "addUserToGroup",
|
|
62
105
|
DeleteUserFromGroup = "deleteUserFromGroup",
|
|
63
106
|
GetGroups = "getGroups",
|
|
@@ -70,6 +113,7 @@ declare enum UsersGroupsActionKey {
|
|
|
70
113
|
interface UsersGroupsStateModel extends LoadingStateShape<UsersGroupsActionKey> {
|
|
71
114
|
users: User[];
|
|
72
115
|
selectedUser: User | null;
|
|
116
|
+
userSummary: UserSummary | null;
|
|
73
117
|
groups: Group[];
|
|
74
118
|
selectedGroup: Group | null;
|
|
75
119
|
}
|
|
@@ -113,6 +157,16 @@ declare class DeleteUser {
|
|
|
113
157
|
static readonly type = "[UsersGroups] Delete User";
|
|
114
158
|
constructor(userName: string | number);
|
|
115
159
|
}
|
|
160
|
+
declare class LinkUserToApplication {
|
|
161
|
+
userName: string | number;
|
|
162
|
+
static readonly type = "[UsersGroups] Link User To Application";
|
|
163
|
+
constructor(userName: string | number);
|
|
164
|
+
}
|
|
165
|
+
declare class GetUserSummary {
|
|
166
|
+
userName: string;
|
|
167
|
+
static readonly type = "[UsersGroups] Get User Summary";
|
|
168
|
+
constructor(userName: string);
|
|
169
|
+
}
|
|
116
170
|
declare class ResetUserPassword {
|
|
117
171
|
id: string | number;
|
|
118
172
|
payload: ResetUserPasswordPayload;
|
|
@@ -156,6 +210,7 @@ declare class UsersGroupsFacade {
|
|
|
156
210
|
private readonly store;
|
|
157
211
|
readonly users: _angular_core.Signal<User[]>;
|
|
158
212
|
readonly selectedUser: _angular_core.Signal<User | null>;
|
|
213
|
+
readonly userSummary: _angular_core.Signal<_masterteam_users_groups.UserSummary | null>;
|
|
159
214
|
readonly groups: _angular_core.Signal<Group[]>;
|
|
160
215
|
readonly selectedGroup: _angular_core.Signal<Group | null>;
|
|
161
216
|
private readonly loadingActive;
|
|
@@ -163,6 +218,8 @@ declare class UsersGroupsFacade {
|
|
|
163
218
|
readonly isLoadingUser: _angular_core.Signal<boolean>;
|
|
164
219
|
readonly isSavingUser: _angular_core.Signal<boolean>;
|
|
165
220
|
readonly isDeletingUser: _angular_core.Signal<boolean>;
|
|
221
|
+
readonly isLinkingUserToApplication: _angular_core.Signal<boolean>;
|
|
222
|
+
readonly isLoadingUserSummary: _angular_core.Signal<boolean>;
|
|
166
223
|
readonly isLoadingGroups: _angular_core.Signal<boolean>;
|
|
167
224
|
readonly isLoadingGroup: _angular_core.Signal<boolean>;
|
|
168
225
|
readonly isSavingGroup: _angular_core.Signal<boolean>;
|
|
@@ -177,6 +234,8 @@ declare class UsersGroupsFacade {
|
|
|
177
234
|
deleteUserFromGroup(payload: any): rxjs.Observable<void>;
|
|
178
235
|
updateUser(id: string | undefined, changes: Partial<User>): rxjs.Observable<void>;
|
|
179
236
|
deleteUser(userName: string | number): rxjs.Observable<void>;
|
|
237
|
+
linkUserToApplication(userName: string | number): rxjs.Observable<void>;
|
|
238
|
+
getUserSummary(userName: string): rxjs.Observable<void>;
|
|
180
239
|
resetUserPassword(id: string | number, payload: ResetUserPasswordPayload): rxjs.Observable<void>;
|
|
181
240
|
getGroups(): rxjs.Observable<void>;
|
|
182
241
|
getGroup(id: string | number | null): rxjs.Observable<void>;
|
|
@@ -202,8 +261,10 @@ interface Response<T> {
|
|
|
202
261
|
declare class UsersGroupsState extends CrudStateBase<any, UsersGroupsStateModel, UsersGroupsActionKey> {
|
|
203
262
|
private http;
|
|
204
263
|
context: HttpContext;
|
|
264
|
+
private encodeUserName;
|
|
205
265
|
static getUsers(state: UsersGroupsStateModel): User[];
|
|
206
266
|
static getSelectedUser(state: UsersGroupsStateModel): User | null;
|
|
267
|
+
static getUserSummary(state: UsersGroupsStateModel): UserSummary | null;
|
|
207
268
|
static getGroups(state: UsersGroupsStateModel): Group[];
|
|
208
269
|
static getSelectedGroup(state: UsersGroupsStateModel): Group | null;
|
|
209
270
|
static getLoadingActive(state: UsersGroupsStateModel): string[];
|
|
@@ -213,7 +274,9 @@ declare class UsersGroupsState extends CrudStateBase<any, UsersGroupsStateModel,
|
|
|
213
274
|
createUser(ctx: StateContext<UsersGroupsStateModel>, { payload }: CreateUser): rxjs.Observable<Response<User>>;
|
|
214
275
|
addUserToGroup(ctx: StateContext<UsersGroupsStateModel>, { payload }: AddUserToGroup): rxjs.Observable<Response<any>>;
|
|
215
276
|
updateUser(ctx: StateContext<UsersGroupsStateModel>, { changes, id }: UpdateUser): rxjs.Observable<Response<User>>;
|
|
216
|
-
deleteUser(ctx: StateContext<UsersGroupsStateModel>, { userName }: DeleteUser): rxjs.Observable<
|
|
277
|
+
deleteUser(ctx: StateContext<UsersGroupsStateModel>, { userName }: DeleteUser): rxjs.Observable<Response<void>>;
|
|
278
|
+
linkUserToApplication(ctx: StateContext<UsersGroupsStateModel>, { userName }: LinkUserToApplication): rxjs.Observable<Response<User | null>>;
|
|
279
|
+
getUserSummary(ctx: StateContext<UsersGroupsStateModel>, { userName }: GetUserSummary): rxjs.Observable<Response<UserSummary>>;
|
|
217
280
|
resetUserPassword(ctx: StateContext<UsersGroupsStateModel>, { id, payload }: ResetUserPassword): rxjs.Observable<Response<void>>;
|
|
218
281
|
deleteUserFromGroup(ctx: StateContext<UsersGroupsStateModel>, { payload }: DeleteUserFromGroup): rxjs.Observable<Response<void>>;
|
|
219
282
|
getGroups(ctx: StateContext<UsersGroupsStateModel>): rxjs.Observable<Response<Group[]>>;
|
|
@@ -249,6 +312,7 @@ declare class UsersGroups implements OnInit {
|
|
|
249
312
|
declare class Users implements OnInit {
|
|
250
313
|
typeCol: _angular_core.Signal<TemplateRef<any>>;
|
|
251
314
|
userCol: _angular_core.Signal<TemplateRef<any>>;
|
|
315
|
+
applicationLinkCol: _angular_core.Signal<TemplateRef<any>>;
|
|
252
316
|
private readonly facade;
|
|
253
317
|
readonly modal: ModalService;
|
|
254
318
|
private readonly translocoService;
|
|
@@ -260,13 +324,18 @@ declare class Users implements OnInit {
|
|
|
260
324
|
activeTab: _angular_core.WritableSignal<string>;
|
|
261
325
|
tableActions: _angular_core.WritableSignal<TableAction[]>;
|
|
262
326
|
deletingRowIds: _angular_core.WritableSignal<any[]>;
|
|
327
|
+
linkingRowIds: _angular_core.WritableSignal<any[]>;
|
|
263
328
|
rowActions: _angular_core.WritableSignal<TableAction[]>;
|
|
264
329
|
tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
|
|
265
330
|
loading: _angular_core.Signal<boolean>;
|
|
266
331
|
private allUsers;
|
|
267
332
|
ngOnInit(): void;
|
|
333
|
+
isLinkedToCurrentApplication(user: any): boolean;
|
|
334
|
+
linkUserToApplication(user: any): void;
|
|
335
|
+
unlinkUserFromApplication(user: any): void;
|
|
268
336
|
addUserDialog(user?: any | null): void;
|
|
269
337
|
addResetPasswordDialog(user: any): void;
|
|
338
|
+
openLinkedGroupsDialog(user: any): void;
|
|
270
339
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Users, never>;
|
|
271
340
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Users, "mt-users", never, {}, {}, never, never, true, never>;
|
|
272
341
|
}
|
|
@@ -354,5 +423,5 @@ declare class GroupForm implements OnInit {
|
|
|
354
423
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<GroupForm, "mt-group-form", never, { "groupForEdit": { "alias": "groupForEdit"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
355
424
|
}
|
|
356
425
|
|
|
357
|
-
export { AddUserToGroup, ClearSelectedGroup, CreateGroup, CreateUser, DeleteGroup, DeleteUser, DeleteUserFromGroup, GetGroup, GetGroups, GetUser, GetUsers, GroupForm, Groups, ResetUserPassword, UpdateGroup, UpdateUser, UserForm, Users, UsersGroups, UsersGroupsActionKey, UsersGroupsFacade, UsersGroupsState };
|
|
358
|
-
export type { ApiDateValue, Group, ResetUserPasswordPayload, TranslatedField, User, UsersGroupsStateModel };
|
|
426
|
+
export { AddUserToGroup, ClearSelectedGroup, CreateGroup, CreateUser, DeleteGroup, DeleteUser, DeleteUserFromGroup, GetGroup, GetGroups, GetUser, GetUserSummary, GetUsers, GroupForm, Groups, LinkUserToApplication, ResetUserPassword, UpdateGroup, UpdateUser, UserForm, Users, UsersGroups, UsersGroupsActionKey, UsersGroupsFacade, UsersGroupsState };
|
|
427
|
+
export type { Accessibility, ApiDateValue, Group, Permission, ResetUserPasswordPayload, Role, TranslatedField, User, UserSummary, UsersGroupsStateModel };
|