@memberjunction/ng-explorer-settings 0.9.10 → 0.9.13

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.
Files changed (25) hide show
  1. package/dist/lib/application-entities-grid/application-entities-grid.component.d.ts +51 -0
  2. package/dist/lib/application-entities-grid/application-entities-grid.component.js +348 -0
  3. package/dist/lib/entity-form-dialog/entity-form-dialog.component.d.ts +33 -0
  4. package/dist/lib/entity-form-dialog/entity-form-dialog.component.js +183 -0
  5. package/dist/lib/entity-form-window/entity-form-window.component.d.ts +17 -0
  6. package/dist/lib/entity-form-window/entity-form-window.component.js +99 -0
  7. package/dist/lib/module.d.ts +21 -14
  8. package/dist/lib/module.js +50 -8
  9. package/dist/lib/record-list/record-list.component.d.ts +41 -0
  10. package/dist/lib/record-list/record-list.component.js +324 -0
  11. package/dist/lib/roles-list/roles-list.component.d.ts +11 -1
  12. package/dist/lib/roles-list/roles-list.component.js +125 -26
  13. package/dist/lib/settings/settings.component.d.ts +26 -2
  14. package/dist/lib/settings/settings.component.js +136 -66
  15. package/dist/lib/single-application/single-application.component.d.ts +22 -0
  16. package/dist/lib/single-application/single-application.component.js +144 -0
  17. package/dist/lib/single-role/single-role.component.d.ts +16 -13
  18. package/dist/lib/single-role/single-role.component.js +112 -182
  19. package/dist/lib/single-user/single-user.component.d.ts +24 -0
  20. package/dist/lib/single-user/single-user.component.js +191 -0
  21. package/dist/lib/user-roles-grid/user-roles-grid.component.d.ts +41 -0
  22. package/dist/lib/user-roles-grid/user-roles-grid.component.js +320 -0
  23. package/dist/public-api.d.ts +4 -1
  24. package/dist/public-api.js +4 -1
  25. package/package.json +9 -4
@@ -9,52 +9,88 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Component } from '@angular/core';
11
11
  import { Metadata, RunView } from '@memberjunction/core';
12
+ import { SharedService, kendoSVGIcon } from '@memberjunction/ng-shared';
12
13
  import * as i0 from "@angular/core";
13
14
  import * as i1 from "@angular/router";
14
15
  import * as i2 from "@angular/common";
15
- import * as i3 from "@memberjunction/ng-container-directives";
16
- function RolesListComponent_div_1_Template(rf, ctx) { if (rf & 1) {
16
+ import * as i3 from "@progress/kendo-angular-dialog";
17
+ import * as i4 from "@memberjunction/ng-container-directives";
18
+ import * as i5 from "@progress/kendo-angular-buttons";
19
+ import * as i6 from "@progress/kendo-angular-icons";
20
+ import * as i7 from "@memberjunction/ng-entity-form-dialog";
21
+ import * as i8 from "@progress/kendo-angular-indicators";
22
+ function RolesListComponent_div_3_Template(rf, ctx) { if (rf & 1) {
17
23
  i0.ɵɵelementStart(0, "div");
18
- i0.ɵɵtext(1, "Loading...");
24
+ i0.ɵɵelement(1, "kendo-loader");
19
25
  i0.ɵɵelementEnd();
20
26
  } }
21
- function RolesListComponent_table_2_tr_8_Template(rf, ctx) { if (rf & 1) {
22
- const _r5 = i0.ɵɵgetCurrentView();
23
- i0.ɵɵelementStart(0, "tr", 5);
24
- i0.ɵɵlistener("click", function RolesListComponent_table_2_tr_8_Template_tr_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r5); const r_r3 = restoredCtx.$implicit; const ctx_r4 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r4.selectRole(r_r3)); });
25
- i0.ɵɵelementStart(1, "td");
26
- i0.ɵɵtext(2);
27
+ function RolesListComponent_table_4_tr_8_Template(rf, ctx) { if (rf & 1) {
28
+ const _r7 = i0.ɵɵgetCurrentView();
29
+ i0.ɵɵelementStart(0, "tr", 9);
30
+ i0.ɵɵlistener("click", function RolesListComponent_table_4_tr_8_Template_tr_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r7); const r_r5 = restoredCtx.$implicit; const ctx_r6 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r6.selectRole(undefined, r_r5)); });
31
+ i0.ɵɵelementStart(1, "td")(2, "span");
32
+ i0.ɵɵtext(3);
27
33
  i0.ɵɵelementEnd();
28
- i0.ɵɵelementStart(3, "td");
29
- i0.ɵɵtext(4);
30
- i0.ɵɵelementEnd()();
34
+ i0.ɵɵelementStart(4, "span")(5, "kendo-svgicon", 10);
35
+ i0.ɵɵlistener("click", function RolesListComponent_table_4_tr_8_Template_kendo_svgicon_click_5_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r7); const r_r5 = restoredCtx.$implicit; const ctx_r8 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r8.deleteRole($event, r_r5)); });
36
+ i0.ɵɵelementEnd()()();
37
+ i0.ɵɵelementStart(6, "td")(7, "span");
38
+ i0.ɵɵtext(8);
39
+ i0.ɵɵelementEnd()()();
31
40
  } if (rf & 2) {
32
- const r_r3 = ctx.$implicit;
41
+ const r_r5 = ctx.$implicit;
42
+ const ctx_r4 = i0.ɵɵnextContext(2);
43
+ i0.ɵɵadvance(3);
44
+ i0.ɵɵtextInterpolate(r_r5.Name);
33
45
  i0.ɵɵadvance(2);
34
- i0.ɵɵtextInterpolate(r_r3.Name);
35
- i0.ɵɵadvance(2);
36
- i0.ɵɵtextInterpolate(r_r3.Description);
46
+ i0.ɵɵproperty("icon", ctx_r4.kendoSVGIcon("trash"));
47
+ i0.ɵɵadvance(3);
48
+ i0.ɵɵtextInterpolate(r_r5.Description);
37
49
  } }
