@masterteam/users-groups 0.0.15 → 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.
|
@@ -64,6 +64,13 @@ class DeleteUser {
|
|
|
64
64
|
this.userName = userName;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
class LinkUserToApplication {
|
|
68
|
+
userName;
|
|
69
|
+
static type = '[UsersGroups] Link User To Application';
|
|
70
|
+
constructor(userName) {
|
|
71
|
+
this.userName = userName;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
67
74
|
class GetUserSummary {
|
|
68
75
|
userName;
|
|
69
76
|
static type = '[UsersGroups] Get User Summary';
|
|
@@ -131,6 +138,7 @@ var UsersGroupsActionKey;
|
|
|
131
138
|
UsersGroupsActionKey["CreateUser"] = "createUser";
|
|
132
139
|
UsersGroupsActionKey["UpdateUser"] = "updateUser";
|
|
133
140
|
UsersGroupsActionKey["DeleteUser"] = "deleteUser";
|
|
141
|
+
UsersGroupsActionKey["LinkUserToApplication"] = "linkUserToApplication";
|
|
134
142
|
UsersGroupsActionKey["GetUserSummary"] = "getUserSummary";
|
|
135
143
|
UsersGroupsActionKey["AddUserToGroup"] = "addUserToGroup";
|
|
136
144
|
UsersGroupsActionKey["DeleteUserFromGroup"] = "deleteUserFromGroup";
|
|
@@ -153,6 +161,9 @@ let UsersGroupsState = class UsersGroupsState extends CrudStateBase {
|
|
|
153
161
|
context = new HttpContext().set(REQUEST_CONTEXT, {
|
|
154
162
|
useBaseUrl: false,
|
|
155
163
|
});
|
|
164
|
+
encodeUserName(userName) {
|
|
165
|
+
return encodeURIComponent(String(userName));
|
|
166
|
+
}
|
|
156
167
|
// ============================================================================
|
|
157
168
|
// Data Selectors - Individual selectors for fine-grained reactivity
|
|
158
169
|
// ============================================================================
|
|
@@ -197,7 +208,8 @@ let UsersGroupsState = class UsersGroupsState extends CrudStateBase {
|
|
|
197
208
|
});
|
|
198
209
|
}
|
|
199
210
|
getUser(ctx, { userName }) {
|
|
200
|
-
const
|
|
211
|
+
const encodedUserName = this.encodeUserName(userName ?? '');
|
|
212
|
+
const req$ = this.http.get(`Identity/users/${encodedUserName}?editMode=true`, { context: this.context });
|
|
201
213
|
return handleApiRequest({
|
|
202
214
|
ctx,
|
|
203
215
|
key: UsersGroupsActionKey.GetUser,
|
|
@@ -250,7 +262,8 @@ let UsersGroupsState = class UsersGroupsState extends CrudStateBase {
|
|
|
250
262
|
});
|
|
251
263
|
}
|
|
252
264
|
updateUser(ctx, { changes, id }) {
|
|
253
|
-
const
|
|
265
|
+
const encodedUserName = this.encodeUserName(id ?? '');
|
|
266
|
+
const req$ = this.http.put(`Identity/users/${encodedUserName}`, changes, {
|
|
254
267
|
context: this.context,
|
|
255
268
|
});
|
|
256
269
|
return handleApiRequest({
|
|
@@ -272,19 +285,46 @@ let UsersGroupsState = class UsersGroupsState extends CrudStateBase {
|
|
|
272
285
|
});
|
|
273
286
|
}
|
|
274
287
|
deleteUser(ctx, { userName }) {
|
|
275
|
-
const
|
|
288
|
+
const encodedUserName = this.encodeUserName(userName);
|
|
289
|
+
const userNameKey = String(userName);
|
|
290
|
+
const req$ = this.http.delete(`Identity/users/${encodedUserName}`, {
|
|
276
291
|
context: this.context,
|
|
277
292
|
});
|
|
278
|
-
return
|
|
293
|
+
return handleApiRequest({
|
|
294
|
+
ctx,
|
|
279
295
|
key: UsersGroupsActionKey.DeleteUser,
|
|
280
296
|
request$: req$,
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
297
|
+
onSuccess: (_response, state) => ({
|
|
298
|
+
users: this.adapter.updateOne(state.users, userNameKey, { isLinkedToCurrentApplication: false }, 'userName'),
|
|
299
|
+
}),
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
linkUserToApplication(ctx, { userName }) {
|
|
303
|
+
const encodedUserName = this.encodeUserName(userName);
|
|
304
|
+
const userNameKey = String(userName);
|
|
305
|
+
const req$ = this.http.put(`Identity/users/${encodedUserName}/application/link`, {}, {
|
|
306
|
+
context: this.context,
|
|
307
|
+
});
|
|
308
|
+
return handleApiRequest({
|
|
309
|
+
ctx,
|
|
310
|
+
key: UsersGroupsActionKey.LinkUserToApplication,
|
|
311
|
+
request$: req$,
|
|
312
|
+
onSuccess: (response, state) => {
|
|
313
|
+
const linkedUser = {
|
|
314
|
+
...(state.users.find((user) => user.userName === userNameKey) ?? {}),
|
|
315
|
+
...(response.data ?? {}),
|
|
316
|
+
userName: userNameKey,
|
|
317
|
+
isLinkedToCurrentApplication: true,
|
|
318
|
+
};
|
|
319
|
+
return {
|
|
320
|
+
users: this.adapter.upsertOne(state.users, linkedUser, 'userName'),
|
|
321
|
+
};
|
|
322
|
+
},
|
|
284
323
|
});
|
|
285
324
|
}
|
|
286
325
|
getUserSummary(ctx, { userName }) {
|
|
287
|
-
const
|
|
326
|
+
const encodedUserName = this.encodeUserName(userName);
|
|
327
|
+
const req$ = this.http.get(`identity/users/${encodedUserName}/summary`, { context: this.context });
|
|
288
328
|
return handleApiRequest({
|
|
289
329
|
ctx,
|
|
290
330
|
key: UsersGroupsActionKey.GetUserSummary,
|
|
@@ -295,7 +335,8 @@ let UsersGroupsState = class UsersGroupsState extends CrudStateBase {
|
|
|
295
335
|
});
|
|
296
336
|
}
|
|
297
337
|
resetUserPassword(ctx, { id, payload }) {
|
|
298
|
-
const
|
|
338
|
+
const encodedUserName = this.encodeUserName(id);
|
|
339
|
+
const req$ = this.http.put(`Identity/users/${encodedUserName}/password/reset`, payload, {
|
|
299
340
|
context: this.context,
|
|
300
341
|
});
|
|
301
342
|
return handleApiRequest({
|
|
@@ -417,6 +458,9 @@ __decorate([
|
|
|
417
458
|
__decorate([
|
|
418
459
|
Action(DeleteUser)
|
|
419
460
|
], UsersGroupsState.prototype, "deleteUser", null);
|
|
461
|
+
__decorate([
|
|
462
|
+
Action(LinkUserToApplication)
|
|
463
|
+
], UsersGroupsState.prototype, "linkUserToApplication", null);
|
|
420
464
|
__decorate([
|
|
421
465
|
Action(GetUserSummary)
|
|
422
466
|
], UsersGroupsState.prototype, "getUserSummary", null);
|
|
@@ -481,7 +525,7 @@ UsersGroupsState = __decorate([
|
|
|
481
525
|
], UsersGroupsState);
|
|
482
526
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: UsersGroupsState, decorators: [{
|
|
483
527
|
type: Injectable
|
|
484
|
-
}], propDecorators: { getUsers: [], getUser: [], createUser: [], addUserToGroup: [], updateUser: [], deleteUser: [], getUserSummary: [], resetUserPassword: [], deleteUserFromGroup: [], getGroups: [], getGroup: [], createGroup: [], updateGroup: [], deleteGroup: [], clearSelectedGroup: [] } });
|
|
528
|
+
}], propDecorators: { getUsers: [], getUser: [], createUser: [], addUserToGroup: [], updateUser: [], deleteUser: [], linkUserToApplication: [], getUserSummary: [], resetUserPassword: [], deleteUserFromGroup: [], getGroups: [], getGroup: [], createGroup: [], updateGroup: [], deleteGroup: [], clearSelectedGroup: [] } });
|
|
485
529
|
|
|
486
530
|
class UsersGroupsFacade {
|
|
487
531
|
store = inject(Store);
|
|
@@ -505,6 +549,7 @@ class UsersGroupsFacade {
|
|
|
505
549
|
isSavingUser = computed(() => this.loadingActive().includes(UsersGroupsActionKey.CreateUser) ||
|
|
506
550
|
this.loadingActive().includes(UsersGroupsActionKey.UpdateUser), ...(ngDevMode ? [{ debugName: "isSavingUser" }] : /* istanbul ignore next */ []));
|
|
507
551
|
isDeletingUser = computed(() => this.loadingActive().includes(UsersGroupsActionKey.DeleteUser), ...(ngDevMode ? [{ debugName: "isDeletingUser" }] : /* istanbul ignore next */ []));
|
|
552
|
+
isLinkingUserToApplication = computed(() => this.loadingActive().includes(UsersGroupsActionKey.LinkUserToApplication), ...(ngDevMode ? [{ debugName: "isLinkingUserToApplication" }] : /* istanbul ignore next */ []));
|
|
508
553
|
isLoadingUserSummary = computed(() => this.loadingActive().includes(UsersGroupsActionKey.GetUserSummary), ...(ngDevMode ? [{ debugName: "isLoadingUserSummary" }] : /* istanbul ignore next */ []));
|
|
509
554
|
isLoadingGroups = computed(() => this.loadingActive().includes(UsersGroupsActionKey.GetGroups), ...(ngDevMode ? [{ debugName: "isLoadingGroups" }] : /* istanbul ignore next */ []));
|
|
510
555
|
isLoadingGroup = computed(() => this.loadingActive().includes(UsersGroupsActionKey.GetGroup), ...(ngDevMode ? [{ debugName: "isLoadingGroup" }] : /* istanbul ignore next */ []));
|
|
@@ -538,6 +583,9 @@ class UsersGroupsFacade {
|
|
|
538
583
|
deleteUser(userName) {
|
|
539
584
|
return this.store.dispatch(new DeleteUser(userName));
|
|
540
585
|
}
|
|
586
|
+
linkUserToApplication(userName) {
|
|
587
|
+
return this.store.dispatch(new LinkUserToApplication(userName));
|
|
588
|
+
}
|
|
541
589
|
getUserSummary(userName) {
|
|
542
590
|
return this.store.dispatch(new GetUserSummary(userName));
|
|
543
591
|
}
|
|
@@ -913,6 +961,21 @@ class ResetPasswordForm {
|
|
|
913
961
|
ValidatorConfig.pattern(this.passwordPattern, this.translocoService.translate('users-groups.password-rules')),
|
|
914
962
|
],
|
|
915
963
|
},
|
|
964
|
+
{
|
|
965
|
+
key: 'confirmPassword',
|
|
966
|
+
inputType: 'password',
|
|
967
|
+
label: this.translocoService.translate('users-groups.confirm-password'),
|
|
968
|
+
placeholder: this.translocoService.translate('users-groups.confirm-password'),
|
|
969
|
+
hint: this.translocoService.translate('users-groups.password-rules'),
|
|
970
|
+
validators: [
|
|
971
|
+
ValidatorConfig.required(),
|
|
972
|
+
ValidatorConfig.pattern(this.passwordPattern, this.translocoService.translate('users-groups.password-rules')),
|
|
973
|
+
ValidatorConfig.custom((value, control) => {
|
|
974
|
+
const newPassword = control?.parent?.get('newPassword')?.value;
|
|
975
|
+
return !value || !newPassword || value === newPassword;
|
|
976
|
+
}, this.translocoService.translate('users-groups.passwords-must-match')),
|
|
977
|
+
],
|
|
978
|
+
},
|
|
916
979
|
],
|
|
917
980
|
},
|
|
918
981
|
],
|
|
@@ -921,6 +984,7 @@ class ResetPasswordForm {
|
|
|
921
984
|
this.resetPasswordFormControl.setValue({
|
|
922
985
|
displayName: this.user()?.displayName || '',
|
|
923
986
|
newPassword: '',
|
|
987
|
+
confirmPassword: '',
|
|
924
988
|
});
|
|
925
989
|
}
|
|
926
990
|
onSubmit() {
|
|
@@ -1080,6 +1144,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1080
1144
|
class Users {
|
|
1081
1145
|
typeCol = viewChild.required('typeCol');
|
|
1082
1146
|
userCol = viewChild.required('userCol');
|
|
1147
|
+
applicationLinkCol = viewChild.required('applicationLinkCol');
|
|
1083
1148
|
facade = inject(UsersGroupsFacade);
|
|
1084
1149
|
modal = inject(ModalService);
|
|
1085
1150
|
translocoService = inject(TranslocoService);
|
|
@@ -1091,6 +1156,8 @@ class Users {
|
|
|
1091
1156
|
return all.filter((user) => !user.isExternal);
|
|
1092
1157
|
case 'external':
|
|
1093
1158
|
return all.filter((user) => user.isExternal);
|
|
1159
|
+
case 'notLinked':
|
|
1160
|
+
return all.filter((user) => !this.isLinkedToCurrentApplication(user));
|
|
1094
1161
|
case 'all':
|
|
1095
1162
|
default:
|
|
1096
1163
|
return all;
|
|
@@ -1109,6 +1176,10 @@ class Users {
|
|
|
1109
1176
|
label: this.translocoService.translate('users-groups.external'),
|
|
1110
1177
|
value: 'external',
|
|
1111
1178
|
},
|
|
1179
|
+
{
|
|
1180
|
+
label: this.translocoService.translate('users-groups.not-linked'),
|
|
1181
|
+
value: 'notLinked',
|
|
1182
|
+
},
|
|
1112
1183
|
], ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
1113
1184
|
activeTab = signal('all', ...(ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []));
|
|
1114
1185
|
tableActions = signal([
|
|
@@ -1122,6 +1193,7 @@ class Users {
|
|
|
1122
1193
|
},
|
|
1123
1194
|
], ...(ngDevMode ? [{ debugName: "tableActions" }] : /* istanbul ignore next */ []));
|
|
1124
1195
|
deletingRowIds = signal([], ...(ngDevMode ? [{ debugName: "deletingRowIds" }] : /* istanbul ignore next */ []));
|
|
1196
|
+
linkingRowIds = signal([], ...(ngDevMode ? [{ debugName: "linkingRowIds" }] : /* istanbul ignore next */ []));
|
|
1125
1197
|
rowActions = signal([
|
|
1126
1198
|
{
|
|
1127
1199
|
icon: 'general.link-01',
|
|
@@ -1130,6 +1202,7 @@ class Users {
|
|
|
1130
1202
|
action: (row) => {
|
|
1131
1203
|
this.openLinkedGroupsDialog(row);
|
|
1132
1204
|
},
|
|
1205
|
+
hidden: (row) => !this.isLinkedToCurrentApplication(row),
|
|
1133
1206
|
},
|
|
1134
1207
|
{
|
|
1135
1208
|
icon: 'security.key-01',
|
|
@@ -1138,7 +1211,7 @@ class Users {
|
|
|
1138
1211
|
action: (row) => {
|
|
1139
1212
|
this.addResetPasswordDialog(row);
|
|
1140
1213
|
},
|
|
1141
|
-
hidden: (row) => !row.isExternal,
|
|
1214
|
+
hidden: (row) => !row.isExternal || !this.isLinkedToCurrentApplication(row),
|
|
1142
1215
|
},
|
|
1143
1216
|
{
|
|
1144
1217
|
icon: 'custom.pencil',
|
|
@@ -1147,25 +1220,49 @@ class Users {
|
|
|
1147
1220
|
action: (row) => {
|
|
1148
1221
|
this.addUserDialog(row);
|
|
1149
1222
|
},
|
|
1150
|
-
hidden: (row) => !row.isExternal,
|
|
1223
|
+
hidden: (row) => !row.isExternal || !this.isLinkedToCurrentApplication(row),
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
icon: 'user.user-plus-01',
|
|
1227
|
+
tooltip: this.translocoService.translate('users-groups.link-to-application'),
|
|
1228
|
+
color: 'success',
|
|
1229
|
+
variant: 'outlined',
|
|
1230
|
+
action: (row) => {
|
|
1231
|
+
this.linkUserToApplication(row);
|
|
1232
|
+
},
|
|
1233
|
+
hidden: (row) => this.isLinkedToCurrentApplication(row),
|
|
1234
|
+
confirmation: {
|
|
1235
|
+
type: 'popup',
|
|
1236
|
+
header: this.translocoService.translate('users-groups.link-confirm-header'),
|
|
1237
|
+
message: this.translocoService.translate('users-groups.link-confirm-message'),
|
|
1238
|
+
icon: 'user.user-plus-01',
|
|
1239
|
+
acceptLabel: this.translocoService.translate('users-groups.link-to-application'),
|
|
1240
|
+
rejectLabel: this.translocoService.translate('users-groups.cancel'),
|
|
1241
|
+
acceptButton: {
|
|
1242
|
+
severity: 'success',
|
|
1243
|
+
},
|
|
1244
|
+
},
|
|
1245
|
+
loading: (row) => this.linkingRowIds().includes(row.userName),
|
|
1151
1246
|
},
|
|
1152
1247
|
{
|
|
1153
1248
|
icon: 'general.trash-01',
|
|
1154
|
-
tooltip: this.translocoService.translate('
|
|
1249
|
+
tooltip: this.translocoService.translate('users-groups.unlink-from-application'),
|
|
1155
1250
|
color: 'danger',
|
|
1156
1251
|
variant: 'outlined',
|
|
1157
1252
|
action: (row) => {
|
|
1158
|
-
this.
|
|
1159
|
-
this.facade
|
|
1160
|
-
.deleteUser(row.userName)
|
|
1161
|
-
.pipe(finalize(() => {
|
|
1162
|
-
this.deletingRowIds.update((ids) => ids.filter((id) => id !== row.userName));
|
|
1163
|
-
}))
|
|
1164
|
-
.subscribe();
|
|
1253
|
+
this.unlinkUserFromApplication(row);
|
|
1165
1254
|
},
|
|
1255
|
+
hidden: (row) => !this.isLinkedToCurrentApplication(row),
|
|
1166
1256
|
confirmation: {
|
|
1167
1257
|
type: 'popup',
|
|
1168
|
-
|
|
1258
|
+
header: this.translocoService.translate('users-groups.unlink-confirm-header'),
|
|
1259
|
+
message: this.translocoService.translate('users-groups.unlink-confirm-message'),
|
|
1260
|
+
icon: 'general.link-broken-01',
|
|
1261
|
+
acceptLabel: this.translocoService.translate('users-groups.unlink-from-application'),
|
|
1262
|
+
rejectLabel: this.translocoService.translate('users-groups.cancel'),
|
|
1263
|
+
acceptButton: {
|
|
1264
|
+
severity: 'danger',
|
|
1265
|
+
},
|
|
1169
1266
|
},
|
|
1170
1267
|
loading: (row) => this.deletingRowIds().includes(row.userName),
|
|
1171
1268
|
},
|
|
@@ -1187,6 +1284,26 @@ class Users {
|
|
|
1187
1284
|
type: 'custom',
|
|
1188
1285
|
customCellTpl: this.typeCol(),
|
|
1189
1286
|
},
|
|
1287
|
+
{
|
|
1288
|
+
key: 'isLinkedToCurrentApplication',
|
|
1289
|
+
label: this.translocoService.translate('users-groups.application-link'),
|
|
1290
|
+
type: 'custom',
|
|
1291
|
+
customCellTpl: this.applicationLinkCol(),
|
|
1292
|
+
filterConfig: {
|
|
1293
|
+
type: 'select',
|
|
1294
|
+
label: this.translocoService.translate('users-groups.application-link'),
|
|
1295
|
+
options: [
|
|
1296
|
+
{
|
|
1297
|
+
label: this.translocoService.translate('users-groups.linked'),
|
|
1298
|
+
value: true,
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
label: this.translocoService.translate('users-groups.not-linked'),
|
|
1302
|
+
value: false,
|
|
1303
|
+
},
|
|
1304
|
+
],
|
|
1305
|
+
},
|
|
1306
|
+
},
|
|
1190
1307
|
{
|
|
1191
1308
|
key: 'email',
|
|
1192
1309
|
label: this.translocoService.translate('users-groups.email'),
|
|
@@ -1206,6 +1323,35 @@ class Users {
|
|
|
1206
1323
|
ngOnInit() {
|
|
1207
1324
|
this.facade.getUsers();
|
|
1208
1325
|
}
|
|
1326
|
+
isLinkedToCurrentApplication(user) {
|
|
1327
|
+
return user?.isLinkedToCurrentApplication !== false;
|
|
1328
|
+
}
|
|
1329
|
+
linkUserToApplication(user) {
|
|
1330
|
+
const userName = user?.userName;
|
|
1331
|
+
if (!userName) {
|
|
1332
|
+
return;
|
|
1333
|
+
}
|
|
1334
|
+
this.linkingRowIds.update((ids) => [...ids, userName]);
|
|
1335
|
+
this.facade
|
|
1336
|
+
.linkUserToApplication(userName)
|
|
1337
|
+
.pipe(finalize(() => {
|
|
1338
|
+
this.linkingRowIds.update((ids) => ids.filter((id) => id !== userName));
|
|
1339
|
+
}))
|
|
1340
|
+
.subscribe();
|
|
1341
|
+
}
|
|
1342
|
+
unlinkUserFromApplication(user) {
|
|
1343
|
+
const userName = user?.userName;
|
|
1344
|
+
if (!userName || !this.isLinkedToCurrentApplication(user)) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
this.deletingRowIds.update((ids) => [...ids, userName]);
|
|
1348
|
+
this.facade
|
|
1349
|
+
.deleteUser(userName)
|
|
1350
|
+
.pipe(finalize(() => {
|
|
1351
|
+
this.deletingRowIds.update((ids) => ids.filter((id) => id !== userName));
|
|
1352
|
+
}))
|
|
1353
|
+
.subscribe();
|
|
1354
|
+
}
|
|
1209
1355
|
addUserDialog(user = null) {
|
|
1210
1356
|
const modalType = user ? 'drawer' : 'dialog';
|
|
1211
1357
|
this.modal.openModal(UserForm, modalType, {
|
|
@@ -1248,7 +1394,7 @@ class Users {
|
|
|
1248
1394
|
});
|
|
1249
1395
|
}
|
|
1250
1396
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Users, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1251
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Users, isStandalone: true, selector: "mt-users", viewQueries: [{ propertyName: "typeCol", first: true, predicate: ["typeCol"], descendants: true, isSignal: true }, { propertyName: "userCol", first: true, predicate: ["userCol"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups'\">\
|
|
1397
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: Users, isStandalone: true, selector: "mt-users", viewQueries: [{ propertyName: "typeCol", first: true, predicate: ["typeCol"], descendants: true, isSignal: true }, { propertyName: "userCol", first: true, predicate: ["userCol"], descendants: true, isSignal: true }, { propertyName: "applicationLinkCol", first: true, predicate: ["applicationLinkCol"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-container *transloco=\"let t; prefix: 'users-groups'\">\n <div class=\"mt-5\">\n <ng-template #typeCol let-row>\n @if (row.isExternal) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-slate-50 dark:bg-slate-900/30 p-2\"\n >\n <mt-icon\n icon=\"general.link-external-02\"\n class=\"text-slate-600 dark:text-slate-300 text-sm\"\n />\n <span class=\"text-slate-700 dark:text-slate-200 text-xs font-medium\">\n {{ t(\"external\") }}\n </span>\n </span>\n } @else {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-emerald-50 dark:bg-emerald-900/30 p-2\"\n >\n <mt-icon\n icon=\"user.users-01\"\n class=\"text-emerald-600 dark:text-emerald-300 text-sm\"\n />\n <span\n class=\"text-emerald-700 dark:text-emerald-200 text-xs font-medium\"\n >\n {{ t(\"internal\") }}\n </span>\n </span>\n }\n </ng-template>\n <ng-template #userCol let-row>\n <div class=\"flex items-center gap-2\">\n <mt-avatar [icon]=\"'custom.user-pp'\"> </mt-avatar> {{ row.displayName }}\n </div>\n </ng-template>\n <ng-template #applicationLinkCol let-row>\n @if (isLinkedToCurrentApplication(row)) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-emerald-50 dark:bg-emerald-900/30 p-2\"\n >\n <mt-icon\n icon=\"user.user-check-01\"\n class=\"text-emerald-600 dark:text-emerald-300 text-sm\"\n />\n <span\n class=\"text-emerald-700 dark:text-emerald-200 text-xs font-medium\"\n >\n {{ t(\"linked\") }}\n </span>\n </span>\n } @else {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-amber-50 dark:bg-amber-900/30 p-2\"\n >\n <mt-icon\n icon=\"general.link-broken-01\"\n class=\"text-amber-600 dark:text-amber-300 text-sm\"\n />\n <span class=\"text-amber-700 dark:text-amber-200 text-xs font-medium\">\n {{ t(\"not-linked\") }}\n </span>\n </span>\n }\n </ng-template>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"users()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [showFilters]=\"true\"\n [loading]=\"loading()\"\n storageKey=\"users-groups-users-table\"\n >\n </mt-table>\n </div>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "exportable", "printable", "groupable", "cellClickFilter", "freezeActions", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange"] }, { kind: "component", type: Avatar, selector: "mt-avatar", inputs: ["label", "icon", "image", "styleClass", "size", "shape", "badge", "badgeSize", "badgeSeverity"], outputs: ["onImageError"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
|
|
1252
1398
|
}
|
|
1253
1399
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Users, decorators: [{
|
|
1254
1400
|
type: Component,
|
|
@@ -1259,8 +1405,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1259
1405
|
Avatar,
|
|
1260
1406
|
Icon,
|
|
1261
1407
|
TranslocoDirective,
|
|
1262
|
-
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups'\">\
|
|
1263
|
-
}], propDecorators: { typeCol: [{ type: i0.ViewChild, args: ['typeCol', { isSignal: true }] }], userCol: [{ type: i0.ViewChild, args: ['userCol', { isSignal: true }] }] } });
|
|
1408
|
+
], template: "<ng-container *transloco=\"let t; prefix: 'users-groups'\">\n <div class=\"mt-5\">\n <ng-template #typeCol let-row>\n @if (row.isExternal) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-slate-50 dark:bg-slate-900/30 p-2\"\n >\n <mt-icon\n icon=\"general.link-external-02\"\n class=\"text-slate-600 dark:text-slate-300 text-sm\"\n />\n <span class=\"text-slate-700 dark:text-slate-200 text-xs font-medium\">\n {{ t(\"external\") }}\n </span>\n </span>\n } @else {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-emerald-50 dark:bg-emerald-900/30 p-2\"\n >\n <mt-icon\n icon=\"user.users-01\"\n class=\"text-emerald-600 dark:text-emerald-300 text-sm\"\n />\n <span\n class=\"text-emerald-700 dark:text-emerald-200 text-xs font-medium\"\n >\n {{ t(\"internal\") }}\n </span>\n </span>\n }\n </ng-template>\n <ng-template #userCol let-row>\n <div class=\"flex items-center gap-2\">\n <mt-avatar [icon]=\"'custom.user-pp'\"> </mt-avatar> {{ row.displayName }}\n </div>\n </ng-template>\n <ng-template #applicationLinkCol let-row>\n @if (isLinkedToCurrentApplication(row)) {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-emerald-50 dark:bg-emerald-900/30 p-2\"\n >\n <mt-icon\n icon=\"user.user-check-01\"\n class=\"text-emerald-600 dark:text-emerald-300 text-sm\"\n />\n <span\n class=\"text-emerald-700 dark:text-emerald-200 text-xs font-medium\"\n >\n {{ t(\"linked\") }}\n </span>\n </span>\n } @else {\n <span\n class=\"inline-flex items-center gap-1 rounded-md bg-amber-50 dark:bg-amber-900/30 p-2\"\n >\n <mt-icon\n icon=\"general.link-broken-01\"\n class=\"text-amber-600 dark:text-amber-300 text-sm\"\n />\n <span class=\"text-amber-700 dark:text-amber-200 text-xs font-medium\">\n {{ t(\"not-linked\") }}\n </span>\n </span>\n }\n </ng-template>\n\n <mt-table\n [tabs]=\"tabs()\"\n [(activeTab)]=\"activeTab\"\n [data]=\"users()\"\n [columns]=\"tableColumns()\"\n [actions]=\"tableActions()\"\n [rowActions]=\"rowActions()\"\n [generalSearch]=\"true\"\n [showFilters]=\"true\"\n [loading]=\"loading()\"\n storageKey=\"users-groups-users-table\"\n >\n </mt-table>\n </div>\n</ng-container>\n" }]
|
|
1409
|
+
}], propDecorators: { typeCol: [{ type: i0.ViewChild, args: ['typeCol', { isSignal: true }] }], userCol: [{ type: i0.ViewChild, args: ['userCol', { isSignal: true }] }], applicationLinkCol: [{ type: i0.ViewChild, args: ['applicationLinkCol', { isSignal: true }] }] } });
|
|
1264
1410
|
|
|
1265
1411
|
class GroupForm {
|
|
1266
1412
|
modal = inject(ModalService);
|
|
@@ -1541,5 +1687,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1541
1687
|
* Generated bundle index. Do not edit.
|
|
1542
1688
|
*/
|
|
1543
1689
|
|
|
1544
|
-
export { AddUserToGroup, ClearSelectedGroup, CreateGroup, CreateUser, DeleteGroup, DeleteUser, DeleteUserFromGroup, GetGroup, GetGroups, GetUser, GetUserSummary, GetUsers, GroupForm, Groups, ResetUserPassword, UpdateGroup, UpdateUser, UserForm, Users, UsersGroups, UsersGroupsActionKey, UsersGroupsFacade, UsersGroupsState };
|
|
1690
|
+
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 };
|
|
1545
1691
|
//# sourceMappingURL=masterteam-users-groups.mjs.map
|