@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.
- package/dist/lib/entity-form-dialog/entity-form-dialog.component.d.ts +33 -0
- package/dist/lib/entity-form-dialog/entity-form-dialog.component.js +183 -0
- package/dist/lib/entity-form-window/entity-form-window.component.d.ts +17 -0
- package/dist/lib/entity-form-window/entity-form-window.component.js +99 -0
- package/dist/lib/module.d.ts +19 -14
- package/dist/lib/module.js +40 -8
- package/dist/lib/record-list/record-list.component.d.ts +41 -0
- package/dist/lib/record-list/record-list.component.js +324 -0
- package/dist/lib/roles-list/roles-list.component.d.ts +11 -1
- package/dist/lib/roles-list/roles-list.component.js +125 -26
- package/dist/lib/settings/settings.component.d.ts +6 -2
- package/dist/lib/settings/settings.component.js +52 -41
- package/dist/lib/single-role/single-role.component.d.ts +16 -13
- package/dist/lib/single-role/single-role.component.js +110 -182
- package/dist/lib/single-user/single-user.component.d.ts +24 -0
- package/dist/lib/single-user/single-user.component.js +191 -0
- package/dist/lib/user-roles-grid/user-roles-grid.component.d.ts +41 -0
- package/dist/lib/user-roles-grid/user-roles-grid.component.js +320 -0
- package/dist/public-api.d.ts +2 -1
- package/dist/public-api.js +2 -1
- package/package.json +9 -4
|
@@ -13,88 +13,89 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
13
13
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
import { Component, Input } from '@angular/core';
|
|
17
|
-
import { BaseEntity, Metadata
|
|
16
|
+
import { Component, Input, ViewChild } from '@angular/core';
|
|
17
|
+
import { BaseEntity, Metadata } from '@memberjunction/core';
|
|
18
18
|
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
19
19
|
import { UserRoleEntity } from '@memberjunction/core-entities';
|
|
20
20
|
import { RegisterClass } from '@memberjunction/global';
|
|
21
21
|
import * as i0 from "@angular/core";
|
|
22
|
-
|
|
23
|
-
import * as i2 from "@angular/forms";
|
|
24
|
-
import * as i3 from "@memberjunction/ng-container-directives";
|
|
25
|
-
import * as i4 from "@progress/kendo-angular-buttons";
|
|
26
|
-
import * as i5 from "@memberjunction/ng-entity-permissions";
|
|
27
|
-
import * as i6 from "@progress/kendo-angular-layout";
|
|
22
|
+
const _c0 = ["entityForm"];
|
|
28
23
|
function SingleRoleComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
29
24
|
i0.ɵɵelementStart(0, "div");
|
|
30
|
-
i0.ɵɵ
|
|
25
|
+
i0.ɵɵelement(1, "kendo-loader");
|
|
31
26
|
i0.ɵɵelementEnd();
|
|
32
27
|
} }
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
i0.ɵɵ
|
|
28
|
+
function SingleRoleComponent_div_2_ng_template_26_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelement(0, "mj-user-roles-grid", 11);
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
32
|
+
i0.ɵɵproperty("RoleName", ctx_r3.RoleName)("RoleRecord", ctx_r3.RoleRecord);
|
|
33
|
+
} }
|
|
34
|
+
function SingleRoleComponent_div_2_ng_template_28_mj_entity_permissions_grid_1_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelement(0, "mj-entity-permissions-grid", 14);
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const ctx_r5 = i0.ɵɵnextContext(3);
|
|
38
|
+
i0.ɵɵproperty("RoleName", ctx_r5.RoleRecord.Name);
|
|
39
|
+
} }
|
|
40
|
+
function SingleRoleComponent_div_2_ng_template_28_Template(rf, ctx) { if (rf & 1) {
|
|
41
|
+
i0.ɵɵelementStart(0, "div", 12);
|
|
42
|
+
i0.ɵɵtemplate(1, SingleRoleComponent_div_2_ng_template_28_mj_entity_permissions_grid_1_Template, 1, 1, "mj-entity-permissions-grid", 13);
|
|
37
43
|
i0.ɵɵelementEnd();
|
|
38
|
-
i0.ɵɵelementStart(3, "td", 12);
|
|
39
|
-
i0.ɵɵlistener("click", function SingleRoleComponent_ng_template_4_table_5_tr_8_Template_td_click_3_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r7); const ur_r5 = restoredCtx.$implicit; const ctx_r6 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r6.flipState($event, ur_r5, true)); });
|
|
40
|
-
i0.ɵɵelementStart(4, "input", 13);
|
|
41
|
-
i0.ɵɵtwoWayListener("ngModelChange", function SingleRoleComponent_ng_template_4_table_5_tr_8_Template_input_ngModelChange_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r7); const ur_r5 = restoredCtx.$implicit; i0.ɵɵtwoWayBindingSet(ur_r5.Selected, $event) || (ur_r5.Selected = $event); return i0.ɵɵresetView($event); });
|
|
42
|
-
i0.ɵɵlistener("click", function SingleRoleComponent_ng_template_4_table_5_tr_8_Template_input_click_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r7); const ur_r5 = restoredCtx.$implicit; const ctx_r9 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r9.flipState($event, ur_r5, false)); });
|
|
43
|
-
i0.ɵɵelementEnd()()();
|
|
44
44
|
} if (rf & 2) {
|
|
45
|
-
const
|
|
46
|
-
i0.ɵɵadvance(
|
|
47
|
-
i0.ɵɵ
|
|
48
|
-
i0.ɵɵadvance(2);
|
|
49
|
-
i0.ɵɵtwoWayProperty("ngModel", ur_r5.Selected);
|
|
45
|
+
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
46
|
+
i0.ɵɵadvance();
|
|
47
|
+
i0.ɵɵproperty("ngIf", ctx_r4.RoleRecord && ctx_r4.RoleRecord.Name);
|
|
50
48
|
} }
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
i0.ɵɵ
|
|
49
|
+
function SingleRoleComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
51
|
+
i0.ɵɵelementStart(0, "div")(1, "table", 4)(2, "tbody")(3, "tr")(4, "th", 5);
|
|
52
|
+
i0.ɵɵtext(5, "Role");
|
|
54
53
|
i0.ɵɵelementEnd();
|
|
55
|
-
i0.ɵɵelementStart(
|
|
56
|
-
i0.ɵɵtext(
|
|
54
|
+
i0.ɵɵelementStart(6, "td");
|
|
55
|
+
i0.ɵɵtext(7);
|
|
56
|
+
i0.ɵɵelementStart(8, "kendo-svgicon", 6);
|
|
57
|
+
i0.ɵɵlistener("click", function SingleRoleComponent_div_2_Template_kendo_svgicon_click_8_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.EditRecord()); });
|
|
57
58
|
i0.ɵɵelementEnd()()();
|
|
58
|
-
i0.ɵɵelementStart(
|
|
59
|
-
i0.ɵɵ
|
|
59
|
+
i0.ɵɵelementStart(9, "tr")(10, "th", 5);
|
|
60
|
+
i0.ɵɵtext(11, "Description");
|
|
61
|
+
i0.ɵɵelementEnd();
|
|
62
|
+
i0.ɵɵelementStart(12, "td");
|
|
63
|
+
i0.ɵɵtext(13);
|
|
60
64
|
i0.ɵɵelementEnd()();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
i0.ɵɵadvance(8);
|
|
64
|
-
i0.ɵɵproperty("ngForOf", ctx_r3.userRoles);
|
|
65
|
-
} }
|
|
66
|
-
function SingleRoleComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
|
|
67
|
-
const _r11 = i0.ɵɵgetCurrentView();
|
|
68
|
-
i0.ɵɵelementStart(0, "div", 6)(1, "div", 7);
|
|
69
|
-
i0.ɵɵtext(2);
|
|
65
|
+
i0.ɵɵelementStart(14, "tr")(15, "th", 5);
|
|
66
|
+
i0.ɵɵtext(16, "Directory ID");
|
|
70
67
|
i0.ɵɵelementEnd();
|
|
71
|
-
i0.ɵɵelementStart(
|
|
72
|
-
i0.ɵɵ
|
|
73
|
-
i0.ɵɵ
|
|
68
|
+
i0.ɵɵelementStart(17, "td");
|
|
69
|
+
i0.ɵɵtext(18);
|
|
70
|
+
i0.ɵɵelementEnd()();
|
|
71
|
+
i0.ɵɵelementStart(19, "tr")(20, "th", 5);
|
|
72
|
+
i0.ɵɵtext(21, "SQL Name");
|
|
74
73
|
i0.ɵɵelementEnd();
|
|
75
|
-
i0.ɵɵ
|
|
74
|
+
i0.ɵɵelementStart(22, "td");
|
|
75
|
+
i0.ɵɵtext(23);
|
|
76
|
+
i0.ɵɵelementEnd()()()();
|
|
77
|
+
i0.ɵɵelementStart(24, "kendo-tabstrip", 7)(25, "kendo-tabstrip-tab", 8);
|
|
78
|
+
i0.ɵɵtemplate(26, SingleRoleComponent_div_2_ng_template_26_Template, 1, 2, "ng-template", 9);
|
|
76
79
|
i0.ɵɵelementEnd();
|
|
80
|
+
i0.ɵɵelementStart(27, "kendo-tabstrip-tab", 10);
|
|
81
|
+
i0.ɵɵtemplate(28, SingleRoleComponent_div_2_ng_template_28_Template, 2, 1, "ng-template", 9);
|
|
82
|
+
i0.ɵɵelementEnd()()();
|
|
77
83
|
} if (rf & 2) {
|
|
78
84
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
79
|
-
i0.ɵɵadvance(
|
|
80
|
-
i0.ɵɵ
|
|
85
|
+
i0.ɵɵadvance(7);
|
|
86
|
+
i0.ɵɵtextInterpolate(ctx_r1.RoleRecord.Name);
|
|
81
87
|
i0.ɵɵadvance();
|
|
82
|
-
i0.ɵɵproperty("
|
|
83
|
-
i0.ɵɵadvance(
|
|
84
|
-
i0.ɵɵ
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
i0.ɵɵ
|
|
88
|
-
i0.ɵɵ
|
|
89
|
-
i0.ɵɵ
|
|
90
|
-
i0.ɵɵ
|
|
91
|
-
i0.ɵɵelementEnd();
|
|
92
|
-
} if (rf & 2) {
|
|
93
|
-
const ctx_r2 = i0.ɵɵnextContext();
|
|
94
|
-
i0.ɵɵadvance(2);
|
|
95
|
-
i0.ɵɵtextInterpolate1("Role: ", ctx_r2.RoleName, "");
|
|
88
|
+
i0.ɵɵproperty("icon", ctx_r1.kendoSVGIcon("pencil"));
|
|
89
|
+
i0.ɵɵadvance(5);
|
|
90
|
+
i0.ɵɵtextInterpolate(ctx_r1.RoleRecord.Description);
|
|
91
|
+
i0.ɵɵadvance(5);
|
|
92
|
+
i0.ɵɵtextInterpolate(ctx_r1.RoleRecord.DirectoryID);
|
|
93
|
+
i0.ɵɵadvance(5);
|
|
94
|
+
i0.ɵɵtextInterpolate(ctx_r1.RoleRecord.SQLName);
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵproperty("keepTabContent", true)("animate", false);
|
|
96
97
|
i0.ɵɵadvance();
|
|
97
|
-
i0.ɵɵproperty("
|
|
98
|
+
i0.ɵɵproperty("selected", true);
|
|
98
99
|
} }
|
|
99
100
|
let UserRoleEntity_Ext = class UserRoleEntity_Ext extends UserRoleEntity {
|
|
100
101
|
constructor() {
|
|
@@ -102,6 +103,7 @@ let UserRoleEntity_Ext = class UserRoleEntity_Ext extends UserRoleEntity {
|
|
|
102
103
|
this._selected = false;
|
|
103
104
|
this._userName = '';
|
|
104
105
|
this._userID = 0;
|
|
106
|
+
this._savedRoleName = '';
|
|
105
107
|
}
|
|
106
108
|
get Selected() {
|
|
107
109
|
return this._selected;
|
|
@@ -121,158 +123,84 @@ let UserRoleEntity_Ext = class UserRoleEntity_Ext extends UserRoleEntity {
|
|
|
121
123
|
set SavedUserID(value) {
|
|
122
124
|
this._userID = value;
|
|
123
125
|
}
|
|
126
|
+
get SavedRoleName() {
|
|
127
|
+
return this._savedRoleName;
|
|
128
|
+
}
|
|
129
|
+
set SavedRoleName(value) {
|
|
130
|
+
this._savedRoleName = value;
|
|
131
|
+
}
|
|
124
132
|
};
|
|
125
133
|
UserRoleEntity_Ext = __decorate([
|
|
126
134
|
RegisterClass(BaseEntity, 'User Roles', 10) // register this with a high priority so we are used here, we just need to extend it to add a property as a flag to know if it's in the database or not
|
|
127
135
|
], UserRoleEntity_Ext);
|
|
128
136
|
export { UserRoleEntity_Ext };
|
|
129
137
|
export class SingleRoleComponent {
|
|
130
|
-
constructor() {
|
|
131
|
-
this.
|
|
132
|
-
this.userRoles = [];
|
|
138
|
+
constructor(cdRef) {
|
|
139
|
+
this.cdRef = cdRef;
|
|
133
140
|
this.gridHeight = 750;
|
|
134
141
|
this.isLoading = false;
|
|
142
|
+
this.RoleRecord = null;
|
|
135
143
|
this.kendoSVGIcon = kendoSVGIcon;
|
|
144
|
+
this.showEntityEditingForm = false;
|
|
136
145
|
}
|
|
137
146
|
ngOnInit() {
|
|
138
147
|
this.Refresh();
|
|
139
148
|
}
|
|
140
|
-
ngOnChanges(changes) {
|
|
141
|
-
if (changes.EntityName && !changes.EntityName.isFirstChange()) {
|
|
142
|
-
// If EntityName has changed and it's not the first change (initialization)
|
|
143
|
-
this.Refresh();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
149
|
Refresh() {
|
|
147
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
if (result.Success) {
|
|
159
|
-
// we have all of the saved permissions now
|
|
160
|
-
// 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
|
|
161
|
-
// new permission records for them. We won't actually consider those "Dirty" and save those unless the user actually selects one or more
|
|
162
|
-
// to turn on, we are just doing this to make the grid easy to manage from the user perspective.
|
|
163
|
-
const existingUserRoles = result.Results;
|
|
164
|
-
existingUserRoles.forEach(ur => {
|
|
165
|
-
ur.Selected = true;
|
|
166
|
-
ur.SavedUserID = ur.UserID; // stash this in an extra property so we can later set it if we have a delete operation
|
|
167
|
-
ur.SavedUserName = ur.User; // stash this in an extra property so we can later set it if we have a delete operation
|
|
168
|
-
}); // flip this on for all records that come from the DB
|
|
169
|
-
const userResult = yield rv.RunView({
|
|
170
|
-
EntityName: 'Users',
|
|
171
|
-
ExtraFilter: 'IsActive=1',
|
|
172
|
-
ResultType: 'entity_object'
|
|
173
|
-
});
|
|
174
|
-
if (userResult.Success) {
|
|
175
|
-
const users = userResult.Results;
|
|
176
|
-
const usersNotInRole = users.filter(u => !existingUserRoles.some(p => p.UserID === u.ID));
|
|
177
|
-
for (const u of usersNotInRole) {
|
|
178
|
-
const ur = yield md.GetEntityObject('User Roles');
|
|
179
|
-
ur.NewRecord();
|
|
180
|
-
ur.RoleName = this.RoleName;
|
|
181
|
-
ur.UserID = u.ID;
|
|
182
|
-
ur.Set('User', u.Name); // use weak typing to get around the readonly property
|
|
183
|
-
ur.SavedUserName = u.Name; // stash this in an extra property so we can later set it if we have a delete operation
|
|
184
|
-
ur.SavedUserID = u.ID; // stash this in an extra property so we can later set it if we have a delete operation
|
|
185
|
-
ur.Selected = false;
|
|
186
|
-
existingUserRoles.push(ur);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
this.userRoles = existingUserRoles.sort((a, b) => a.User.localeCompare(b.User));
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
throw new Error("Error loading user roles: " + result.ErrorMessage);
|
|
193
|
-
}
|
|
194
|
-
this.isLoading = false;
|
|
151
|
+
const md = new Metadata();
|
|
152
|
+
this.RoleRecord = yield md.GetEntityObject('Roles');
|
|
153
|
+
let r = md.Roles.find(r => r.Name === this.RoleName);
|
|
154
|
+
if (!r) {
|
|
155
|
+
// sometime we are creating a new role, so attempt to refresh our metadata
|
|
156
|
+
yield md.Refresh();
|
|
157
|
+
r = md.Roles.find(r => r.Name === this.RoleName);
|
|
158
|
+
if (!r)
|
|
159
|
+
throw new Error(`Role ${this.RoleName} not found`);
|
|
195
160
|
}
|
|
161
|
+
yield this.RoleRecord.Load(r.ID);
|
|
196
162
|
});
|
|
197
163
|
}
|
|
198
|
-
|
|
164
|
+
EditRecord() {
|
|
199
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
const tg = yield md.CreateTransactionGroup();
|
|
203
|
-
let itemCount = 0;
|
|
204
|
-
this.userRoles.forEach(ur => {
|
|
205
|
-
if (this.IsReallyDirty(ur)) {
|
|
206
|
-
ur.TransactionGroup = tg;
|
|
207
|
-
itemCount++;
|
|
208
|
-
// now, we have to determine if we are going to save the record or delete it
|
|
209
|
-
// if ur.Selected === false and we are in the database, we need to delete
|
|
210
|
-
// otherwise, we need to save
|
|
211
|
-
if (ur.Selected)
|
|
212
|
-
ur.Save();
|
|
213
|
-
else
|
|
214
|
-
ur.Delete();
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
if (itemCount > 0) {
|
|
218
|
-
if (yield tg.Submit()) {
|
|
219
|
-
// 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
|
|
220
|
-
this.userRoles.forEach(ur => {
|
|
221
|
-
if (ur.User === null) {
|
|
222
|
-
ur.Set('User', ur.SavedUserName); // get around the read-only property
|
|
223
|
-
ur.UserID = ur.SavedUserID;
|
|
224
|
-
ur.RoleName = this.RoleName;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
166
|
+
// show the dialog
|
|
167
|
+
this.showEntityEditingForm = true;
|
|
229
168
|
});
|
|
230
169
|
}
|
|
231
|
-
|
|
232
|
-
return this
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
// logic is simple, if we are in the database, but the checkbox is not checked (or vice versa), then we are dirty
|
|
236
|
-
if (ur.Selected && ur.ID > 0)
|
|
237
|
-
return false; // if we are in the database and the checkbox is checked, we are not dirty
|
|
238
|
-
else if (!ur.Selected && ur.ID > 0)
|
|
239
|
-
return true; // if we are in the database and the checkbox is not checked, we are dirty because we'd have to be removed
|
|
240
|
-
else if (ur.Selected)
|
|
241
|
-
return true; // if we are NOT in the database and the checkbox is checked, we are dirty because we'd have to be added
|
|
242
|
-
else
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
flipState($event, ur, flipState) {
|
|
246
|
-
if (flipState)
|
|
247
|
-
ur.Selected = !ur.Selected;
|
|
248
|
-
else
|
|
249
|
-
$event.stopPropagation();
|
|
170
|
+
onEntityFormClosed(result) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
this.showEntityEditingForm = false;
|
|
173
|
+
});
|
|
250
174
|
}
|
|
251
175
|
}
|
|
252
|
-
SingleRoleComponent.ɵfac = function SingleRoleComponent_Factory(t) { return new (t || SingleRoleComponent)(); };
|
|
253
|
-
SingleRoleComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleRoleComponent, selectors: [["mj-single-role"]],
|
|
176
|
+
SingleRoleComponent.ɵfac = function SingleRoleComponent_Factory(t) { return new (t || SingleRoleComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
177
|
+
SingleRoleComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleRoleComponent, selectors: [["mj-single-role"]], viewQuery: function SingleRoleComponent_Query(rf, ctx) { if (rf & 1) {
|
|
178
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
179
|
+
} if (rf & 2) {
|
|
180
|
+
let _t;
|
|
181
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.entityFormComponent = _t.first);
|
|
182
|
+
} }, inputs: { RoleName: "RoleName" }, decls: 5, vars: 8, consts: [["mjFillContainer", ""], [4, "ngIf"], ["SectionName", "details", "Mode", "section", 3, "Record", "Visible", "AutoRevertOnCancel", "HandleSave", "Width", "Height", "close"], ["entityForm", ""], [1, "role-info-table"], ["scope", "row"], [1, "edit-icon", 3, "icon", "click"], [3, "keepTabContent", "animate"], ["title", "Users", 3, "selected"], ["kendoTabContent", ""], ["title", "Entity Permissions"], ["Mode", "Roles", 3, "RoleName", "RoleRecord"], [1, "content"], ["Mode", "Role", 3, "RoleName", 4, "ngIf"], ["Mode", "Role", 3, "RoleName"]], template: function SingleRoleComponent_Template(rf, ctx) { if (rf & 1) {
|
|
254
183
|
i0.ɵɵelementStart(0, "div", 0);
|
|
255
|
-
i0.ɵɵtemplate(1, SingleRoleComponent_div_1_Template, 2, 0, "div", 1);
|
|
256
|
-
i0.ɵɵ
|
|
257
|
-
i0.ɵɵ
|
|
184
|
+
i0.ɵɵtemplate(1, SingleRoleComponent_div_1_Template, 2, 0, "div", 1)(2, SingleRoleComponent_div_2_Template, 29, 8, "div", 1);
|
|
185
|
+
i0.ɵɵelementEnd();
|
|
186
|
+
i0.ɵɵelementStart(3, "mj-entity-form-dialog", 2, 3);
|
|
187
|
+
i0.ɵɵlistener("close", function SingleRoleComponent_Template_mj_entity_form_dialog_close_3_listener($event) { return ctx.onEntityFormClosed($event); });
|
|
258
188
|
i0.ɵɵelementEnd();
|
|
259
|
-
i0.ɵɵelementStart(5, "kendo-tabstrip-tab", 5);
|
|
260
|
-
i0.ɵɵtemplate(6, SingleRoleComponent_ng_template_6_Template, 4, 2, "ng-template", 4);
|
|
261
|
-
i0.ɵɵelementEnd()()();
|
|
262
189
|
} if (rf & 2) {
|
|
263
190
|
i0.ɵɵadvance();
|
|
264
191
|
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
265
192
|
i0.ɵɵadvance();
|
|
266
|
-
i0.ɵɵproperty("
|
|
193
|
+
i0.ɵɵproperty("ngIf", !ctx.isLoading && ctx.RoleRecord);
|
|
267
194
|
i0.ɵɵadvance();
|
|
268
|
-
i0.ɵɵproperty("
|
|
269
|
-
} },
|
|
195
|
+
i0.ɵɵproperty("Record", ctx.RoleRecord)("Visible", ctx.showEntityEditingForm)("AutoRevertOnCancel", true)("HandleSave", true)("Width", 550)("Height", 450);
|
|
196
|
+
} }, styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\r\n\r\n.role-name[_ngcontent-%COMP%] {\r\n font-weight: bold;\r\n font-size: 20px;\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n\r\n.role-info-table[_ngcontent-%COMP%] {\r\n width: 100%; \n\r\n border-collapse: collapse; \n\r\n margin-bottom: 10px;\r\n}\r\n\r\n.role-info-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n width: 150px; \n\r\n font-weight: bold; \n\r\n text-align: left; \n\r\n padding: 8px; \n\r\n border: none; \n\r\n background-color: transparent; \n\r\n}\r\n\r\n.role-info-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n text-align: left; \n\r\n padding: 8px; \n\r\n border: none; \n\r\n background-color: transparent; \n\r\n overflow: hidden; \n\r\n text-overflow: ellipsis; \n\r\n}\r\n\r\n\n\r\n.edit-icon[_ngcontent-%COMP%] {\r\n margin-left: 20px; \r\n vertical-align: middle;;\r\n cursor: pointer; \n\r\n}\r\n\r\n.edit-icon[_ngcontent-%COMP%]:hover {\r\n fill: #007bff; \n\r\n}"] });
|
|
270
197
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleRoleComponent, [{
|
|
271
198
|
type: Component,
|
|
272
|
-
args: [{ selector: 'mj-single-role', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\"
|
|
273
|
-
}], () => [], { RoleName: [{
|
|
274
|
-
type: Input
|
|
275
|
-
}], BottomMargin: [{
|
|
199
|
+
args: [{ selector: 'mj-single-role', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n <div *ngIf=\"!isLoading && RoleRecord\">\r\n <table class=\"role-info-table\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\">Role</th>\r\n <td>{{RoleRecord.Name}}<kendo-svgicon class='edit-icon' [icon]=\"kendoSVGIcon('pencil')\" (click)=\"EditRecord()\"></kendo-svgicon></td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Description</th>\r\n <td>{{RoleRecord.Description}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Directory ID</th>\r\n <td>{{RoleRecord.DirectoryID}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">SQL Name</th>\r\n <td>{{RoleRecord.SQLName}}</td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n <kendo-tabstrip\r\n [keepTabContent]=\"true\"\r\n [animate]=\"false\" \r\n > \r\n <kendo-tabstrip-tab title=\"Users\" [selected]=\"true\">\r\n <ng-template kendoTabContent>\r\n <mj-user-roles-grid Mode=\"Roles\" [RoleName]=\"RoleName\" [RoleRecord]=\"RoleRecord\"></mj-user-roles-grid>\r\n </ng-template>\r\n </kendo-tabstrip-tab>\r\n <kendo-tabstrip-tab title=\"Entity Permissions\">\r\n <ng-template kendoTabContent>\r\n <div class=\"content\">\r\n <mj-entity-permissions-grid *ngIf=\"RoleRecord && RoleRecord.Name\" Mode=\"Role\" [RoleName]=\"RoleRecord.Name\" ></mj-entity-permissions-grid>\r\n </div>\r\n </ng-template>\r\n </kendo-tabstrip-tab>\r\n </kendo-tabstrip>\r\n </div>\r\n</div>\r\n \r\n<mj-entity-form-dialog #entityForm \r\n [Record]=\"RoleRecord\" \r\n SectionName=\"details\" \r\n Mode=\"section\" \r\n [Visible]=\"showEntityEditingForm\" \r\n [AutoRevertOnCancel]=\"true\"\r\n [HandleSave]=\"true\"\r\n [Width]=\"550\"\r\n [Height]=\"450\"\r\n (close)=\"onEntityFormClosed($event)\">\r\n</mj-entity-form-dialog>\r\n", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\r\n\r\n.role-name {\r\n font-weight: bold;\r\n font-size: 20px;\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n\r\n.role-info-table {\r\n width: 100%; /* Take up the full width of the container */\r\n border-collapse: collapse; /* For a cleaner look */\r\n margin-bottom: 10px;\r\n}\r\n\r\n.role-info-table th {\r\n width: 150px; /* Adjust this fixed width as needed */\r\n font-weight: bold; /* Make header labels bold */\r\n text-align: left; /* Align text to the left */\r\n padding: 8px; /* Add some padding for spacing */\r\n border: none; /* Removes the borders */\r\n background-color: transparent; /* Removes any background color */\r\n}\r\n\r\n.role-info-table td {\r\n text-align: left; /* Align text to the left */\r\n padding: 8px; /* Add some padding for spacing */\r\n border: none; /* Removes the borders */\r\n background-color: transparent; /* Removes any background color */\r\n overflow: hidden; /* Prevents content from overflowing */\r\n text-overflow: ellipsis; /* Adds an ellipsis if the text overflows */\r\n}\r\n\r\n/* Style for SVG icon */\r\n.edit-icon {\r\n margin-left: 20px; \r\n vertical-align: middle;;\r\n cursor: pointer; /* Changes the cursor to a pointer */\r\n}\r\n\r\n.edit-icon:hover {\r\n fill: #007bff; /* Changes the color on hover, set to the color you prefer */\r\n}"] }]
|
|
200
|
+
}], () => [{ type: i0.ChangeDetectorRef }], { RoleName: [{
|
|
276
201
|
type: Input
|
|
202
|
+
}], entityFormComponent: [{
|
|
203
|
+
type: ViewChild,
|
|
204
|
+
args: ['entityForm']
|
|
277
205
|
}] }); })();
|
|
278
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleRoleComponent, { className: "SingleRoleComponent", filePath: "src\\lib\\single-role\\single-role.component.ts", lineNumber:
|
|
206
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleRoleComponent, { className: "SingleRoleComponent", filePath: "src\\lib\\single-role\\single-role.component.ts", lineNumber: 49 }); })();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { RunViewParams } from '@memberjunction/core';
|
|
3
|
+
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
4
|
+
import { UserEntity } from '@memberjunction/core-entities';
|
|
5
|
+
import { EntityFormDialog } from '@memberjunction/ng-entity-form-dialog';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class SingleUserComponent implements OnInit {
|
|
8
|
+
private cdRef;
|
|
9
|
+
UserID: number;
|
|
10
|
+
entityFormComponent: EntityFormDialog;
|
|
11
|
+
gridHeight: number;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
UserRecord: UserEntity | null;
|
|
14
|
+
UserViewsParams: RunViewParams | undefined;
|
|
15
|
+
kendoSVGIcon: typeof kendoSVGIcon;
|
|
16
|
+
showEntityEditingForm: boolean;
|
|
17
|
+
constructor(cdRef: ChangeDetectorRef);
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
protected Refresh(): Promise<void>;
|
|
20
|
+
EditRecord(): Promise<void>;
|
|
21
|
+
onEntityFormClosed(result: 'Save' | 'Cancel'): Promise<void>;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SingleUserComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SingleUserComponent, "mj-single-user", never, { "UserID": { "alias": "UserID"; "required": false; }; }, {}, never, never, false, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
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, ViewChild } from '@angular/core';
|
|
11
|
+
import { Metadata } from '@memberjunction/core';
|
|
12
|
+
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@angular/common";
|
|
15
|
+
import * as i2 from "@memberjunction/ng-container-directives";
|
|
16
|
+
import * as i3 from "@progress/kendo-angular-icons";
|
|
17
|
+
import * as i4 from "@progress/kendo-angular-layout";
|
|
18
|
+
import * as i5 from "@memberjunction/ng-entity-form-dialog";
|
|
19
|
+
import * as i6 from "@progress/kendo-angular-indicators";
|
|
20
|
+
import * as i7 from "@memberjunction/ng-user-view-grid";
|
|
21
|
+
import * as i8 from "../user-roles-grid/user-roles-grid.component";
|
|
22
|
+
const _c0 = ["entityForm"];
|
|
23
|
+
function SingleUserComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementStart(0, "div");
|
|
25
|
+
i0.ɵɵelement(1, "kendo-loader");
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
27
|
+
} }
|
|
28
|
+
function SingleUserComponent_div_2_ng_template_41_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelement(0, "mj-user-roles-grid", 11);
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
32
|
+
i0.ɵɵproperty("UserID", ctx_r3.UserID)("UserRecord", ctx_r3.UserRecord);
|
|
33
|
+
} }
|
|
34
|
+
function SingleUserComponent_div_2_ng_template_43_mj_user_view_grid_1_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelement(0, "mj-user-view-grid", 14);
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const ctx_r5 = i0.ɵɵnextContext(3);
|
|
38
|
+
i0.ɵɵproperty("Params", ctx_r5.UserViewsParams);
|
|
39
|
+
} }
|
|
40
|
+
function SingleUserComponent_div_2_ng_template_43_Template(rf, ctx) { if (rf & 1) {
|
|
41
|
+
i0.ɵɵelementStart(0, "div", 12);
|
|
42
|
+
i0.ɵɵtemplate(1, SingleUserComponent_div_2_ng_template_43_mj_user_view_grid_1_Template, 1, 1, "mj-user-view-grid", 13);
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
} if (rf & 2) {
|
|
45
|
+
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
46
|
+
i0.ɵɵadvance();
|
|
47
|
+
i0.ɵɵproperty("ngIf", ctx_r4.UserViewsParams);
|
|
48
|
+
} }
|
|
49
|
+
function SingleUserComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
|
51
|
+
i0.ɵɵelementStart(0, "div")(1, "table", 4)(2, "tbody")(3, "tr")(4, "th", 5);
|
|
52
|
+
i0.ɵɵtext(5, "User");
|
|
53
|
+
i0.ɵɵelementEnd();
|
|
54
|
+
i0.ɵɵelementStart(6, "td");
|
|
55
|
+
i0.ɵɵtext(7);
|
|
56
|
+
i0.ɵɵelementStart(8, "kendo-svgicon", 6);
|
|
57
|
+
i0.ɵɵlistener("click", function SingleUserComponent_div_2_Template_kendo_svgicon_click_8_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.EditRecord()); });
|
|
58
|
+
i0.ɵɵelementEnd()()();
|
|
59
|
+
i0.ɵɵelementStart(9, "tr")(10, "th", 5);
|
|
60
|
+
i0.ɵɵtext(11, "First Name");
|
|
61
|
+
i0.ɵɵelementEnd();
|
|
62
|
+
i0.ɵɵelementStart(12, "td");
|
|
63
|
+
i0.ɵɵtext(13);
|
|
64
|
+
i0.ɵɵelementEnd()();
|
|
65
|
+
i0.ɵɵelementStart(14, "tr")(15, "th", 5);
|
|
66
|
+
i0.ɵɵtext(16, "Last Name");
|
|
67
|
+
i0.ɵɵelementEnd();
|
|
68
|
+
i0.ɵɵelementStart(17, "td");
|
|
69
|
+
i0.ɵɵtext(18);
|
|
70
|
+
i0.ɵɵelementEnd()();
|
|
71
|
+
i0.ɵɵelementStart(19, "tr")(20, "th", 5);
|
|
72
|
+
i0.ɵɵtext(21, "Title");
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
74
|
+
i0.ɵɵelementStart(22, "td");
|
|
75
|
+
i0.ɵɵtext(23);
|
|
76
|
+
i0.ɵɵelementEnd()();
|
|
77
|
+
i0.ɵɵelementStart(24, "tr")(25, "th", 5);
|
|
78
|
+
i0.ɵɵtext(26, "Email");
|
|
79
|
+
i0.ɵɵelementEnd();
|
|
80
|
+
i0.ɵɵelementStart(27, "td");
|
|
81
|
+
i0.ɵɵtext(28);
|
|
82
|
+
i0.ɵɵelementEnd()();
|
|
83
|
+
i0.ɵɵelementStart(29, "tr")(30, "th", 5);
|
|
84
|
+
i0.ɵɵtext(31, "Type");
|
|
85
|
+
i0.ɵɵelementEnd();
|
|
86
|
+
i0.ɵɵelementStart(32, "td");
|
|
87
|
+
i0.ɵɵtext(33);
|
|
88
|
+
i0.ɵɵelementEnd()();
|
|
89
|
+
i0.ɵɵelementStart(34, "tr")(35, "th", 5);
|
|
90
|
+
i0.ɵɵtext(36, "Is Active");
|
|
91
|
+
i0.ɵɵelementEnd();
|
|
92
|
+
i0.ɵɵelementStart(37, "td");
|
|
93
|
+
i0.ɵɵtext(38);
|
|
94
|
+
i0.ɵɵelementEnd()()()();
|
|
95
|
+
i0.ɵɵelementStart(39, "kendo-tabstrip", 7)(40, "kendo-tabstrip-tab", 8);
|
|
96
|
+
i0.ɵɵtemplate(41, SingleUserComponent_div_2_ng_template_41_Template, 1, 2, "ng-template", 9);
|
|
97
|
+
i0.ɵɵelementEnd();
|
|
98
|
+
i0.ɵɵelementStart(42, "kendo-tabstrip-tab", 10);
|
|
99
|
+
i0.ɵɵtemplate(43, SingleUserComponent_div_2_ng_template_43_Template, 2, 1, "ng-template", 9);
|
|
100
|
+
i0.ɵɵelementEnd()()();
|
|
101
|
+
} if (rf & 2) {
|
|
102
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
103
|
+
i0.ɵɵadvance(7);
|
|
104
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.Name);
|
|
105
|
+
i0.ɵɵadvance();
|
|
106
|
+
i0.ɵɵproperty("icon", ctx_r1.kendoSVGIcon("pencil"));
|
|
107
|
+
i0.ɵɵadvance(5);
|
|
108
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.FirstName);
|
|
109
|
+
i0.ɵɵadvance(5);
|
|
110
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.LastName);
|
|
111
|
+
i0.ɵɵadvance(5);
|
|
112
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.Title);
|
|
113
|
+
i0.ɵɵadvance(5);
|
|
114
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.Email);
|
|
115
|
+
i0.ɵɵadvance(5);
|
|
116
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.Type);
|
|
117
|
+
i0.ɵɵadvance(5);
|
|
118
|
+
i0.ɵɵtextInterpolate(ctx_r1.UserRecord.IsActive);
|
|
119
|
+
i0.ɵɵadvance();
|
|
120
|
+
i0.ɵɵproperty("keepTabContent", true)("animate", false);
|
|
121
|
+
i0.ɵɵadvance();
|
|
122
|
+
i0.ɵɵproperty("selected", true);
|
|
123
|
+
} }
|
|
124
|
+
export class SingleUserComponent {
|
|
125
|
+
constructor(cdRef) {
|
|
126
|
+
this.cdRef = cdRef;
|
|
127
|
+
this.gridHeight = 750;
|
|
128
|
+
this.isLoading = false;
|
|
129
|
+
this.UserRecord = null;
|
|
130
|
+
this.kendoSVGIcon = kendoSVGIcon;
|
|
131
|
+
this.showEntityEditingForm = false;
|
|
132
|
+
}
|
|
133
|
+
ngOnInit() {
|
|
134
|
+
this.Refresh();
|
|
135
|
+
}
|
|
136
|
+
Refresh() {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
if (this.UserID > 0) {
|
|
139
|
+
const md = new Metadata();
|
|
140
|
+
this.UserRecord = yield md.GetEntityObject('Users');
|
|
141
|
+
yield this.UserRecord.Load(this.UserID);
|
|
142
|
+
this.UserViewsParams = {
|
|
143
|
+
EntityName: 'User Views',
|
|
144
|
+
ExtraFilter: `UserID = ${this.UserID}`,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
EditRecord() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
// show the dialog
|
|
152
|
+
this.showEntityEditingForm = true;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
onEntityFormClosed(result) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
this.showEntityEditingForm = false;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
SingleUserComponent.ɵfac = function SingleUserComponent_Factory(t) { return new (t || SingleUserComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
162
|
+
SingleUserComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleUserComponent, selectors: [["mj-single-user"]], viewQuery: function SingleUserComponent_Query(rf, ctx) { if (rf & 1) {
|
|
163
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
164
|
+
} if (rf & 2) {
|
|
165
|
+
let _t;
|
|
166
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.entityFormComponent = _t.first);
|
|
167
|
+
} }, inputs: { UserID: "UserID" }, decls: 5, vars: 8, consts: [["mjFillContainer", ""], [4, "ngIf"], ["SectionName", "details", "Mode", "section", 3, "Record", "Visible", "AutoRevertOnCancel", "HandleSave", "Width", "Height", "close"], ["entityForm", ""], [1, "info-table"], ["scope", "row"], [1, "edit-icon", 3, "icon", "click"], [3, "keepTabContent", "animate"], ["title", "Roles", 3, "selected"], ["kendoTabContent", ""], ["title", "Views"], ["Mode", "Users", 3, "UserID", "UserRecord"], [1, "content"], [3, "Params", 4, "ngIf"], [3, "Params"]], template: function SingleUserComponent_Template(rf, ctx) { if (rf & 1) {
|
|
168
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
169
|
+
i0.ɵɵtemplate(1, SingleUserComponent_div_1_Template, 2, 0, "div", 1)(2, SingleUserComponent_div_2_Template, 44, 11, "div", 1);
|
|
170
|
+
i0.ɵɵelementEnd();
|
|
171
|
+
i0.ɵɵelementStart(3, "mj-entity-form-dialog", 2, 3);
|
|
172
|
+
i0.ɵɵlistener("close", function SingleUserComponent_Template_mj_entity_form_dialog_close_3_listener($event) { return ctx.onEntityFormClosed($event); });
|
|
173
|
+
i0.ɵɵelementEnd();
|
|
174
|
+
} if (rf & 2) {
|
|
175
|
+
i0.ɵɵadvance();
|
|
176
|
+
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
177
|
+
i0.ɵɵadvance();
|
|
178
|
+
i0.ɵɵproperty("ngIf", !ctx.isLoading && ctx.UserRecord);
|
|
179
|
+
i0.ɵɵadvance();
|
|
180
|
+
i0.ɵɵproperty("Record", ctx.UserRecord)("Visible", ctx.showEntityEditingForm)("AutoRevertOnCancel", true)("HandleSave", true)("Width", 550)("Height", 450);
|
|
181
|
+
} }, dependencies: [i1.NgIf, i2.FillContainer, i3.SVGIconComponent, i4.TabStripComponent, i4.TabStripTabComponent, i4.TabContentDirective, i5.EntityFormDialog, i6.LoaderComponent, i7.UserViewGridComponent, i8.UserRolesGridComponent], styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\r\n\r\n.name[_ngcontent-%COMP%] {\r\n font-weight: bold;\r\n font-size: 20px;\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n\r\n.info-table[_ngcontent-%COMP%] {\r\n width: 100%; \n\r\n border-collapse: collapse; \n\r\n margin-bottom: 10px;\r\n}\r\n\r\n.info-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n width: 150px; \n\r\n font-weight: bold; \n\r\n text-align: left; \n\r\n padding: 8px; \n\r\n border: none; \n\r\n background-color: transparent; \n\r\n}\r\n\r\n.info-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n text-align: left; \n\r\n padding: 8px; \n\r\n border: none; \n\r\n background-color: transparent; \n\r\n overflow: hidden; \n\r\n text-overflow: ellipsis; \n\r\n}\r\n\r\n\n\r\n.edit-icon[_ngcontent-%COMP%] {\r\n margin-left: 20px; \r\n vertical-align: middle;;\r\n cursor: pointer; \n\r\n}\r\n\r\n.edit-icon[_ngcontent-%COMP%]:hover {\r\n fill: #007bff; \n\r\n}"] });
|
|
182
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleUserComponent, [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{ selector: 'mj-single-user', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n <div *ngIf=\"!isLoading && UserRecord\">\r\n <table class=\"info-table\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\">User</th>\r\n <td>{{UserRecord.Name}}<kendo-svgicon class='edit-icon' [icon]=\"kendoSVGIcon('pencil')\" (click)=\"EditRecord()\"></kendo-svgicon></td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">First Name</th>\r\n <td>{{UserRecord.FirstName}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Last Name</th>\r\n <td>{{UserRecord.LastName}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Title</th>\r\n <td>{{UserRecord.Title}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Email</th>\r\n <td>{{UserRecord.Email}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Type</th>\r\n <td>{{UserRecord.Type}}</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">Is Active</th>\r\n <td>{{UserRecord.IsActive}}</td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n <kendo-tabstrip\r\n [keepTabContent]=\"true\"\r\n [animate]=\"false\" \r\n > \r\n <kendo-tabstrip-tab title=\"Roles\" [selected]=\"true\">\r\n <ng-template kendoTabContent>\r\n <mj-user-roles-grid Mode=\"Users\" [UserID]=\"UserID\" [UserRecord]=\"UserRecord\"></mj-user-roles-grid>\r\n </ng-template>\r\n </kendo-tabstrip-tab>\r\n <kendo-tabstrip-tab title=\"Views\">\r\n <ng-template kendoTabContent>\r\n <div class=\"content\">\r\n <mj-user-view-grid *ngIf=\"UserViewsParams\" [Params]=\"UserViewsParams\"></mj-user-view-grid>\r\n </div>\r\n </ng-template>\r\n </kendo-tabstrip-tab>\r\n </kendo-tabstrip>\r\n </div>\r\n</div>\r\n\r\n\r\n<mj-entity-form-dialog #entityForm \r\n [Record]=\"UserRecord\" \r\n SectionName=\"details\" \r\n Mode=\"section\" \r\n [Visible]=\"showEntityEditingForm\" \r\n [AutoRevertOnCancel]=\"true\"\r\n [HandleSave]=\"true\"\r\n [Width]=\"550\"\r\n [Height]=\"450\"\r\n (close)=\"onEntityFormClosed($event)\">\r\n</mj-entity-form-dialog>\r\n", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\r\n\r\n.name {\r\n font-weight: bold;\r\n font-size: 20px;\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n\r\n.info-table {\r\n width: 100%; /* Take up the full width of the container */\r\n border-collapse: collapse; /* For a cleaner look */\r\n margin-bottom: 10px;\r\n}\r\n\r\n.info-table th {\r\n width: 150px; /* Adjust this fixed width as needed */\r\n font-weight: bold; /* Make header labels bold */\r\n text-align: left; /* Align text to the left */\r\n padding: 8px; /* Add some padding for spacing */\r\n border: none; /* Removes the borders */\r\n background-color: transparent; /* Removes any background color */\r\n}\r\n\r\n.info-table td {\r\n text-align: left; /* Align text to the left */\r\n padding: 8px; /* Add some padding for spacing */\r\n border: none; /* Removes the borders */\r\n background-color: transparent; /* Removes any background color */\r\n overflow: hidden; /* Prevents content from overflowing */\r\n text-overflow: ellipsis; /* Adds an ellipsis if the text overflows */\r\n}\r\n\r\n/* Style for SVG icon */\r\n.edit-icon {\r\n margin-left: 20px; \r\n vertical-align: middle;;\r\n cursor: pointer; /* Changes the cursor to a pointer */\r\n}\r\n\r\n.edit-icon:hover {\r\n fill: #007bff; /* Changes the color on hover, set to the color you prefer */\r\n}"] }]
|
|
185
|
+
}], () => [{ type: i0.ChangeDetectorRef }], { UserID: [{
|
|
186
|
+
type: Input
|
|
187
|
+
}], entityFormComponent: [{
|
|
188
|
+
type: ViewChild,
|
|
189
|
+
args: ['entityForm']
|
|
190
|
+
}] }); })();
|
|
191
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleUserComponent, { className: "SingleUserComponent", filePath: "src\\lib\\single-user\\single-user.component.ts", lineNumber: 14 }); })();
|