38
- function RolesListComponent_table_2_Template(rf, ctx) { if (rf & 1) {
39
- i0.ɵɵelementStart(0, "table", 3)(1, "thead")(2, "tr")(3, "th");
50
+ function RolesListComponent_table_4_Template(rf, ctx) { if (rf & 1) {
51
+ i0.ɵɵelementStart(0, "table", 7)(1, "thead")(2, "tr")(3, "th");
40
52
  i0.ɵɵtext(4, "Role");
41
53
  i0.ɵɵelementEnd();
42
54
  i0.ɵɵelementStart(5, "th");
43
55
  i0.ɵɵtext(6, "Description");
44
56
  i0.ɵɵelementEnd()()();
45
57
  i0.ɵɵelementStart(7, "tbody");
46
- i0.ɵɵtemplate(8, RolesListComponent_table_2_tr_8_Template, 5, 2, "tr", 4);
58
+ i0.ɵɵtemplate(8, RolesListComponent_table_4_tr_8_Template, 9, 3, "tr", 8);
47
59
  i0.ɵɵelementEnd()();
48
60
  } if (rf & 2) {
49
61
  const ctx_r1 = i0.ɵɵnextContext();
50
62
  i0.ɵɵadvance(8);
51
63
  i0.ɵɵproperty("ngForOf", ctx_r1.roles);
52
64
  } }
65
+ function RolesListComponent_kendo_dialog_7_Template(rf, ctx) { if (rf & 1) {
66
+ const _r10 = i0.ɵɵgetCurrentView();
67
+ i0.ɵɵelementStart(0, "kendo-dialog", 11);
68
+ i0.ɵɵlistener("close", function RolesListComponent_kendo_dialog_7_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.closeDeleteRoleDialog("No")); });
69
+ i0.ɵɵelementStart(1, "div");
70
+ i0.ɵɵtext(2);
71
+ i0.ɵɵelementEnd();
72
+ i0.ɵɵelementStart(3, "kendo-dialog-actions")(4, "button", 12);
73
+ i0.ɵɵlistener("click", function RolesListComponent_kendo_dialog_7_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r10); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.closeDeleteRoleDialog("Yes")); });
74
+ i0.ɵɵtext(5, "Yes");
75
+ i0.ɵɵelementEnd();
76
+ i0.ɵɵelementStart(6, "button", 1);
77
+ i0.ɵɵlistener("click", function RolesListComponent_kendo_dialog_7_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r10); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.closeDeleteRoleDialog("No")); });
78
+ i0.ɵɵtext(7, "No");
79
+ i0.ɵɵelementEnd()()();
80
+ } if (rf & 2) {
81
+ const ctx_r3 = i0.ɵɵnextContext();
82
+ i0.ɵɵproperty("width", 300)("height", 200);
83
+ i0.ɵɵadvance(2);
84
+ i0.ɵɵtextInterpolate1(" Are you sure you want to delete the role '", ctx_r3.deleteRoleRecord.Name, "'? ");
85
+ } }
53
86
  export class RolesListComponent {
54
87
  constructor(router) {
55
88
  this.router = router;
56
89
  this.isLoading = false;
57
90
  this.roles = [];
91
+ this.kendoSVGIcon = kendoSVGIcon;
92
+ this.deleteRoleDialogVisible = false;
93
+ this.showNewRoleForm = false;
58
94
  }
59
95
  ngOnInit() {
60
96
  this.Refresh();
@@ -79,24 +115,87 @@ export class RolesListComponent {
79
115
  this.isLoading = false;
80
116
  });
81
117
  }
82
- selectRole(r) {
118
+ selectRole(event, r) {
119
+ if (event)
120
+ event.stopPropagation(); // prevent row from getting click
83
121
  // change the route to point to the /settings/role/{r.Name} route
84
122
  this.router.navigate(['/settings/role', r.Name]);
85
123
  }
124
+ deleteRole(event, r) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ // confirm with the user first
127
+ this.deleteRoleRecord = r;
128
+ this.deleteRoleDialogVisible = true;
129
+ event.stopPropagation(); // prevent row from getting click
130
+ });
131
+ }
132
+ closeDeleteRoleDialog(result) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ // if the user confirms, delete the role
135
+ this.deleteRoleDialogVisible = false;
136
+ if (result === 'Yes') {
137
+ if (!(yield this.deleteRoleRecord.Delete())) {
138
+ // show an error message
139
+ SharedService.Instance.CreateSimpleNotification('Error deleting role', 'error', 3000);
140
+ }
141
+ else
142
+ this.Refresh(); // refresh the list
143
+ }
144
+ this.deleteRoleRecord = null;
145
+ });
146
+ }
147
+ createNewRole() {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ // attempt to create a new role and if success, navigate to the new role
150
+ const md = new Metadata();
151
+ this.newRoleRecord = yield md.GetEntityObject('Roles');
152
+ if (this.newRoleRecord) {
153
+ this.newRoleRecord.NewRecord();
154
+ this.showNewRoleForm = true;
155
+ }
156
+ });
157
+ }
158
+ onNewRoleFormClosed(result) {
159
+ return __awaiter(this, void 0, void 0, function* () {
160
+ this.showNewRoleForm = false;
161
+ if (result === 'Save') {
162
+ // the dialog already saved the record, just check to make sure it was saved and if so, navigate
163
+ if (this.newRoleRecord.ID) {
164
+ const md = new Metadata();
165
+ // force a refresh since we have a new role
166
+ SharedService.Instance.CreateSimpleNotification('Role created successfully, refreshing metadata...', 'info', 3000);
167
+ this.router.navigate(['/settings/role', this.newRoleRecord.Name]);
168
+ }
169
+ else
170
+ throw new Error('New role record was not saved');
171
+ }
172
+ });
173
+ }
86
174
  }
