@memberjunction/ng-explorer-settings 0.9.9 → 0.9.11

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.
@@ -0,0 +1,41 @@
1
+ import { OnInit, SimpleChanges, OnChanges } from '@angular/core';
2
+ import { kendoSVGIcon } from '@memberjunction/ng-shared';
3
+ import { RoleEntity, UserEntity } from '@memberjunction/core-entities';
4
+ import { Router } from '@angular/router';
5
+ import { UserRoleEntity_Ext } from '../single-role/single-role.component';
6
+ import * as i0 from "@angular/core";
7
+ export declare class UserRolesGridComponent implements OnInit, OnChanges {
8
+ private router;
9
+ /**
10
+ * The name of the role we are working with, required if Mode is 'Roles'
11
+ */
12
+ RoleName: string;
13
+ /**
14
+ * The ID of the user we are working with, required if Mode is 'Users'
15
+ */
16
+ UserID: number;
17
+ isLoading: boolean;
18
+ userRoles: UserRoleEntity_Ext[];
19
+ Mode: 'Users' | 'Roles';
20
+ /**
21
+ * The role record we are working with, required if Mode is 'Roles'
22
+ */
23
+ RoleRecord: RoleEntity | null;
24
+ /**
25
+ * The user record we are working with, required if Mode is 'Users'
26
+ */
27
+ UserRecord: UserEntity | null;
28
+ kendoSVGIcon: typeof kendoSVGIcon;
29
+ constructor(router: Router);
30
+ ngOnInit(): void;
31
+ ngOnChanges(changes: SimpleChanges): void;
32
+ Refresh(): Promise<void>;
33
+ saveUserRoles(): Promise<void>;
34
+ cancelEdit(): void;
35
+ flipAll(): void;
36
+ get NumDirty(): number;
37
+ protected IsReallyDirty(ur: UserRoleEntity_Ext): boolean;
38
+ flipState($event: MouseEvent | undefined, ur: UserRoleEntity_Ext, flipState: boolean): void;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<UserRolesGridComponent, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<UserRolesGridComponent, "mj-user-roles-grid", never, { "RoleName": { "alias": "RoleName"; "required": false; }; "UserID": { "alias": "UserID"; "required": false; }; "Mode": { "alias": "Mode"; "required": false; }; "RoleRecord": { "alias": "RoleRecord"; "required": false; }; "UserRecord": { "alias": "UserRecord"; "required": false; }; }, {}, never, never, false, never>;
41
+ }
@@ -0,0 +1,320 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, Input } from '@angular/core';
11
+ import { Metadata, RunView } from '@memberjunction/core';
12
+ import { kendoSVGIcon } from '@memberjunction/ng-shared';
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "@angular/router";
15
+ import * as i2 from "@angular/common";
16
+ import * as i3 from "@angular/forms";
17
+ import * as i4 from "@progress/kendo-angular-buttons";
18
+ import * as i5 from "@progress/kendo-angular-indicators";
19
+ function UserRolesGridComponent_div_0_Template(rf, ctx) { if (rf & 1) {
20
+ i0.ɵɵelementStart(0, "div");
21
+ i0.ɵɵelement(1, "kendo-loader");
22
+ i0.ɵɵelementEnd();
23
+ } }
24
+ function UserRolesGridComponent_div_1_table_5_th_3_Template(rf, ctx) { if (rf & 1) {
25
+ i0.ɵɵelementStart(0, "th");
26
+ i0.ɵɵtext(1, "User");
27
+ i0.ɵɵelementEnd();
28
+ } }
29
+ function UserRolesGridComponent_div_1_table_5_th_4_Template(rf, ctx) { if (rf & 1) {
30
+ i0.ɵɵelementStart(0, "th");
31
+ i0.ɵɵtext(1, "Role");
32
+ i0.ɵɵelementEnd();
33
+ } }
34
+ function UserRolesGridComponent_div_1_table_5_tr_8_td_1_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵelementStart(0, "td");
36
+ i0.ɵɵtext(1);
37
+ i0.ɵɵelementEnd();
38
+ } if (rf & 2) {
39
+ const ur_r6 = i0.ɵɵnextContext().$implicit;
40
+ i0.ɵɵadvance();
41
+ i0.ɵɵtextInterpolate(ur_r6.User);
42
+ } }
43
+ function UserRolesGridComponent_div_1_table_5_tr_8_td_2_Template(rf, ctx) { if (rf & 1) {
44
+ i0.ɵɵelementStart(0, "td");
45
+ i0.ɵɵtext(1);
46
+ i0.ɵɵelementEnd();
47
+ } if (rf & 2) {
48
+ const ur_r6 = i0.ɵɵnextContext().$implicit;
49
+ i0.ɵɵadvance();
50
+ i0.ɵɵtextInterpolate(ur_r6.RoleName);
51
+ } }
52
+ function UserRolesGridComponent_div_1_table_5_tr_8_Template(rf, ctx) { if (rf & 1) {
53
+ const _r12 = i0.ɵɵgetCurrentView();
54
+ i0.ɵɵelementStart(0, "tr");
55
+ i0.ɵɵtemplate(1, UserRolesGridComponent_div_1_table_5_tr_8_td_1_Template, 2, 1, "td", 0)(2, UserRolesGridComponent_div_1_table_5_tr_8_td_2_Template, 2, 1, "td", 0);
56
+ i0.ɵɵelementStart(3, "td", 6);
57
+ i0.ɵɵlistener("click", function UserRolesGridComponent_div_1_table_5_tr_8_Template_td_click_3_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const ur_r6 = restoredCtx.$implicit; const ctx_r11 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r11.flipState($event, ur_r6, true)); });
58
+ i0.ɵɵelementStart(4, "input", 8);
59
+ i0.ɵɵtwoWayListener("ngModelChange", function UserRolesGridComponent_div_1_table_5_tr_8_Template_input_ngModelChange_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const ur_r6 = restoredCtx.$implicit; i0.ɵɵtwoWayBindingSet(ur_r6.Selected, $event) || (ur_r6.Selected = $event); return i0.ɵɵresetView($event); });
60
+ i0.ɵɵlistener("click", function UserRolesGridComponent_div_1_table_5_tr_8_Template_input_click_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const ur_r6 = restoredCtx.$implicit; const ctx_r14 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r14.flipState($event, ur_r6, false)); });
61
+ i0.ɵɵelementEnd()()();
62
+ } if (rf & 2) {
63
+ const ur_r6 = ctx.$implicit;
64
+ const ctx_r5 = i0.ɵɵnextContext(3);
65
+ i0.ɵɵadvance();
66
+ i0.ɵɵproperty("ngIf", ctx_r5.Mode === "Roles");
67
+ i0.ɵɵadvance();
68
+ i0.ɵɵproperty("ngIf", ctx_r5.Mode === "Users");
69
+ i0.ɵɵadvance(2);
70
+ i0.ɵɵtwoWayProperty("ngModel", ur_r6.Selected);
71
+ } }
72
+ function UserRolesGridComponent_div_1_table_5_Template(rf, ctx) { if (rf & 1) {
73
+ const _r16 = i0.ɵɵgetCurrentView();
74
+ i0.ɵɵelementStart(0, "table", 5)(1, "thead")(2, "tr");
75
+ i0.ɵɵtemplate(3, UserRolesGridComponent_div_1_table_5_th_3_Template, 2, 0, "th", 0)(4, UserRolesGridComponent_div_1_table_5_th_4_Template, 2, 0, "th", 0);
76
+ i0.ɵɵelementStart(5, "th", 6);
77
+ i0.ɵɵlistener("click", function UserRolesGridComponent_div_1_table_5_Template_th_click_5_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.flipAll()); });
78
+ i0.ɵɵtext(6, "In Role");
79
+ i0.ɵɵelementEnd()()();
80
+ i0.ɵɵelementStart(7, "tbody");
81
+ i0.ɵɵtemplate(8, UserRolesGridComponent_div_1_table_5_tr_8_Template, 5, 3, "tr", 7);
82
+ i0.ɵɵelementEnd()();
83
+ } if (rf & 2) {
84
+ const ctx_r2 = i0.ɵɵnextContext(2);
85
+ i0.ɵɵadvance(3);
86
+ i0.ɵɵproperty("ngIf", ctx_r2.Mode === "Roles");
87
+ i0.ɵɵadvance();
88
+ i0.ɵɵproperty("ngIf", ctx_r2.Mode === "Users");
89
+ i0.ɵɵadvance(4);
90
+ i0.ɵɵproperty("ngForOf", ctx_r2.userRoles);
91
+ } }
92
+ function UserRolesGridComponent_div_1_Template(rf, ctx) { if (rf & 1) {
93
+ const _r18 = i0.ɵɵgetCurrentView();
94
+ i0.ɵɵelementStart(0, "div", 2)(1, "button", 3);
95
+ i0.ɵɵlistener("click", function UserRolesGridComponent_div_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r17.saveUserRoles()); });
96
+ i0.ɵɵtext(2, "Save");
97
+ i0.ɵɵelementEnd();
98
+ i0.ɵɵelementStart(3, "button", 3);
99
+ i0.ɵɵlistener("click", function UserRolesGridComponent_div_1_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r18); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r19.cancelEdit()); });
100
+ i0.ɵɵtext(4, "Cancel");
101
+ i0.ɵɵelementEnd();
102
+ i0.ɵɵtemplate(5, UserRolesGridComponent_div_1_table_5_Template, 9, 3, "table", 4);
103
+ i0.ɵɵelementEnd();
104
+ } if (rf & 2) {
105
+ const ctx_r1 = i0.ɵɵnextContext();
106
+ i0.ɵɵadvance();
107
+ i0.ɵɵproperty("disabled", ctx_r1.NumDirty === 0);
108
+ i0.ɵɵadvance(2);
109
+ i0.ɵɵproperty("disabled", ctx_r1.NumDirty === 0);
110
+ i0.ɵɵadvance(2);
111
+ i0.ɵɵproperty("ngIf", !ctx_r1.isLoading);
112
+ } }
113
+ export class UserRolesGridComponent {
114
+ constructor(router) {
115
+ this.router = router;
116
+ this.isLoading = false;
117
+ this.userRoles = [];
118
+ this.Mode = 'Users';
119
+ /**
120
+ * The role record we are working with, required if Mode is 'Roles'
121
+ */
122
+ this.RoleRecord = null;
123
+ /**
124
+ * The user record we are working with, required if Mode is 'Users'
125
+ */
126
+ this.UserRecord = null;
127
+ this.kendoSVGIcon = kendoSVGIcon;
128
+ }
129
+ ngOnInit() {
130
+ this.Refresh();
131
+ }
132
+ ngOnChanges(changes) {
133
+ if (changes && (changes.RoleRecord || changes.UserRecord))
134
+ this.Refresh();
135
+ }
136
+ Refresh() {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ if (this.Mode === 'Roles')
139
+ if (!this.RoleName || this.RoleName.length === 0 || !this.RoleRecord)
140
+ throw new Error("RoleName and RoleRecord are required when Mode is 'Roles'");
141
+ if (this.Mode === 'Users')
142
+ if (!this.UserID || !this.UserRecord)
143
+ throw new Error("UserID and UserRecord are required when Mode is 'Users'");
144
+ const md = new Metadata();
145
+ this.isLoading = true;
146
+ const rv = new RunView();
147
+ const filter = this.Mode === 'Roles' ? `RoleName='${this.RoleName}'` : `UserID=${this.UserID}`;
148
+ const result = yield rv.RunView({
149
+ EntityName: 'User Roles',
150
+ ExtraFilter: filter,
151
+ ResultType: 'entity_object'
152
+ });
153
+ if (result.Success) {
154
+ // we have all of the saved permissions now
155
+ // the post-process we need to do now is to see if there are any roles that don't have any existing permissions and if so, we need to create
156
+ // new permission records for them. We won't actually consider those "Dirty" and save those unless the user actually selects one or more
157
+ // to turn on, we are just doing this to make the grid easy to manage from the user perspective.
158
+ const existingUserRoles = result.Results;
159
+ existingUserRoles.forEach(ur => {
160
+ ur.Selected = true; // flip this on for all records that come from the DB
161
+ ur.SavedUserID = ur.UserID; // stash this in an extra property so we can later set it if we have a delete operation
162
+ ur.SavedUserName = ur.User; // stash this in an extra property so we can later set it if we have a delete operation
163
+ ur.SavedRoleName = ur.RoleName; // stash this in an extra property so we can later set it if we have a delete operation
164
+ });
165
+ if (this.Mode === 'Roles') {
166
+ // for the mode of Roles, we want to bring in all of the possible users and then add any that are not in the existingUserRoles array
167
+ const userResult = yield rv.RunView({
168
+ EntityName: 'Users',
169
+ ExtraFilter: 'IsActive=1',
170
+ ResultType: 'entity_object'
171
+ });
172
+ if (userResult.Success) {
173
+ const users = userResult.Results;
174
+ const usersNotInRole = users.filter(u => !existingUserRoles.some(p => p.UserID === u.ID));
175
+ for (const u of usersNotInRole) {
176
+ const ur = yield md.GetEntityObject('User Roles');
177
+ ur.NewRecord();
178
+ ur.RoleName = this.RoleName;
179
+ ur.SavedRoleName = this.RoleName; // stash this in an extra property so we can later set it if we have a delete operation
180
+ ur.UserID = u.ID;
181
+ ur.Set('User', u.Name); // use weak typing to get around the readonly property
182
+ ur.SavedUserName = u.Name; // stash this in an extra property so we can later set it if we have a delete operation
183
+ ur.SavedUserID = u.ID; // stash this in an extra property so we can later set it if we have a delete operation
184
+ ur.Selected = false;
185
+ existingUserRoles.push(ur);
186
+ }
187
+ }
188
+ // finally sort the array
189
+ this.userRoles = existingUserRoles.sort((a, b) => a.User.localeCompare(b.User));
190
+ }
191
+ else {
192
+ // for the mode of Users, we want to bring in all of the possible roles and then add any that are not in the existingUserRoles array
193
+ const roles = md.Roles;
194
+ const rolesNotInUser = roles.filter(r => !existingUserRoles.some(p => p.RoleName === r.Name));
195
+ for (const r of rolesNotInUser) {
196
+ const ur = yield md.GetEntityObject('User Roles');
197
+ ur.NewRecord();
198
+ ur.RoleName = r.Name;
199
+ ur.UserID = this.UserID;
200
+ ur.Set('User', this.UserRecord.Name); // use weak typing to get around the readonly property
201
+ ur.SavedUserName = this.UserRecord.Name; // stash this in an extra property so we can later set it if we have a delete operation
202
+ ur.SavedUserID = this.UserID; // stash this in an extra property so we can later set it if we have a delete operation
203
+ ur.SavedRoleName = r.Name; // stash this in an extra property so we can later set it if we have a delete operation
204
+ ur.Selected = false;
205
+ existingUserRoles.push(ur);
206
+ }
207
+ // finally sort the array
208
+ this.userRoles = existingUserRoles.sort((a, b) => a.RoleName.localeCompare(b.RoleName));
209
+ }
210
+ }
211
+ else {
212
+ throw new Error("Error loading user roles: " + result.ErrorMessage);
213
+ }
214
+ this.isLoading = false;
215
+ });
216
+ }
217
+ saveUserRoles() {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ // iterate through each permisison and for the ones that are dirty, add to transaction group then commit at once
220
+ const md = new Metadata();
221
+ const tg = yield md.CreateTransactionGroup();
222
+ let itemCount = 0;
223
+ this.userRoles.forEach(ur => {
224
+ if (this.IsReallyDirty(ur)) {
225
+ ur.TransactionGroup = tg;
226
+ itemCount++;
227
+ // now, we have to determine if we are going to save the record or delete it
228
+ // if ur.Selected === false and we are in the database, we need to delete
229
+ // otherwise, we need to save
230
+ if (ur.Selected)
231
+ ur.Save();
232
+ else
233
+ ur.Delete();
234
+ }
235
+ });
236
+ if (itemCount > 0) {
237
+ if (yield tg.Submit()) {
238
+ // for any items in the above that were deleted, we would have had the User property wiped out so we need to go check to see if we have a null ID and if so, copy the UserName back into the User property
239
+ this.userRoles.forEach(ur => {
240
+ if (ur.User === null) {
241
+ ur.Set('User', ur.SavedUserName); // get around the read-only property
242
+ ur.UserID = ur.SavedUserID;
243
+ ur.RoleName = this.Mode === 'Roles' ? this.RoleName : ur.SavedRoleName;
244
+ }
245
+ });
246
+ }
247
+ }
248
+ });
249
+ }
250
+ cancelEdit() {
251
+ if (this.NumDirty > 0) {
252
+ // go through and revert each permission that is REALLY dirty
253
+ this.userRoles.forEach(ur => {
254
+ if (this.IsReallyDirty(ur)) {
255
+ ur.Selected = !ur.Selected; // flip the state so we can revert
256
+ }
257
+ });
258
+ }
259
+ }
260
+ flipAll() {
261
+ // first, figure out what we have the majority of, if we have more ON, then we will flip to OFF, otherwise we will flip to ON
262
+ let onCount = 0;
263
+ let offCount = 0;
264
+ this.userRoles.forEach(ur => {
265
+ if (ur.Selected)
266
+ onCount++;
267
+ else
268
+ offCount++;
269
+ });
270
+ const value = offCount > onCount;
271
+ // now set the permission for each permission record
272
+ for (const ur of this.userRoles) {
273
+ ur.Selected = value;
274
+ this.flipState(undefined, ur, false); // call this function but tell it to NOT actually flip the permission, just to fire the event
275
+ }
276
+ }
277
+ get NumDirty() {
278
+ return this.userRoles.filter(ur => this.IsReallyDirty(ur)).length;
279
+ }
280
+ IsReallyDirty(ur) {
281
+ // logic is simple, if we are in the database, but the checkbox is not checked (or vice versa), then we are dirty
282
+ if (ur.Selected && ur.ID > 0)
283
+ return false; // if we are in the database and the checkbox is checked, we are not dirty
284
+ else if (!ur.Selected && ur.ID > 0)
285
+ return true; // if we are in the database and the checkbox is not checked, we are dirty because we'd have to be removed
286
+ else if (ur.Selected)
287
+ return true; // if we are NOT in the database and the checkbox is checked, we are dirty because we'd have to be added
288
+ else
289
+ return false;
290
+ }
291
+ flipState($event, ur, flipState) {
292
+ if (flipState)
293
+ ur.Selected = !ur.Selected;
294
+ else if ($event)
295
+ $event.stopPropagation();
296
+ }
297
+ }
298
+ UserRolesGridComponent.ɵfac = function UserRolesGridComponent_Factory(t) { return new (t || UserRolesGridComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
299
+ UserRolesGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserRolesGridComponent, selectors: [["mj-user-roles-grid"]], inputs: { RoleName: "RoleName", UserID: "UserID", Mode: "Mode", RoleRecord: "RoleRecord", UserRecord: "UserRecord" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], ["class", "content", 4, "ngIf"], [1, "content"], ["kendoButton", "", 3, "disabled", "click"], ["class", "grid", 4, "ngIf"], [1, "grid"], [3, "click"], [4, "ngFor", "ngForOf"], ["type", "checkbox", "kendoCheckBox", "", 3, "ngModel", "ngModelChange", "click"]], template: function UserRolesGridComponent_Template(rf, ctx) { if (rf & 1) {
300
+ i0.ɵɵtemplate(0, UserRolesGridComponent_div_0_Template, 2, 0, "div", 0)(1, UserRolesGridComponent_div_1_Template, 6, 3, "div", 1);
301
+ } if (rf & 2) {
302
+ i0.ɵɵproperty("ngIf", ctx.isLoading);
303
+ i0.ɵɵadvance();
304
+ i0.ɵɵproperty("ngIf", !ctx.isLoading);
305
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3.CheckboxControlValueAccessor, i3.NgControlStatus, i3.NgModel, i4.ButtonComponent, i5.LoaderComponent], styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n width: 150px;\r\n text-align: left;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}"] });
306
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserRolesGridComponent, [{
307
+ type: Component,
308
+ args: [{ selector: 'mj-user-roles-grid', template: "<div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n<div class=\"content\" *ngIf=\"!isLoading\">\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"saveUserRoles()\">Save</button>\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"cancelEdit()\">Cancel</button>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"Mode === 'Roles'\">User</th>\r\n <th *ngIf=\"Mode === 'Users'\">Role</th>\r\n <th (click)=\"flipAll()\">In Role</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let ur of userRoles\">\r\n <td *ngIf=\"Mode === 'Roles'\">{{ ur.User }}</td>\r\n <td *ngIf=\"Mode === 'Users'\">{{ ur.RoleName }}</td>\r\n <td (click)=\"flipState($event, ur, true)\">\r\n <input type=\"checkbox\" kendoCheckBox [(ngModel)]=\"ur.Selected\" (click)=\"flipState($event, ur, false)\">\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n</div>", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n/* Styles for the table with the 'grid' class */\r\n.grid {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Styles for th elements within the table with the 'grid' class */\r\n.grid th {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n/* Styles for td elements within the table with the 'grid' class */\r\n.grid td {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n/* Styles for the first child th and td within the table with the 'grid' class */\r\n.grid th:first-child,\r\n.grid td:first-child {\r\n width: 150px;\r\n text-align: left;\r\n}\r\n\r\n/* Styles for non-first-child th and td elements within the table with the 'grid' class */\r\n.grid th:not(:first-child),\r\n.grid td:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n/* Alternating row background colors for the table with the 'grid' class */\r\n.grid tr:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid tr:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}\r\n\r\n"] }]
309
+ }], () => [{ type: i1.Router }], { RoleName: [{
310
+ type: Input
311
+ }], UserID: [{
312
+ type: Input
313
+ }], Mode: [{
314
+ type: Input
315
+ }], RoleRecord: [{
316
+ type: Input
317
+ }], UserRecord: [{
318
+ type: Input
319
+ }] }); })();
320
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserRolesGridComponent, { className: "UserRolesGridComponent", filePath: "src\\lib\\user-roles-grid\\user-roles-grid.component.ts", lineNumber: 16 }); })();
@@ -1,4 +1,5 @@
1
1
  export * from './lib/single-role/single-role.component';
