@memberjunction/ng-explorer-settings 1.0.6 → 1.0.7
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/application-entities-grid/application-entities-grid.component.js +3 -3
- package/dist/lib/settings/settings.component.js +3 -3
- package/dist/lib/single-application/single-application.component.js +3 -3
- package/dist/lib/single-role/single-role.component.js +3 -3
- package/dist/lib/single-user/single-user.component.js +3 -3
- package/dist/lib/user-roles-grid/user-roles-grid.component.js +3 -3
- package/package.json +48 -48
- package/dist/lib/entity-form-dialog/entity-form-dialog.component.d.ts +0 -33
- package/dist/lib/entity-form-dialog/entity-form-dialog.component.js +0 -183
- package/dist/lib/entity-form-window/entity-form-window.component.d.ts +0 -17
- package/dist/lib/entity-form-window/entity-form-window.component.js +0 -99
- package/dist/lib/record-list/record-list.component.d.ts +0 -41
- package/dist/lib/record-list/record-list.component.js +0 -324
- package/dist/lib/roles-list/roles-list.component.d.ts +0 -25
- package/dist/lib/roles-list/roles-list.component.js +0 -201
|
@@ -1,201 +0,0 @@
|
|
|
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 } from '@angular/core';
|
|
11
|
-
import { Metadata, RunView } from '@memberjunction/core';
|
|
12
|
-
import { SharedService, 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 "@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) {
|
|
23
|
-
i0.ɵɵelementStart(0, "div");
|
|
24
|
-
i0.ɵɵelement(1, "kendo-loader");
|
|
25
|
-
i0.ɵɵelementEnd();
|
|
26
|
-
} }
|
|
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);
|
|
33
|
-
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()()();
|
|
40
|
-
} if (rf & 2) {
|
|
41
|
-
const r_r5 = ctx.$implicit;
|
|
42
|
-
const ctx_r4 = i0.ɵɵnextContext(2);
|
|
43
|
-
i0.ɵɵadvance(3);
|
|
44
|
-
i0.ɵɵtextInterpolate(r_r5.Name);
|
|
45
|
-
i0.ɵɵadvance(2);
|
|
46
|
-
i0.ɵɵproperty("icon", ctx_r4.kendoSVGIcon("trash"));
|
|
47
|
-
i0.ɵɵadvance(3);
|
|
48
|
-
i0.ɵɵtextInterpolate(r_r5.Description);
|
|
49
|
-
} }
|
|
50
|
-
function RolesListComponent_table_4_Template(rf, ctx) { if (rf & 1) {
|
|
51
|
-
i0.ɵɵelementStart(0, "table", 7)(1, "thead")(2, "tr")(3, "th");
|
|
52
|
-
i0.ɵɵtext(4, "Role");
|
|
53
|
-
i0.ɵɵelementEnd();
|
|
54
|
-
i0.ɵɵelementStart(5, "th");
|
|
55
|
-
i0.ɵɵtext(6, "Description");
|
|
56
|
-
i0.ɵɵelementEnd()()();
|
|
57
|
-
i0.ɵɵelementStart(7, "tbody");
|
|
58
|
-
i0.ɵɵtemplate(8, RolesListComponent_table_4_tr_8_Template, 9, 3, "tr", 8);
|
|
59
|
-
i0.ɵɵelementEnd()();
|
|
60
|
-
} if (rf & 2) {
|
|
61
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
62
|
-
i0.ɵɵadvance(8);
|
|
63
|
-
i0.ɵɵproperty("ngForOf", ctx_r1.roles);
|
|
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
|
-
} }
|
|
86
|
-
export class RolesListComponent {
|
|
87
|
-
constructor(router) {
|
|
88
|
-
this.router = router;
|
|
89
|
-
this.isLoading = false;
|
|
90
|
-
this.roles = [];
|
|
91
|
-
this.kendoSVGIcon = kendoSVGIcon;
|
|
92
|
-
this.deleteRoleDialogVisible = false;
|
|
93
|
-
this.showNewRoleForm = false;
|
|
94
|
-
}
|
|
95
|
-
ngOnInit() {
|
|
96
|
-
this.Refresh();
|
|
97
|
-
}
|
|
98
|
-
Refresh() {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
const startTime = new Date().getTime();
|
|
101
|
-
this.isLoading = true;
|
|
102
|
-
const md = new Metadata();
|
|
103
|
-
const rv = new RunView();
|
|
104
|
-
const result = yield rv.RunView({
|
|
105
|
-
EntityName: 'Roles',
|
|
106
|
-
ResultType: 'entity_object'
|
|
107
|
-
});
|
|
108
|
-
if (result.Success) {
|
|
109
|
-
this.roles = result.Results;
|
|
110
|
-
this.roles.sort((a, b) => a.Name.localeCompare(b.Name));
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
throw new Error("Error loading roles: " + result.ErrorMessage);
|
|
114
|
-
}
|
|
115
|
-
this.isLoading = false;
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
selectRole(event, r) {
|
|
119
|
-
if (event)
|
|
120
|
-
event.stopPropagation(); // prevent row from getting click
|
|
121
|
-
// change the route to point to the /settings/role/{r.Name} route
|
|
122
|
-
this.router.navigate(['/settings/role', r.Name]);
|
|
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
|
-
}
|
|
174
|
-
}
|
|
175
|
-
RolesListComponent.ɵfac = function RolesListComponent_Factory(t) { return new (t || RolesListComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
|
|
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");
|
|
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);
|
|
187
|
-
} if (rf & 2) {
|
|
188
|
-
i0.ɵɵadvance(3);
|
|
189
|
-
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
190
|
-
i0.ɵɵadvance();
|
|
191
|
-
i0.ɵɵproperty("ngIf", !ctx.isLoading);
|
|
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}"] });
|
|
197
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RolesListComponent, [{
|
|
198
|
-
type: Component,
|
|
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 "] }]
|
|
200
|
-
}], () => [{ type: i1.Router }], null); })();
|
|
201
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RolesListComponent, { className: "RolesListComponent", filePath: "src\\lib\\roles-list\\roles-list.component.ts", lineNumber: 15 }); })();
|