87
175
  RolesListComponent.ɵfac = function RolesListComponent_Factory(t) { return new (t || RolesListComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
88
- RolesListComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RolesListComponent, selectors: [["mj-roles-list"]], decls: 3, vars: 2, consts: [["mjFillContainer", ""], [4, "ngIf"], ["class", "grid", 4, "ngIf"], [1, "grid"], [3, "click", 4, "ngFor", "ngForOf"], [3, "click"]], template: function RolesListComponent_Template(rf, ctx) { if (rf & 1) {
89
- i0.ɵɵelementStart(0, "div", 0);
90
- i0.ɵɵtemplate(1, RolesListComponent_div_1_Template, 2, 0, "div", 1)(2, RolesListComponent_table_2_Template, 9, 1, "table", 2);
176
+ RolesListComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RolesListComponent, selectors: [["mj-roles-list"]], decls: 8, vars: 9, consts: [["mjFillContainer", "", 1, "wrapper"], ["kendoButton", "", 3, "click"], [4, "ngIf"], ["class", "grid", 4, "ngIf"], ["SectionName", "details", "Mode", "section", 3, "Record", "Visible", "AutoRevertOnCancel", "HandleSave", "Width", "Height", "close"], ["entityForm", ""], ["title", "Delete Role?", 3, "width", "height", "close", 4, "ngIf"], [1, "grid"], [3, "click", 4, "ngFor", "ngForOf"], [3, "click"], [1, "icon", 3, "icon", "click"], ["title", "Delete Role?", 3, "width", "height", "close"], ["kendoButton", "", "themeColor", "primary", 3, "click"]], template: function RolesListComponent_Template(rf, ctx) { if (rf & 1) {
177
+ i0.ɵɵelementStart(0, "div", 0)(1, "button", 1);
178
+ i0.ɵɵlistener("click", function RolesListComponent_Template_button_click_1_listener() { return ctx.createNewRole(); });
179
+ i0.ɵɵtext(2, "New Role");
91
180
  i0.ɵɵelementEnd();
181
+ i0.ɵɵtemplate(3, RolesListComponent_div_3_Template, 2, 0, "div", 2)(4, RolesListComponent_table_4_Template, 9, 1, "table", 3);
182
+ i0.ɵɵelementEnd();
183
+ i0.ɵɵelementStart(5, "mj-entity-form-dialog", 4, 5);
184
+ i0.ɵɵlistener("close", function RolesListComponent_Template_mj_entity_form_dialog_close_5_listener($event) { return ctx.onNewRoleFormClosed($event); });
185
+ i0.ɵɵelementEnd();
186
+ i0.ɵɵtemplate(7, RolesListComponent_kendo_dialog_7_Template, 8, 3, "kendo-dialog", 6);
92
187
  } if (rf & 2) {
93
- i0.ɵɵadvance();
188
+ i0.ɵɵadvance(3);
94
189
  i0.ɵɵproperty("ngIf", ctx.isLoading);
95
190
  i0.ɵɵadvance();
96
191
  i0.ɵɵproperty("ngIf", !ctx.isLoading);
97
- } }, dependencies: [i2.NgForOf, i2.NgIf, i3.FillContainer], styles: ["\n\r\ntable[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; \n\r\n}\r\n\r\nbutton[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2; \n\r\n color: black; \n\r\n font-weight: bold; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray; \n\r\n height: 36px; \n\r\n text-align: center;\r\n padding: 0 8px; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n width: 150px; \n\r\n text-align: left;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff; \n\r\n}"] });
192
+ i0.ɵɵadvance();
193
+ i0.ɵɵproperty("Record", ctx.newRoleRecord)("Visible", ctx.showNewRoleForm)("AutoRevertOnCancel", true)("HandleSave", true)("Width", 550)("Height", 450);
194
+ i0.ɵɵadvance(2);
195
+ i0.ɵɵproperty("ngIf", ctx.deleteRoleDialogVisible && ctx.deleteRoleRecord);
196
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3.DialogComponent, i3.DialogActionsComponent, i4.FillContainer, i5.ButtonComponent, i6.SVGIconComponent, i7.EntityFormDialog, i8.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.wrapper[_ngcontent-%COMP%] {\r\n padding-right: 10px;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 10px;\r\n margin-right: 5px;\r\n border-collapse: collapse; \n\r\n width: 100%;\r\n}\r\n \r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2; \n\r\n color: black; \n\r\n font-weight: bold; \n\r\n text-align: left;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n height: 36px; \n\r\n padding: 0 8px; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n display: flex; \n\r\n justify-content: space-between; \n\r\n align-items: center; \n\r\n padding-right: 8px; \n\r\n}\r\n\r\n\n\r\ntd[_ngcontent-%COMP%]:first-child span[_ngcontent-%COMP%]:first-child {\r\n border: none; \n\r\n}\r\n\r\n\n\r\ntd[_ngcontent-%COMP%]:first-child span[_ngcontent-%COMP%]:last-child {\r\n border: none; \n\r\n}\r\n\r\n\n\r\ntd[_ngcontent-%COMP%]:first-child .icon[_ngcontent-%COMP%] {\r\n margin-left: 10px; \n\r\n cursor: pointer; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover {\r\n background-color: #e7f4ff; \n\r\n}"] });
98
197
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RolesListComponent, [{
99
198
  type: Component,
100
- args: [{ selector: 'mj-roles-list', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\">Loading...</div>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th>Role</th>\r\n <th>Description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of roles\" (click)=\"selectRole(r)\">\r\n <td>{{ r.Name }}</td>\r\n <td>{{ r.Description }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n ", styles: ["/* Style for the whole table */\r\ntable {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; /* Ensures border collapse for a cleaner look */\r\n}\r\n\r\nbutton {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable th {\r\n background-color: #f2f2f2; /* Light gray background for headers */\r\n color: black; /* Black text color for headers */\r\n font-weight: bold; /* Bold font weight for headers */\r\n}\r\n\r\n/* Style for all table cells */\r\ntable th, table td {\r\n border: 1px solid gray; /* Gray border for cells */\r\n height: 36px; /* Fixed height for all rows */\r\n text-align: center;\r\n padding: 0 8px; /* Add some padding inside cells */\r\n}\r\n\r\n/* Specific styles for the first column */\r\ntable th:first-child, table td:first-child {\r\n width: 150px; /* Set width for the first column */\r\n text-align: left;\r\n}\r\n\r\n/* Specific styles for the \"Can\" columns */\r\ntable th:not(:first-child), table td:not(:first-child) {\r\n width: 100px; /* Set width for \"Can\" columns */\r\n}\r\n\r\ntable tr {\r\n cursor: pointer;\r\n}\r\n\r\n/* Alternating row background colors */\r\ntable tr:nth-child(odd) {\r\n background-color: white; /* Light color for odd rows */\r\n}\r\n\r\ntable tr:nth-child(even) {\r\n background-color: #e7f4ff; /* Light blue for even rows */\r\n}\r\n"] }]
199
+ args: [{ selector: 'mj-roles-list', template: "<div mjFillContainer class=\"wrapper\">\r\n <button kendoButton (click)=\"createNewRole()\">New Role</button>\r\n <div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th>Role</th>\r\n <th>Description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of roles\" (click)=\"selectRole(undefined, r)\">\r\n <td>\r\n <span>{{ r.Name }}</span> \r\n <span>\r\n <!-- <kendo-svgicon class='icon' [icon]=\"kendoSVGIcon('pencil')\" (click)=\"selectRole($event, r)\"></kendo-svgicon> -->\r\n <kendo-svgicon class='icon' [icon]=\"kendoSVGIcon('trash')\" (click)=\"deleteRole($event, r)\"></kendo-svgicon>\r\n </span>\r\n </td>\r\n <td><span>{{ r.Description }}</span></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n \r\n<mj-entity-form-dialog #entityForm \r\n [Record]=\"newRoleRecord\" \r\n SectionName=\"details\" \r\n Mode=\"section\" \r\n [Visible]=\"showNewRoleForm\" \r\n [AutoRevertOnCancel]=\"true\"\r\n [HandleSave]=\"true\"\r\n [Width]=\"550\"\r\n [Height]=\"450\"\r\n (close)=\"onNewRoleFormClosed($event)\">\r\n</mj-entity-form-dialog>\r\n\r\n<kendo-dialog\r\n *ngIf=\"deleteRoleDialogVisible && deleteRoleRecord\" \r\n title=\"Delete Role?\" \r\n [width]=\"300\"\r\n [height]=\"200\"\r\n (close)=\"closeDeleteRoleDialog('No')\" >\r\n <div>\r\n Are you sure you want to delete the role '{{deleteRoleRecord.Name}}'?\r\n </div>\r\n <kendo-dialog-actions>\r\n <button kendoButton (click)=\"closeDeleteRoleDialog('Yes')\" themeColor=\"primary\">Yes</button>\r\n <button kendoButton (click)=\"closeDeleteRoleDialog('No')\">No</button>\r\n </kendo-dialog-actions>\r\n</kendo-dialog>", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n.wrapper {\r\n padding-right: 10px;\r\n}\r\n\r\n/* Style for the whole table */\r\ntable {\r\n margin-left: 5px;\r\n margin-top: 10px;\r\n margin-right: 5px;\r\n border-collapse: collapse; /* Ensures border collapse for a cleaner look */\r\n width: 100%;\r\n}\r\n \r\ntable th {\r\n background-color: #f2f2f2; /* Light gray background for headers */\r\n color: black; /* Black text color for headers */\r\n font-weight: bold; /* Bold font weight for headers */\r\n text-align: left;\r\n}\r\n\r\n/* Style for all table cells */\r\ntable th, table td {\r\n height: 36px; /* Fixed height for all rows */\r\n padding: 0 8px; /* Add some padding inside cells */\r\n}\r\n\r\n/* Style for the first column cells */\r\ntable td:first-child {\r\n display: flex; /* Make the cell a flex container */\r\n justify-content: space-between; /* Space out the text and icons */\r\n align-items: center; /* Center items vertically */\r\n padding-right: 8px; /* Ensure there is some padding on the right */\r\n}\r\n\r\n/* Style for the text span within the first column */\r\ntd:first-child span:first-child {\r\n border: none; /* Ensures no border is applied to the span */\r\n}\r\n\r\n/* Style for the icons container span within the first column */\r\ntd:first-child span:last-child {\r\n border: none; /* Ensures no border is applied to the span */\r\n}\r\n\r\n/* Style for the icons within the first column */\r\ntd:first-child .icon {\r\n margin-left: 10px; /* Space between icons if needed */\r\n cursor: pointer; /* Change cursor to pointer on hover */\r\n}\r\n\r\ntable tr {\r\n cursor: pointer;\r\n}\r\n\r\ntable tr:hover {\r\n background-color: #e7f4ff; /* Light blue for even rows */\r\n}\r\n "] }]
101
200
  }], () => [{ type: i1.Router }], null); })();
102
201
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RolesListComponent, { className: "RolesListComponent", filePath: "src\\lib\\roles-list\\roles-list.component.ts", lineNumber: 15 }); })();
@@ -1,17 +1,41 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import { ActivatedRoute, Router } from '@angular/router';
3
+ import { BaseEntity } from '@memberjunction/core';
3
4
  import * as i0 from "@angular/core";