2
2
  export * from './lib/settings/settings.component';
3
- export * from './lib/roles-list/roles-list.component';
3
+ export * from './lib/user-roles-grid/user-roles-grid.component';
4
+ export * from './lib/single-user/single-user.component';
4
5
  export * from './lib/module';
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export * from './lib/single-role/single-role.component';
5
5
  export * from './lib/settings/settings.component';
6
- export * from './lib/roles-list/roles-list.component';
6
+ export * from './lib/user-roles-grid/user-roles-grid.component';
7
+ export * from './lib/single-user/single-user.component';
7
8
  export * from './lib/module';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-explorer-settings",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
4
4
  "description": "MemberJunction: Reusable Angular components for the settings section of the MJ Explorer App",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -25,17 +25,22 @@
25
25
  "@angular/router": "~17.2.2"
26
26
  },
27
27
  "dependencies": {
28
- "@memberjunction/core-entities": "^0.9.164",
28
+ "@memberjunction/core-entities": "^0.9.166",
29
29
  "@memberjunction/global": "^0.9.156",
30
30
  "@memberjunction/core": "^0.9.177",
31
31
  "@memberjunction/ng-container-directives": "^0.9.141",
32
- "@memberjunction/ng-shared": "^0.9.32",
33
- "@memberjunction/ng-entity-permissions": "^0.9.9",
32
+ "@memberjunction/ng-shared": "^0.9.34",
33
+ "@memberjunction/ng-entity-permissions": "^0.9.11",
34
+ "@memberjunction/ng-base-forms": "^0.9.2",
35
+ "@memberjunction/ng-entity-form-dialog": "^0.9.2",
36
+ "@memberjunction/ng-user-view-grid": "^0.9.216",
37
+ "@memberjunction/ng-simple-record-list": "^0.9.2",
34
38
  "@progress/kendo-angular-dropdowns": "~15.1.0",
35
39
  "@progress/kendo-angular-grid": "~15.1.0",
36
40
  "@progress/kendo-angular-buttons": "~15.1.0",
37
41
  "@progress/kendo-angular-dialog": "~15.1.0",
38
42
  "@progress/kendo-angular-layout": "~15.1.0",
43
+ "@progress/kendo-angular-indicators": "~15.1.0",
39
44
  "tslib": "^2.3.0"
40
45
  },
41
46
  "sideEffects": false