5
+ export declare enum SettingsItem {
6
+ EntityPermissions = "EntityPermissions",
7
+ Users = "Users",
8
+ User = "User",
9
+ Roles = "Roles",
10
+ Role = "Role",
11
+ Applications = "Applications",
12
+ Application = "Application"
13
+ }
4
14
  export declare class SettingsComponent implements OnInit {
5
15
  private router;
6
16
  private activatedRoute;
7
- currentItem: 'EntityPermissions' | 'Users' | 'Roles' | 'Role';
17
+ currentItem: SettingsItem;
8
18
  baseRoute: string;
9
19
  selectedRoleName: string;
10
- selectItem(item: 'EntityPermissions' | 'Users' | 'Roles' | 'Role', changeRoute?: boolean): void;
20
+ selectedUserID: number;
21
+ selectedApplicationName: string;
22
+ options: {
23
+ label: string;
24
+ value: SettingsItem;
25
+ }[];
26
+ selectItem(item: SettingsItem | string, changeRoute?: boolean): void;
11
27
  changeRoute(subPath: string): void;
12
28
  constructor(router: Router, activatedRoute: ActivatedRoute);
13
29
  ngOnInit(): void;
14
30
  updateComponentStateBasedOnPath(): void;
31
+ selectApplication(a: BaseEntity): void;
32
+ selectRole(r: BaseEntity): void;
33
+ selectUser(r: BaseEntity): void;
34
+ selectRoute(route: string, value: any): void;
35
+ leftNavItemSelected(option: {
36
+ label: string;
37
+ value: any;
38
+ }): boolean;
15
39
  static ɵfac: i0.ɵɵFactoryDeclaration<SettingsComponent, never>;
16
40
  static ɵcmp: i0.ɵɵComponentDeclaration<SettingsComponent, "mj-settings", never, {}, {}, never, never, false, never>;
17
41
  }
@@ -4,36 +4,102 @@ import { filter } from 'rxjs/operators';
4
4
  import * as i0 from "@angular/core";
5
5
  import * as i1 from "@angular/router";
6
6
  import * as i2 from "@angular/common";
7
- import * as i3 from "@memberjunction/ng-entity-permissions";
8
- import * as i4 from "../single-role/single-role.component";
9
- import * as i5 from "../roles-list/roles-list.component";
10
- function SettingsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
7
+ import * as i3 from "@memberjunction/ng-container-directives";
8
+ import * as i4 from "@memberjunction/ng-entity-permissions";
9
+ import * as i5 from "@memberjunction/ng-simple-record-list";
10
+ import * as i6 from "../single-role/single-role.component";
11
+ import * as i7 from "../single-user/single-user.component";
12
+ import * as i8 from "../single-application/single-application.component";
13
+ function SettingsComponent_div_2_Template(rf, ctx) { if (rf & 1) {
14
+ const _r10 = i0.ɵɵgetCurrentView();
15
+ i0.ɵɵelementStart(0, "div", 5);
16
+ i0.ɵɵlistener("click", function SettingsComponent_div_2_Template_div_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r10); const o_r8 = restoredCtx.$implicit; const ctx_r9 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r9.selectItem(o_r8.value)); });
17
+ i0.ɵɵtext(1);
18
+ i0.ɵɵelementEnd();
19
+ } if (rf & 2) {
20
+ const o_r8 = ctx.$implicit;
21
+ const ctx_r0 = i0.ɵɵnextContext();
22
+ i0.ɵɵclassProp("selected", ctx_r0.leftNavItemSelected(o_r8));
23
+ i0.ɵɵadvance();
24
+ i0.ɵɵtextInterpolate(o_r8.label);
25
+ } }
26
+ function SettingsComponent_div_4_Template(rf, ctx) { if (rf & 1) {
11
27
  i0.ɵɵelementStart(0, "div");
12
28
  i0.ɵɵelement(1, "mj-entity-permissions-selector-with-grid");
13
29
  i0.ɵɵelementEnd();
14
30
  } }
15
- function SettingsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
31
+ const _c0 = () => ["Name", "Email", "IsActive", "Type"];
32
+ function SettingsComponent_div_5_Template(rf, ctx) { if (rf & 1) {
33
+ const _r12 = i0.ɵɵgetCurrentView();
34
+ i0.ɵɵelementStart(0, "div")(1, "mj-simple-record-list", 6);
35
+ i0.ɵɵlistener("RecordSelected", function SettingsComponent_div_5_Template_mj_simple_record_list_RecordSelected_1_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.selectUser($event)); });
36
+ i0.ɵɵelementEnd()();
37
+ } if (rf & 2) {
38
+ i0.ɵɵadvance();
39
+ i0.ɵɵproperty("Columns", i0.ɵɵpureFunction0(1, _c0));
40
+ } }
41
+ function SettingsComponent_div_6_Template(rf, ctx) { if (rf & 1) {
16
42
  i0.ɵɵelementStart(0, "div");
17
- i0.ɵɵtext(1, " Users Component Goes Here ");
43
+ i0.ɵɵelement(1, "mj-single-user", 7);
18
44
  i0.ɵɵelementEnd();
45
+ } if (rf & 2) {
46
+ const ctx_r3 = i0.ɵɵnextContext();
47
+ i0.ɵɵadvance();
48
+ i0.ɵɵproperty("UserID", ctx_r3.selectedUserID);
49
+ } }
50
+ const _c1 = () => ["Name", "Description"];
51
+ function SettingsComponent_div_7_Template(rf, ctx) { if (rf & 1) {
52
+ const _r14 = i0.ɵɵgetCurrentView();
53
+ i0.ɵɵelementStart(0, "div")(1, "mj-simple-record-list", 8);
54
+ i0.ɵɵlistener("RecordSelected", function SettingsComponent_div_7_Template_mj_simple_record_list_RecordSelected_1_listener($event) { i0.ɵɵrestoreView(_r14); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.selectRole($event)); });
55
+ i0.ɵɵelementEnd()();
56
+ } if (rf & 2) {
57
+ i0.ɵɵadvance();
58
+ i0.ɵɵproperty("Columns", i0.ɵɵpureFunction0(1, _c1));
19
59
  } }
20
- function SettingsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
60
+ function SettingsComponent_div_8_Template(rf, ctx) { if (rf & 1) {
21
61
  i0.ɵɵelementStart(0, "div");
22
- i0.ɵɵelement(1, "mj-roles-list");
62
+ i0.ɵɵelement(1, "mj-single-role", 9);
23
63
  i0.ɵɵelementEnd();
64
+ } if (rf & 2) {
65
+ const ctx_r5 = i0.ɵɵnextContext();
66
+ i0.ɵɵadvance();
67
+ i0.ɵɵproperty("RoleName", ctx_r5.selectedRoleName);
24
68
  } }
25
- function SettingsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
69
+ function SettingsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
70
+ const _r16 = i0.ɵɵgetCurrentView();
71
+ i0.ɵɵelementStart(0, "div")(1, "mj-simple-record-list", 10);
72
+ i0.ɵɵlistener("RecordSelected", function SettingsComponent_div_9_Template_mj_simple_record_list_RecordSelected_1_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.selectApplication($event)); });
73
+ i0.ɵɵelementEnd()();
74
+ } if (rf & 2) {
75
+ i0.ɵɵadvance();
76
+ i0.ɵɵproperty("Columns", i0.ɵɵpureFunction0(1, _c1));
77
+ } }
78
+ function SettingsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
26
79
  i0.ɵɵelementStart(0, "div");
27
- i0.ɵɵelement(1, "mj-single-role", 5);
80
+ i0.ɵɵelement(1, "mj-single-application", 11);
28
81
  i0.ɵɵelementEnd();
29
82
  } if (rf & 2) {
30
- const ctx_r3 = i0.ɵɵnextContext();
83
+ const ctx_r7 = i0.ɵɵnextContext();
31
84
  i0.ɵɵadvance();
32
- i0.ɵɵproperty("RoleName", ctx_r3.selectedRoleName);
85
+ i0.ɵɵproperty("ApplicationName", ctx_r7.selectedApplicationName);
33
86
  } }
87
+ export var SettingsItem;
88
+ (function (SettingsItem) {
89
+ SettingsItem["EntityPermissions"] = "EntityPermissions";
90
+ SettingsItem["Users"] = "Users";
91
+ SettingsItem["User"] = "User";
92
+ SettingsItem["Roles"] = "Roles";
93
+ SettingsItem["Role"] = "Role";
94
+ SettingsItem["Applications"] = "Applications";
95
+ SettingsItem["Application"] = "Application";
96
+ })(SettingsItem || (SettingsItem = {}));
34
97
  export class SettingsComponent {
35
98
  selectItem(item, changeRoute = true) {
36
- this.currentItem = item;
99
+ if (typeof item === 'string')
100
+ this.currentItem = SettingsItem[item];
101
+ else
102
+ this.currentItem = item;
37
103
  if (changeRoute)
38
104
  this.changeRoute(item.toLowerCase());
39
105
  }
@@ -44,9 +110,17 @@ export class SettingsComponent {
44
110
  constructor(router, activatedRoute) {
45
111
  this.router = router;
46
112
  this.activatedRoute = activatedRoute;
47
- this.currentItem = 'EntityPermissions';
113
+ this.currentItem = SettingsItem.Users;
48
114
  this.baseRoute = '/settings';
49
115
  this.selectedRoleName = '';
116
+ this.selectedUserID = 0;
117
+ this.selectedApplicationName = '';
118
+ this.options = [
119
+ { label: 'Users', value: SettingsItem.Users },
120
+ { label: 'Roles', value: SettingsItem.Roles },
121
+ { label: 'Applications', value: SettingsItem.Applications },
122
+ { label: 'Entity Permissions', value: SettingsItem.EntityPermissions }
123
+ ];
50
124
  }
51
125
  ngOnInit() {
52
126
  // manually update the first time
@@ -55,31 +129,6 @@ export class SettingsComponent {
55
129
  this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
56
130
  this.updateComponentStateBasedOnPath();
57
131
  });
58
- // this.activatedRoute.url.subscribe(urlSegments => {
59
- // const fullPath = window.location.pathname + window.location.search;
60
- // // Split the fullPath into segments and query string as needed
61
- // const [path, queryString] = fullPath.split('?');
62
- // const segments = path.split('/').filter(segment => segment.length > 0);
63
- // // Your logic to handle the segments and query string
64
- // const firstSegment = segments.length > 1 ? segments[1] : '';
65
- // switch (firstSegment.trim().toLowerCase()) {
66
- // case 'entitypermissions':
67
- // this.selectItem('EntityPermissions', false);
68
- // break;
69
- // case 'users':
70
- // this.selectItem('Users', false);
71
- // break;
72
- // case 'roles':
73
- // this.selectItem('Roles', false);
74
- // break;
75
- // case 'role':
76
- // this.selectedRoleName = segments.length > 2 ? segments[2] : '';
77
- // this.selectItem('Role', false);
78
- // break;
79
- // default:
80
- // break;
81
- // }
82
- // });
83
132
  }
84
133
  updateComponentStateBasedOnPath() {
85
134
  // On each navigation end, access the current URL from window.location
@@ -87,62 +136,83 @@ export class SettingsComponent {
87
136
  // Split the fullPath into segments and query string as needed
88
137
  const [path, queryString] = fullPath.split('?');
89
138
  const segments = path.split('/').filter(segment => segment.length > 0);
90
- // Place your switch-case logic here
91
139
  const firstSegment = segments.length > 1 ? segments[1] : '';
92
140
  switch (firstSegment.trim().toLowerCase()) {
93
141
  case 'entitypermissions':
94
- this.selectItem('EntityPermissions', false);
142
+ this.selectItem(SettingsItem.EntityPermissions, false);
143
+ break;
144
+ case 'applications':
145
+ this.selectItem(SettingsItem.Applications, false);
146
+ break;
147
+ case 'application':
148
+ this.selectedApplicationName = segments.length > 2 ? segments[2] : '';
149
+ this.selectItem(SettingsItem.Application, false);
95
150
  break;
96
151
  case 'users':
97
- this.selectItem('Users', false);
152
+ this.selectItem(SettingsItem.Users, false);
153
+ break;
154
+ case 'user':
155
+ this.selectedUserID = segments.length > 2 ? parseInt(segments[2]) : 0;
156
+ this.selectItem(SettingsItem.User, false);
98
157
  break;
99
158
  case 'roles':
100
- this.selectItem('Roles', false);
159
+ this.selectItem(SettingsItem.Roles, false);
101
160
  break;
102
161
  case 'role':
103
162
  this.selectedRoleName = segments.length > 2 ? segments[2] : '';
104
- this.selectItem('Role', false);
163
+ this.selectItem(SettingsItem.Role, false);
105
164
  break;
106
165
  default:
107
166
  break;
108
167
  }
109
168
  }
169
+ selectApplication(a) {
170
+ this.selectRoute('/settings/application', a.Name);
171
+ }
172
+ selectRole(r) {
173
+ this.selectRoute('/settings/role', r.Name);
174
+ }
175
+ selectUser(r) {
176
+ this.selectRoute('/settings/user', r.ID);
177
+ }
178
+ selectRoute(route, value) {
179
+ this.router.navigate([route, value]);
180
+ }
181
+ leftNavItemSelected(option) {
182
+ // if the currentItem matches it directly or if adding an S to the current item matches it, then return true
183
+ // for example for Application/Applications we want to match so the left nav item is highlighted
184
+ return option.value === this.currentItem || option.value === this.currentItem + 's';
185
+ }
110
186
  }
111
187
  SettingsComponent.ɵfac = function SettingsComponent_Factory(t) { return new (t || SettingsComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute)); };
112
- SettingsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsComponent, selectors: [["mj-settings"]], decls: 13, vars: 10, consts: [[1, "container"], [1, "options-container"], [1, "option-item", 3, "click"], [1, "display-container"], [4, "ngIf"], [3, "RoleName"]], template: function SettingsComponent_Template(rf, ctx) { if (rf & 1) {
113
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
114
- i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_2_listener() { return ctx.selectItem("Users"); });
115
- i0.ɵɵtext(3, "Users");
188
+ SettingsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsComponent, selectors: [["mj-settings"]], decls: 11, vars: 10, consts: [["mjFillContainer", "", 1, "container", 3, "fillWidth", "bottomMargin"], [1, "options-container"], ["class", "option-item", 3, "selected", "click", 4, "ngFor", "ngForOf"], [1, "display-container"], [4, "ngIf"], [1, "option-item", 3, "click"], ["EntityName", "Users", "SortBy", "Name", 3, "Columns", "RecordSelected"], [3, "UserID"], ["EntityName", "Roles", "SortBy", "Name", 3, "Columns", "RecordSelected"], [3, "RoleName"], ["EntityName", "Applications", "SortBy", "Name", 3, "Columns", "RecordSelected"], [3, "ApplicationName"]], template: function SettingsComponent_Template(rf, ctx) { if (rf & 1) {
189
+ i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
190
+ i0.ɵɵtemplate(2, SettingsComponent_div_2_Template, 2, 3, "div", 2);
116
191
  i0.ɵɵelementEnd();
117
- i0.ɵɵelementStart(4, "div", 2);
118
- i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_4_listener() { return ctx.selectItem("Roles"); });
119
- i0.ɵɵtext(5, "Roles");
120
- i0.ɵɵelementEnd();
121
- i0.ɵɵelementStart(6, "div", 2);
122
- i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_6_listener() { return ctx.selectItem("EntityPermissions"); });
123
- i0.ɵɵtext(7, "Entity Permissions");
124
- i0.ɵɵelementEnd()();
125
- i0.ɵɵelementStart(8, "div", 3);
126
- i0.ɵɵtemplate(9, SettingsComponent_div_9_Template, 2, 0, "div", 4)(10, SettingsComponent_div_10_Template, 2, 0, "div", 4)(11, SettingsComponent_div_11_Template, 2, 0, "div", 4)(12, SettingsComponent_div_12_Template, 2, 1, "div", 4);
192
+ i0.ɵɵelementStart(3, "div", 3);
193
+ i0.ɵɵtemplate(4, SettingsComponent_div_4_Template, 2, 0, "div", 4)(5, SettingsComponent_div_5_Template, 2, 2, "div", 4)(6, SettingsComponent_div_6_Template, 2, 1, "div", 4)(7, SettingsComponent_div_7_Template, 2, 2, "div", 4)(8, SettingsComponent_div_8_Template, 2, 1, "div", 4)(9, SettingsComponent_div_9_Template, 2, 2, "div", 4)(10, SettingsComponent_div_10_Template, 2, 1, "div", 4);
127
194
  i0.ɵɵelementEnd()();
128
195
  } if (rf & 2) {
196
+ i0.ɵɵproperty("fillWidth", false)("bottomMargin", 5);
129
197
  i0.ɵɵadvance(2);
130
- i0.ɵɵclassProp("selected", ctx.currentItem === "Users");
198
+ i0.ɵɵproperty("ngForOf", ctx.options);
131
199
  i0.ɵɵadvance(2);
132
- i0.ɵɵclassProp("selected", ctx.currentItem === "Roles" || ctx.currentItem === "Role");
133
- i0.ɵɵadvance(2);
134
- i0.ɵɵclassProp("selected", ctx.currentItem === "EntityPermissions");
135
- i0.ɵɵadvance(3);
136
200
  i0.ɵɵproperty("ngIf", ctx.currentItem === "EntityPermissions");
137
201
  i0.ɵɵadvance();
138
202
  i0.ɵɵproperty("ngIf", ctx.currentItem === "Users");
139
203
  i0.ɵɵadvance();
204
+ i0.ɵɵproperty("ngIf", ctx.currentItem === "User");
205
+ i0.ɵɵadvance();
140
206
  i0.ɵɵproperty("ngIf", ctx.currentItem === "Roles");
141
207
  i0.ɵɵadvance();
142
208
  i0.ɵɵproperty("ngIf", ctx.currentItem === "Role");
143
- } }, dependencies: [i2.NgIf, i3.EntityPermissionsSelectorWithGridComponent, i4.SingleRoleComponent, i5.RolesListComponent], styles: [".container[_ngcontent-%COMP%] {\r\n display: flex;\r\n }\r\n \r\n .options-container[_ngcontent-%COMP%] {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n }\r\n \r\n .option-item[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-bottom: 10px; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n }\r\n \r\n .display-container[_ngcontent-%COMP%] {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .selected[_ngcontent-%COMP%] {\r\n background-color: #007bff; \n\r\n color: white; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n }"] });
209
+ i0.ɵɵadvance();
210
+ i0.ɵɵproperty("ngIf", ctx.currentItem === "Applications");
211
+ i0.ɵɵadvance();
212
+ i0.ɵɵproperty("ngIf", ctx.currentItem === "Application");
213
+ } }, dependencies: [i2.NgForOf, i2.NgIf, i3.FillContainer, i4.EntityPermissionsSelectorWithGridComponent, i5.SimpleRecordListComponent, i6.SingleRoleComponent, i7.SingleUserComponent, i8.SingleApplicationComponent], styles: [".container[_ngcontent-%COMP%] {\r\n display: flex;\r\n width: 100%;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.options-container[_ngcontent-%COMP%] {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n border-right: solid 1px lightgray;\r\n}\r\n\r\n.option-item[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-bottom: 10px; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n}\r\n\r\n.display-container[_ngcontent-%COMP%] {\r\n flex: 1;\r\n padding: 10px;\r\n}\r\n\r\n.selected[_ngcontent-%COMP%] {\r\n background-color: #007bff; \n\r\n color: white; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n}"] });
144
214
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SettingsComponent, [{
145
215
  type: Component,
146
- args: [{ selector: 'mj-settings', template: "<div class=\"container\">\r\n <!-- Options container -->\r\n <div class=\"options-container\">\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'Users'\" (click)=\"selectItem('Users')\">Users</div>\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'Roles' || currentItem === 'Role'\" (click)=\"selectItem('Roles')\">Roles</div>\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'EntityPermissions'\" (click)=\"selectItem('EntityPermissions')\">Entity Permissions</div>\r\n </div>\r\n\r\n <!-- Display container -->\r\n <div class=\"display-container\">\r\n <div *ngIf=\"currentItem === 'EntityPermissions'\">\r\n <mj-entity-permissions-selector-with-grid></mj-entity-permissions-selector-with-grid>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Users'\">\r\n Users Component Goes Here\r\n </div>\r\n <div *ngIf=\"currentItem === 'Roles'\">\r\n <mj-roles-list></mj-roles-list>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Role'\">\r\n <mj-single-role [RoleName]=\"selectedRoleName\"></mj-single-role>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container {\r\n display: flex;\r\n }\r\n \r\n .options-container {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n }\r\n \r\n .option-item {\r\n cursor: pointer;\r\n margin-bottom: 10px; /* Adds space between the options for better readability */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n }\r\n \r\n .display-container {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .selected {\r\n background-color: #007bff; /* A blue background for selected item */\r\n color: white; /* White text color for better contrast */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n }\r\n "] }]
216
+ args: [{ selector: 'mj-settings', template: "<div class=\"container\" mjFillContainer [fillWidth]=\"false\" [bottomMargin]=\"5\">\r\n <!-- Options container -->\r\n <div class=\"options-container\">\r\n <div *ngFor=\"let o of options\"\r\n class=\"option-item\"\r\n [class.selected]=\"leftNavItemSelected(o)\"\r\n (click)=\"selectItem(o.value)\"\r\n >{{o.label}}</div>\r\n </div>\r\n\r\n <!-- Display container -->\r\n <div class=\"display-container\">\r\n <div *ngIf=\"currentItem === 'EntityPermissions'\">\r\n <mj-entity-permissions-selector-with-grid></mj-entity-permissions-selector-with-grid>\r\n </div>\r\n\r\n <div *ngIf=\"currentItem === 'Users'\">\r\n <mj-simple-record-list\r\n EntityName=\"Users\"\r\n SortBy=\"Name\"\r\n [Columns]=\"['Name', 'Email', 'IsActive', 'Type']\"\r\n (RecordSelected)=\"selectUser($event)\"\r\n ></mj-simple-record-list>\r\n </div>\r\n <div *ngIf=\"currentItem === 'User'\">\r\n <mj-single-user [UserID]=\"selectedUserID\"></mj-single-user>\r\n </div>\r\n\r\n <div *ngIf=\"currentItem === 'Roles'\">\r\n <mj-simple-record-list\r\n EntityName=\"Roles\"\r\n SortBy=\"Name\"\r\n [Columns]=\"['Name', 'Description']\"\r\n (RecordSelected)=\"selectRole($event)\"\r\n ></mj-simple-record-list>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Role'\">\r\n <mj-single-role [RoleName]=\"selectedRoleName\"></mj-single-role>\r\n </div>\r\n\r\n <div *ngIf=\"currentItem === 'Applications'\">\r\n <mj-simple-record-list\r\n EntityName=\"Applications\"\r\n SortBy=\"Name\"\r\n [Columns]=\"['Name', 'Description']\"\r\n (RecordSelected)=\"selectApplication($event)\"\r\n ></mj-simple-record-list>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Application'\">\r\n <mj-single-application [ApplicationName]=\"selectedApplicationName\"></mj-single-application>\r\n </div> \r\n </div>\r\n</div>", styles: [".container {\r\n display: flex;\r\n width: 100%;\r\n border: solid 1px lightgray;\r\n}\r\n\r\n.options-container {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n border-right: solid 1px lightgray;\r\n}\r\n\r\n.option-item {\r\n cursor: pointer;\r\n margin-bottom: 10px; /* Adds space between the options for better readability */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n}\r\n\r\n.display-container {\r\n flex: 1;\r\n padding: 10px;\r\n}\r\n\r\n.selected {\r\n background-color: #007bff; /* A blue background for selected item */\r\n color: white; /* White text color for better contrast */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n}\r\n"] }]
147
217
  }], () => [{ type: i1.Router }, { type: i1.ActivatedRoute }], null); })();
148
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsComponent, { className: "SettingsComponent", filePath: "src\\lib\\settings\\settings.component.ts", lineNumber: 10 }); })();
218
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsComponent, { className: "SettingsComponent", filePath: "src\\lib\\settings\\settings.component.ts", lineNumber: 22 }); })();
@@ -0,0 +1,22 @@
1
+ import { OnInit, ChangeDetectorRef } from '@angular/core';
2
+ import { kendoSVGIcon } from '@memberjunction/ng-shared';
3
+ import { ApplicationEntity } from '@memberjunction/core-entities';
4
+ import { EntityFormDialog } from '@memberjunction/ng-entity-form-dialog';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SingleApplicationComponent implements OnInit {
7
+ private cdRef;
8
+ ApplicationName: string;
9
+ entityFormComponent: EntityFormDialog;
10
+ gridHeight: number;
11
+ isLoading: boolean;
12
+ Record: ApplicationEntity | null;
13
+ kendoSVGIcon: typeof kendoSVGIcon;
14
+ showEntityEditingForm: boolean;
15
+ constructor(cdRef: ChangeDetectorRef);
16
+ ngOnInit(): void;
17
+ protected Refresh(): Promise<void>;
18
+ EditRecord(): Promise<void>;
19
+ onEntityFormClosed(result: 'Save' | 'Cancel'): Promise<void>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<SingleApplicationComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<SingleApplicationComponent, "mj-single-application", never, { "ApplicationName": { "alias": "ApplicationName"; "required": false; }; }, {}, never, never, false, never>;
22
+ }