@memberjunction/ng-explorer-settings 0.9.11 → 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.
- package/dist/lib/application-entities-grid/application-entities-grid.component.d.ts +51 -0
- package/dist/lib/application-entities-grid/application-entities-grid.component.js +348 -0
- package/dist/lib/module.d.ts +19 -17
- package/dist/lib/module.js +14 -4
- package/dist/lib/settings/settings.component.d.ts +22 -2
- package/dist/lib/settings/settings.component.js +112 -53
- package/dist/lib/single-application/single-application.component.d.ts +22 -0
- package/dist/lib/single-application/single-application.component.js +144 -0
- package/dist/lib/single-role/single-role.component.js +3 -1
- package/dist/lib/user-roles-grid/user-roles-grid.component.js +2 -2
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.js +2 -0
- package/package.json +8 -8
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OnInit, SimpleChanges, OnChanges } from '@angular/core';
|
|
2
|
+
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
3
|
+
import { ApplicationEntity, ApplicationEntityEntity, EntityEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { Router } from '@angular/router';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ApplicationEntityEntity_Ext extends ApplicationEntityEntity {
|
|
7
|
+
private _selected;
|
|
8
|
+
get Selected(): boolean;
|
|
9
|
+
set Selected(value: boolean);
|
|
10
|
+
private _applicationName;
|
|
11
|
+
get SavedApplicationName(): string;
|
|
12
|
+
set SavedApplicationName(value: string);
|
|
13
|
+
private _entityID;
|
|
14
|
+
get SavedEntityID(): number;
|
|
15
|
+
set SavedEntityID(value: number);
|
|
16
|
+
}
|
|
17
|
+
export declare class ApplicationEntitiesGridComponent implements OnInit, OnChanges {
|
|
18
|
+
private router;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the application we are working with, required if Mode is 'Applications'
|
|
21
|
+
*/
|
|
22
|
+
ApplicationName: string;
|
|
23
|
+
/**
|
|
24
|
+
* The ID of the entity we are working with, required if Mode is 'Entities'
|
|
25
|
+
*/
|
|
26
|
+
EntityID: number;
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
rows: ApplicationEntityEntity_Ext[];
|
|
29
|
+
Mode: 'Applications' | 'Entities';
|
|
30
|
+
/**
|
|
31
|
+
* The role record we are working with, required if Mode is 'Appliations'
|
|
32
|
+
*/
|
|
33
|
+
ApplicationRecord: ApplicationEntity | null;
|
|
34
|
+
/**
|
|
35
|
+
* The user record we are working with, required if Mode is 'Entities'
|
|
36
|
+
*/
|
|
37
|
+
EntityRecord: EntityEntity | null;
|
|
38
|
+
kendoSVGIcon: typeof kendoSVGIcon;
|
|
39
|
+
constructor(router: Router);
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
42
|
+
Refresh(): Promise<void>;
|
|
43
|
+
save(): Promise<void>;
|
|
44
|
+
cancelEdit(): void;
|
|
45
|
+
flipAll(): void;
|
|
46
|
+
get NumDirty(): number;
|
|
47
|
+
protected IsReallyDirty(ae: ApplicationEntityEntity_Ext): boolean;
|
|
48
|
+
flipState($event: MouseEvent | undefined, ur: ApplicationEntityEntity_Ext, flipState: boolean): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationEntitiesGridComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ApplicationEntitiesGridComponent, "mj-application-entities-grid", never, { "ApplicationName": { "alias": "ApplicationName"; "required": false; }; "EntityID": { "alias": "EntityID"; "required": false; }; "Mode": { "alias": "Mode"; "required": false; }; "ApplicationRecord": { "alias": "ApplicationRecord"; "required": false; }; "EntityRecord": { "alias": "EntityRecord"; "required": false; }; }, {}, never, never, false, never>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
import { Component, Input } from '@angular/core';
|
|
17
|
+
import { BaseEntity, Metadata, RunView } from '@memberjunction/core';
|
|
18
|
+
import { kendoSVGIcon } from '@memberjunction/ng-shared';
|
|
19
|
+
import { ApplicationEntityEntity } from '@memberjunction/core-entities';
|
|
20
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
import * as i1 from "@angular/router";
|
|
23
|
+
import * as i2 from "@angular/common";
|
|
24
|
+
import * as i3 from "@angular/forms";
|
|
25
|
+
import * as i4 from "@progress/kendo-angular-buttons";
|
|
26
|
+
import * as i5 from "@progress/kendo-angular-indicators";
|
|
27
|
+
function ApplicationEntitiesGridComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelementStart(0, "div");
|
|
29
|
+
i0.ɵɵelement(1, "kendo-loader");
|
|
30
|
+
i0.ɵɵelementEnd();
|
|
31
|
+
} }
|
|
32
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_th_3_Template(rf, ctx) { if (rf & 1) {
|
|
33
|
+
i0.ɵɵelementStart(0, "th");
|
|
34
|
+
i0.ɵɵtext(1, "Entity");
|
|
35
|
+
i0.ɵɵelementEnd();
|
|
36
|
+
} }
|
|
37
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_th_4_Template(rf, ctx) { if (rf & 1) {
|
|
38
|
+
i0.ɵɵelementStart(0, "th");
|
|
39
|
+
i0.ɵɵtext(1, "Application");
|
|
40
|
+
i0.ɵɵelementEnd();
|
|
41
|
+
} }
|
|
42
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_td_1_Template(rf, ctx) { if (rf & 1) {
|
|
43
|
+
i0.ɵɵelementStart(0, "td");
|
|
44
|
+
i0.ɵɵtext(1);
|
|
45
|
+
i0.ɵɵelementEnd();
|
|
46
|
+
} if (rf & 2) {
|
|
47
|
+
const r_r6 = i0.ɵɵnextContext().$implicit;
|
|
48
|
+
i0.ɵɵadvance();
|
|
49
|
+
i0.ɵɵtextInterpolate(r_r6.Entity);
|
|
50
|
+
} }
|
|
51
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_td_2_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
i0.ɵɵelementStart(0, "td");
|
|
53
|
+
i0.ɵɵtext(1);
|
|
54
|
+
i0.ɵɵelementEnd();
|
|
55
|
+
} if (rf & 2) {
|
|
56
|
+
const r_r6 = i0.ɵɵnextContext().$implicit;
|
|
57
|
+
i0.ɵɵadvance();
|
|
58
|
+
i0.ɵɵtextInterpolate(r_r6.Application);
|
|
59
|
+
} }
|
|
60
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_Template(rf, ctx) { if (rf & 1) {
|
|
61
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
62
|
+
i0.ɵɵelementStart(0, "tr");
|
|
63
|
+
i0.ɵɵtemplate(1, ApplicationEntitiesGridComponent_div_1_table_5_tr_8_td_1_Template, 2, 1, "td", 0)(2, ApplicationEntitiesGridComponent_div_1_table_5_tr_8_td_2_Template, 2, 1, "td", 0);
|
|
64
|
+
i0.ɵɵelementStart(3, "td", 6);
|
|
65
|
+
i0.ɵɵlistener("click", function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_Template_td_click_3_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const r_r6 = restoredCtx.$implicit; const ctx_r11 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r11.flipState($event, r_r6, true)); });
|
|
66
|
+
i0.ɵɵelementStart(4, "input", 8);
|
|
67
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_Template_input_ngModelChange_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const r_r6 = restoredCtx.$implicit; i0.ɵɵtwoWayBindingSet(r_r6.Selected, $event) || (r_r6.Selected = $event); return i0.ɵɵresetView($event); });
|
|
68
|
+
i0.ɵɵlistener("click", function ApplicationEntitiesGridComponent_div_1_table_5_tr_8_Template_input_click_4_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r12); const r_r6 = restoredCtx.$implicit; const ctx_r14 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r14.flipState($event, r_r6, false)); });
|
|
69
|
+
i0.ɵɵelementEnd()()();
|
|
70
|
+
} if (rf & 2) {
|
|
71
|
+
const r_r6 = ctx.$implicit;
|
|
72
|
+
const ctx_r5 = i0.ɵɵnextContext(3);
|
|
73
|
+
i0.ɵɵadvance();
|
|
74
|
+
i0.ɵɵproperty("ngIf", ctx_r5.Mode === "Applications");
|
|
75
|
+
i0.ɵɵadvance();
|
|
76
|
+
i0.ɵɵproperty("ngIf", ctx_r5.Mode === "Entities");
|
|
77
|
+
i0.ɵɵadvance(2);
|
|
78
|
+
i0.ɵɵtwoWayProperty("ngModel", r_r6.Selected);
|
|
79
|
+
} }
|
|
80
|
+
function ApplicationEntitiesGridComponent_div_1_table_5_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
+
const _r16 = i0.ɵɵgetCurrentView();
|
|
82
|
+
i0.ɵɵelementStart(0, "table", 5)(1, "thead")(2, "tr");
|
|
83
|
+
i0.ɵɵtemplate(3, ApplicationEntitiesGridComponent_div_1_table_5_th_3_Template, 2, 0, "th", 0)(4, ApplicationEntitiesGridComponent_div_1_table_5_th_4_Template, 2, 0, "th", 0);
|
|
84
|
+
i0.ɵɵelementStart(5, "th", 6);
|
|
85
|
+
i0.ɵɵlistener("click", function ApplicationEntitiesGridComponent_div_1_table_5_Template_th_click_5_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.flipAll()); });
|
|
86
|
+
i0.ɵɵtext(6, "In Application");
|
|
87
|
+
i0.ɵɵelementEnd()()();
|
|
88
|
+
i0.ɵɵelementStart(7, "tbody");
|
|
89
|
+
i0.ɵɵtemplate(8, ApplicationEntitiesGridComponent_div_1_table_5_tr_8_Template, 5, 3, "tr", 7);
|
|
90
|
+
i0.ɵɵelementEnd()();
|
|
91
|
+
} if (rf & 2) {
|
|
92
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
93
|
+
i0.ɵɵadvance(3);
|
|
94
|
+
i0.ɵɵproperty("ngIf", ctx_r2.Mode === "Applications");
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵproperty("ngIf", ctx_r2.Mode === "Entities");
|
|
97
|
+
i0.ɵɵadvance(4);
|
|
98
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.rows);
|
|
99
|
+
} }
|
|
100
|
+
function ApplicationEntitiesGridComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
101
|
+
const _r18 = i0.ɵɵgetCurrentView();
|
|
102
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "button", 3);
|
|
103
|
+
i0.ɵɵlistener("click", function ApplicationEntitiesGridComponent_div_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r18); const ctx_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r17.save()); });
|
|
104
|
+
i0.ɵɵtext(2, "Save");
|
|
105
|
+
i0.ɵɵelementEnd();
|
|
106
|
+
i0.ɵɵelementStart(3, "button", 3);
|
|
107
|
+
i0.ɵɵlistener("click", function ApplicationEntitiesGridComponent_div_1_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r18); const ctx_r19 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r19.cancelEdit()); });
|
|
108
|
+
i0.ɵɵtext(4, "Cancel");
|
|
109
|
+
i0.ɵɵelementEnd();
|
|
110
|
+
i0.ɵɵtemplate(5, ApplicationEntitiesGridComponent_div_1_table_5_Template, 9, 3, "table", 4);
|
|
111
|
+
i0.ɵɵelementEnd();
|
|
112
|
+
} if (rf & 2) {
|
|
113
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
114
|
+
i0.ɵɵadvance();
|
|
115
|
+
i0.ɵɵproperty("disabled", ctx_r1.NumDirty === 0);
|
|
116
|
+
i0.ɵɵadvance(2);
|
|
117
|
+
i0.ɵɵproperty("disabled", ctx_r1.NumDirty === 0);
|
|
118
|
+
i0.ɵɵadvance(2);
|
|
119
|
+
i0.ɵɵproperty("ngIf", !ctx_r1.isLoading);
|
|
120
|
+
} }
|
|
121
|
+
let ApplicationEntityEntity_Ext = class ApplicationEntityEntity_Ext extends ApplicationEntityEntity {
|
|
122
|
+
constructor() {
|
|
123
|
+
super(...arguments);
|
|
124
|
+
this._selected = false;
|
|
125
|
+
this._applicationName = '';
|
|
126
|
+
this._entityID = 0;
|
|
127
|
+
}
|
|
128
|
+
get Selected() {
|
|
129
|
+
return this._selected;
|
|
130
|
+
}
|
|
131
|
+
set Selected(value) {
|
|
132
|
+
this._selected = value;
|
|
133
|
+
}
|
|
134
|
+
get SavedApplicationName() {
|
|
135
|
+
return this._applicationName;
|
|
136
|
+
}
|
|
137
|
+
set SavedApplicationName(value) {
|
|
138
|
+
this._applicationName = value;
|
|
139
|
+
}
|
|
140
|
+
get SavedEntityID() {
|
|
141
|
+
return this._entityID;
|
|
142
|
+
}
|
|
143
|
+
set SavedEntityID(value) {
|
|
144
|
+
this._entityID = value;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
ApplicationEntityEntity_Ext = __decorate([
|
|
148
|
+
RegisterClass(BaseEntity, 'Application Entities', 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
|
|
149
|
+
], ApplicationEntityEntity_Ext);
|
|
150
|
+
export { ApplicationEntityEntity_Ext };
|
|
151
|
+
export class ApplicationEntitiesGridComponent {
|
|
152
|
+
constructor(router) {
|
|
153
|
+
this.router = router;
|
|
154
|
+
this.isLoading = false;
|
|
155
|
+
this.rows = [];
|
|
156
|
+
this.Mode = 'Applications';
|
|
157
|
+
/**
|
|
158
|
+
* The role record we are working with, required if Mode is 'Appliations'
|
|
159
|
+
*/
|
|
160
|
+
this.ApplicationRecord = null;
|
|
161
|
+
/**
|
|
162
|
+
* The user record we are working with, required if Mode is 'Entities'
|
|
163
|
+
*/
|
|
164
|
+
this.EntityRecord = null;
|
|
165
|
+
this.kendoSVGIcon = kendoSVGIcon;
|
|
166
|
+
}
|
|
167
|
+
ngOnInit() {
|
|
168
|
+
this.Refresh();
|
|
169
|
+
}
|
|
170
|
+
ngOnChanges(changes) {
|
|
171
|
+
if (changes && (changes.RoleRecord || changes.UserRecord))
|
|
172
|
+
this.Refresh();
|
|
173
|
+
}
|
|
174
|
+
Refresh() {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
if (this.Mode === 'Applications')
|
|
177
|
+
if (!this.ApplicationName || this.ApplicationName.length === 0 || !this.ApplicationRecord)
|
|
178
|
+
throw new Error("ApplicationName and ApplicationRecord are required when Mode is 'Applications'");
|
|
179
|
+
if (this.Mode === 'Entities')
|
|
180
|
+
if (!this.EntityID || !this.EntityRecord)
|
|
181
|
+
throw new Error("EntityID and EntityRecord are required when Mode is 'Entities'");
|
|
182
|
+
const md = new Metadata();
|
|
183
|
+
this.isLoading = true;
|
|
184
|
+
const rv = new RunView();
|
|
185
|
+
const filter = this.Mode === 'Applications' ? `Application='${this.ApplicationName}'` : `EntityID=${this.EntityID}`;
|
|
186
|
+
const result = yield rv.RunView({
|
|
187
|
+
EntityName: 'Application Entities',
|
|
188
|
+
ExtraFilter: filter,
|
|
189
|
+
ResultType: 'entity_object'
|
|
190
|
+
});
|
|
191
|
+
if (result.Success) {
|
|
192
|
+
// we have all of the saved records now
|
|
193
|
+
const existing = result.Results;
|
|
194
|
+
existing.forEach(ae => {
|
|
195
|
+
ae.Selected = true; // flip this on for all records that come from the DB
|
|
196
|
+
ae.SavedEntityID = ae.EntityID; // stash this in an extra property so we can later set it if we have a delete operation
|
|
197
|
+
ae.SavedApplicationName = ae.Application; // stash this in an extra property so we can later set it if we have a delete operation
|
|
198
|
+
});
|
|
199
|
+
if (this.Mode === 'Applications') {
|
|
200
|
+
const entitiesToAdd = md.Entities.filter(e => !existing.some(ee => ee.EntityID === e.ID));
|
|
201
|
+
for (const e of entitiesToAdd) {
|
|
202
|
+
const ae = yield md.GetEntityObject('Application Entities');
|
|
203
|
+
ae.NewRecord();
|
|
204
|
+
ae.Sequence = 1000; // default value, isn't used anywhere
|
|
205
|
+
ae.ApplicationName = this.ApplicationName;
|
|
206
|
+
ae.Set('Application', this.ApplicationName); // use weak typing to get around the readonly property
|
|
207
|
+
ae.SavedApplicationName = this.ApplicationName; // stash this in an extra property so we can later set it if we have a delete operation
|
|
208
|
+
ae.EntityID = e.ID;
|
|
209
|
+
ae.SavedEntityID = e.ID; // stash this in an extra property so we can later set it if we have a delete operation
|
|
210
|
+
ae.Set('Entity', e.Name); // use weak typing to get around the readonly property
|
|
211
|
+
existing.push(ae);
|
|
212
|
+
}
|
|
213
|
+
// finally sort the array
|
|
214
|
+
this.rows = existing.sort((a, b) => a.Entity.localeCompare(b.Entity));
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
// for the mode of Entities, we want to bring in all of the possible applications and then add any that are not in the existing array
|
|
218
|
+
const appsToAdd = md.Applications.filter(a => !existing.some(e => e.Application === a.Name));
|
|
219
|
+
for (const a of appsToAdd) {
|
|
220
|
+
const ae = yield md.GetEntityObject('Application Entities');
|
|
221
|
+
ae.NewRecord();
|
|
222
|
+
ae.Sequence = 1000; // default value, isn't used anywhere
|
|
223
|
+
ae.ApplicationName = a.Name;
|
|
224
|
+
ae.Set('Application', a.Name); // use weak typing to get around the readonly property
|
|
225
|
+
ae.SavedApplicationName = a.Name; // stash this in an extra property so we can later set it if we have a delete operation
|
|
226
|
+
ae.EntityID = this.EntityID;
|
|
227
|
+
ae.SavedEntityID = this.EntityID; // stash this in an extra property so we can later set it if we have a delete operation
|
|
228
|
+
ae.Set('Entity', this.EntityRecord.Name); // use weak typing to get around the readonly property
|
|
229
|
+
existing.push(ae);
|
|
230
|
+
}
|
|
231
|
+
// finally sort the array
|
|
232
|
+
this.rows = existing.sort((a, b) => a.Application.localeCompare(b.Application));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
throw new Error("Error loading application entities: " + result.ErrorMessage);
|
|
237
|
+
}
|
|
238
|
+
this.isLoading = false;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
save() {
|
|
242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
// iterate through each permisison and for the ones that are dirty, add to transaction group then commit at once
|
|
244
|
+
const md = new Metadata();
|
|
245
|
+
const tg = yield md.CreateTransactionGroup();
|
|
246
|
+
let itemCount = 0;
|
|
247
|
+
this.rows.forEach(r => {
|
|
248
|
+
if (this.IsReallyDirty(r)) {
|
|
249
|
+
r.TransactionGroup = tg;
|
|
250
|
+
itemCount++;
|
|
251
|
+
// now, we have to determine if we are going to save the record or delete it
|
|
252
|
+
// if ur.Selected === false and we are in the database, we need to delete
|
|
253
|
+
// otherwise, we need to save
|
|
254
|
+
if (r.Selected)
|
|
255
|
+
r.Save();
|
|
256
|
+
else
|
|
257
|
+
r.Delete();
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
if (itemCount > 0) {
|
|
261
|
+
if (yield tg.Submit()) {
|
|
262
|
+
// for any items in the above that were deleted, we would have had the ApplicationName/Application and Entity property wiped out so we need to go check to see if we have a null ID and if so, copy the values back in
|
|
263
|
+
this.rows.forEach(r => {
|
|
264
|
+
if (r.Application === null || r.ApplicationName === null) {
|
|
265
|
+
r.Set('Application', r.SavedApplicationName); // get around the read-only property
|
|
266
|
+
r.ApplicationName = r.SavedApplicationName;
|
|
267
|
+
}
|
|
268
|
+
if (r.Entity === null || r.EntityID === null) {
|
|
269
|
+
r.EntityID = r.SavedEntityID; // get around the read-only property
|
|
270
|
+
const e = md.Entities.find(ee => ee.ID === r.SavedEntityID);
|
|
271
|
+
r.Set('Entity', e === null || e === void 0 ? void 0 : e.Name); // get around the read-only property
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
cancelEdit() {
|
|
279
|
+
if (this.NumDirty > 0) {
|
|
280
|
+
// go through and revert each permission that is REALLY dirty
|
|
281
|
+
this.rows.forEach(r => {
|
|
282
|
+
if (this.IsReallyDirty(r)) {
|
|
283
|
+
r.Selected = !r.Selected; // flip the state so we can revert
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
flipAll() {
|
|
289
|
+
// first, figure out what we have the majority of, if we have more ON, then we will flip to OFF, otherwise we will flip to ON
|
|
290
|
+
let onCount = 0;
|
|
291
|
+
let offCount = 0;
|
|
292
|
+
this.rows.forEach(r => {
|
|
293
|
+
if (r.Selected)
|
|
294
|
+
onCount++;
|
|
295
|
+
else
|
|
296
|
+
offCount++;
|
|
297
|
+
});
|
|
298
|
+
const value = offCount > onCount;
|
|
299
|
+
// now set the permission for each permission record
|
|
300
|
+
for (const r of this.rows) {
|
|
301
|
+
r.Selected = value;
|
|
302
|
+
this.flipState(undefined, r, false); // call this function but tell it to NOT actually flip the permission, just to fire the event
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
get NumDirty() {
|
|
306
|
+
return this.rows.filter(r => this.IsReallyDirty(r)).length;
|
|
307
|
+
}
|
|
308
|
+
IsReallyDirty(ae) {
|
|
309
|
+
// logic is simple, if we are in the database, but the checkbox is not checked (or vice versa), then we are dirty
|
|
310
|
+
if (ae.Selected && ae.ID > 0)
|
|
311
|
+
return false; // if we are in the database and the checkbox is checked, we are not dirty
|
|
312
|
+
else if (!ae.Selected && ae.ID > 0)
|
|
313
|
+
return true; // if we are in the database and the checkbox is not checked, we are dirty because we'd have to be removed
|
|
314
|
+
else if (ae.Selected)
|
|
315
|
+
return true; // if we are NOT in the database and the checkbox is checked, we are dirty because we'd have to be added
|
|
316
|
+
else
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
flipState($event, ur, flipState) {
|
|
320
|
+
if (flipState)
|
|
321
|
+
ur.Selected = !ur.Selected;
|
|
322
|
+
else if ($event)
|
|
323
|
+
$event.stopPropagation();
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
ApplicationEntitiesGridComponent.ɵfac = function ApplicationEntitiesGridComponent_Factory(t) { return new (t || ApplicationEntitiesGridComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
|
|
327
|
+
ApplicationEntitiesGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ApplicationEntitiesGridComponent, selectors: [["mj-application-entities-grid"]], inputs: { ApplicationName: "ApplicationName", EntityID: "EntityID", Mode: "Mode", ApplicationRecord: "ApplicationRecord", EntityRecord: "EntityRecord" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [[4, "ngIf"], ["class", "content", 4, "ngIf"], [1, "content"], ["kendoButton", "", 3, "disabled", "click"], ["class", "grid", 4, "ngIf"], [1, "grid"], [3, "click"], [4, "ngFor", "ngForOf"], ["type", "checkbox", "kendoCheckBox", "", 3, "ngModel", "ngModelChange", "click"]], template: function ApplicationEntitiesGridComponent_Template(rf, ctx) { if (rf & 1) {
|
|
328
|
+
i0.ɵɵtemplate(0, ApplicationEntitiesGridComponent_div_0_Template, 2, 0, "div", 0)(1, ApplicationEntitiesGridComponent_div_1_Template, 6, 3, "div", 1);
|
|
329
|
+
} if (rf & 2) {
|
|
330
|
+
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
331
|
+
i0.ɵɵadvance();
|
|
332
|
+
i0.ɵɵproperty("ngIf", !ctx.isLoading);
|
|
333
|
+
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.CheckboxControlValueAccessor, i3.NgControlStatus, i3.NgModel, i4.ButtonComponent, i5.LoaderComponent], styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n min-width: 150px;\r\n text-align: left;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}"] });
|
|
334
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApplicationEntitiesGridComponent, [{
|
|
335
|
+
type: Component,
|
|
336
|
+
args: [{ selector: 'mj-application-entities-grid', template: "<div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n<div class=\"content\" *ngIf=\"!isLoading\">\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"save()\">Save</button>\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"cancelEdit()\">Cancel</button>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"Mode === 'Applications'\">Entity</th>\r\n <th *ngIf=\"Mode === 'Entities'\">Application</th>\r\n <th (click)=\"flipAll()\">In Application</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of rows\">\r\n <td *ngIf=\"Mode === 'Applications'\">{{ r.Entity }}</td>\r\n <td *ngIf=\"Mode === 'Entities'\">{{ r.Application }}</td>\r\n <td (click)=\"flipState($event, r, true)\">\r\n <input type=\"checkbox\" kendoCheckBox [(ngModel)]=\"r.Selected\" (click)=\"flipState($event, r, false)\">\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n</div>", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n/* Styles for the table with the 'grid' class */\r\n.grid {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Styles for th elements within the table with the 'grid' class */\r\n.grid th {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n/* Styles for td elements within the table with the 'grid' class */\r\n.grid td {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n/* Styles for the first child th and td within the table with the 'grid' class */\r\n.grid th:first-child,\r\n.grid td:first-child {\r\n min-width: 150px;\r\n text-align: left;\r\n}\r\n\r\n/* Styles for non-first-child th and td elements within the table with the 'grid' class */\r\n.grid th:not(:first-child),\r\n.grid td:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n/* Alternating row background colors for the table with the 'grid' class */\r\n.grid tr:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid tr:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}\r\n\r\n"] }]
|
|
337
|
+
}], () => [{ type: i1.Router }], { ApplicationName: [{
|
|
338
|
+
type: Input
|
|
339
|
+
}], EntityID: [{
|
|
340
|
+
type: Input
|
|
341
|
+
}], Mode: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}], ApplicationRecord: [{
|
|
344
|
+
type: Input
|
|
345
|
+
}], EntityRecord: [{
|
|
346
|
+
type: Input
|
|
347
|
+
}] }); })();
|
|
348
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ApplicationEntitiesGridComponent, { className: "ApplicationEntitiesGridComponent", filePath: "src\\lib\\application-entities-grid\\application-entities-grid.component.ts", lineNumber: 45 }); })();
|
package/dist/lib/module.d.ts
CHANGED
|
@@ -3,24 +3,26 @@ import * as i1 from "./single-role/single-role.component";
|
|
|
3
3
|
import * as i2 from "./settings/settings.component";
|
|
4
4
|
import * as i3 from "./user-roles-grid/user-roles-grid.component";
|
|
5
5
|
import * as i4 from "./single-user/single-user.component";
|
|
6
|
-
import * as i5 from "
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "@angular/
|
|
9
|
-
import * as i8 from "@progress/kendo-angular-
|
|
10
|
-
import * as i9 from "@
|
|
11
|
-
import * as i10 from "@
|
|
12
|
-
import * as i11 from "@
|
|
13
|
-
import * as i12 from "@
|
|
14
|
-
import * as i13 from "@
|
|
15
|
-
import * as i14 from "@progress/kendo-angular-
|
|
16
|
-
import * as i15 from "@
|
|
17
|
-
import * as i16 from "@progress/kendo-angular-
|
|
18
|
-
import * as i17 from "@memberjunction/ng-entity-
|
|
19
|
-
import * as i18 from "@progress/kendo-angular-
|
|
20
|
-
import * as i19 from "@memberjunction/ng-
|
|
21
|
-
import * as i20 from "@
|
|
6
|
+
import * as i5 from "./single-application/single-application.component";
|
|
7
|
+
import * as i6 from "./application-entities-grid/application-entities-grid.component";
|
|
8
|
+
import * as i7 from "@angular/common";
|
|
9
|
+
import * as i8 from "@progress/kendo-angular-grid";
|
|
10
|
+
import * as i9 from "@angular/forms";
|
|
11
|
+
import * as i10 from "@progress/kendo-angular-dialog";
|
|
12
|
+
import * as i11 from "@progress/kendo-angular-excel-export";
|
|
13
|
+
import * as i12 from "@memberjunction/ng-compare-records";
|
|
14
|
+
import * as i13 from "@memberjunction/ng-container-directives";
|
|
15
|
+
import * as i14 from "@progress/kendo-angular-buttons";
|
|
16
|
+
import * as i15 from "@progress/kendo-angular-icons";
|
|
17
|
+
import * as i16 from "@progress/kendo-angular-dropdowns";
|
|
18
|
+
import * as i17 from "@memberjunction/ng-entity-permissions";
|
|
19
|
+
import * as i18 from "@progress/kendo-angular-layout";
|
|
20
|
+
import * as i19 from "@memberjunction/ng-entity-form-dialog";
|
|
21
|
+
import * as i20 from "@progress/kendo-angular-indicators";
|
|
22
|
+
import * as i21 from "@memberjunction/ng-user-view-grid";
|
|
23
|
+
import * as i22 from "@memberjunction/ng-simple-record-list";
|
|
22
24
|
export declare class ExplorerSettingsModule {
|
|
23
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExplorerSettingsModule, never>;
|
|
24
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ExplorerSettingsModule, [typeof i1.SingleRoleComponent, typeof i2.SettingsComponent, typeof i3.UserRolesGridComponent, typeof i4.SingleUserComponent], [typeof
|
|
26
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ExplorerSettingsModule, [typeof i1.SingleRoleComponent, typeof i2.SettingsComponent, typeof i3.UserRolesGridComponent, typeof i4.SingleUserComponent, typeof i5.SingleApplicationComponent, typeof i6.ApplicationEntitiesGridComponent], [typeof i7.CommonModule, typeof i8.GridModule, typeof i9.FormsModule, typeof i10.DialogsModule, typeof i11.ExcelExportModule, typeof i12.CompareRecordsModule, typeof i13.ContainerDirectivesModule, typeof i14.ButtonsModule, typeof i15.IconsModule, typeof i16.DropDownsModule, typeof i17.EntityPermissionsModule, typeof i18.TabStripModule, typeof i10.DialogsModule, typeof i19.EntityFormDialogModule, typeof i20.IndicatorsModule, typeof i21.UserViewGridModule, typeof i22.SimpleRecordListModule], [typeof i1.SingleRoleComponent, typeof i2.SettingsComponent, typeof i3.UserRolesGridComponent, typeof i4.SingleUserComponent, typeof i5.SingleApplicationComponent, typeof i6.ApplicationEntitiesGridComponent]>;
|
|
25
27
|
static ɵinj: i0.ɵɵInjectorDeclaration<ExplorerSettingsModule>;
|
|
26
28
|
}
|
package/dist/lib/module.js
CHANGED
|
@@ -20,6 +20,8 @@ import { IndicatorsModule } from '@progress/kendo-angular-indicators';
|
|
|
20
20
|
import { SingleUserComponent } from './single-user/single-user.component';
|
|
21
21
|
import { UserViewGridModule } from '@memberjunction/ng-user-view-grid';
|
|
22
22
|
import { SimpleRecordListModule } from '@memberjunction/ng-simple-record-list';
|
|
23
|
+
import { SingleApplicationComponent } from './single-application/single-application.component';
|
|
24
|
+
import { ApplicationEntitiesGridComponent } from './application-entities-grid/application-entities-grid.component';
|
|
23
25
|
import * as i0 from "@angular/core";
|
|
24
26
|
import * as i1 from "@angular/common";
|
|
25
27
|
import * as i2 from "@memberjunction/ng-container-directives";
|
|
@@ -56,7 +58,9 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
56
58
|
SingleRoleComponent,
|
|
57
59
|
SettingsComponent,
|
|
58
60
|
UserRolesGridComponent,
|
|
59
|
-
SingleUserComponent
|
|
61
|
+
SingleUserComponent,
|
|
62
|
+
SingleApplicationComponent,
|
|
63
|
+
ApplicationEntitiesGridComponent
|
|
60
64
|
],
|
|
61
65
|
imports: [
|
|
62
66
|
CommonModule,
|
|
@@ -81,14 +85,18 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
81
85
|
SingleRoleComponent,
|
|
82
86
|
SettingsComponent,
|
|
83
87
|
UserRolesGridComponent,
|
|
84
|
-
SingleUserComponent
|
|
88
|
+
SingleUserComponent,
|
|
89
|
+
SingleApplicationComponent,
|
|
90
|
+
ApplicationEntitiesGridComponent
|
|
85
91
|
]
|
|
86
92
|
}]
|
|
87
93
|
}], null, null); })();
|
|
88
94
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ExplorerSettingsModule, { declarations: [SingleRoleComponent,
|
|
89
95
|
SettingsComponent,
|
|
90
96
|
UserRolesGridComponent,
|
|
91
|
-
SingleUserComponent
|
|
97
|
+
SingleUserComponent,
|
|
98
|
+
SingleApplicationComponent,
|
|
99
|
+
ApplicationEntitiesGridComponent], imports: [CommonModule,
|
|
92
100
|
GridModule,
|
|
93
101
|
FormsModule,
|
|
94
102
|
DialogsModule,
|
|
@@ -107,5 +115,7 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
107
115
|
SimpleRecordListModule], exports: [SingleRoleComponent,
|
|
108
116
|
SettingsComponent,
|
|
109
117
|
UserRolesGridComponent,
|
|
110
|
-
SingleUserComponent
|
|
118
|
+
SingleUserComponent,
|
|
119
|
+
SingleApplicationComponent,
|
|
120
|
+
ApplicationEntitiesGridComponent] }); })();
|
|
111
121
|
i0.ɵɵsetComponentScope(SingleRoleComponent, [i1.NgIf, i2.FillContainer, i3.SVGIconComponent, i4.EntityPermissionsGridComponent, i5.TabStripComponent, i5.TabStripTabComponent, i5.TabContentDirective, i6.EntityFormDialog, i7.LoaderComponent, UserRolesGridComponent], []);
|
|
@@ -2,20 +2,40 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { BaseEntity } from '@memberjunction/core';
|
|
4
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
|
+
}
|
|
5
14
|
export declare class SettingsComponent implements OnInit {
|
|
6
15
|
private router;
|
|
7
16
|
private activatedRoute;
|
|
8
|
-
currentItem:
|
|
17
|
+
currentItem: SettingsItem;
|
|
9
18
|
baseRoute: string;
|
|
10
19
|
selectedRoleName: string;
|
|
11
20
|
selectedUserID: number;
|
|
12
|
-
|
|
21
|
+
selectedApplicationName: string;
|
|
22
|
+
options: {
|
|
23
|
+
label: string;
|
|
24
|
+
value: SettingsItem;
|
|
25
|
+
}[];
|
|
26
|
+
selectItem(item: SettingsItem | string, changeRoute?: boolean): void;
|
|
13
27
|
changeRoute(subPath: string): void;
|
|
14
28
|
constructor(router: Router, activatedRoute: ActivatedRoute);
|
|
15
29
|
ngOnInit(): void;
|
|
16
30
|
updateComponentStateBasedOnPath(): void;
|
|
31
|
+
selectApplication(a: BaseEntity): void;
|
|
17
32
|
selectRole(r: BaseEntity): void;
|
|
18
33
|
selectUser(r: BaseEntity): void;
|
|
34
|
+
selectRoute(route: string, value: any): void;
|
|
35
|
+
leftNavItemSelected(option: {
|
|
36
|
+
label: string;
|
|
37
|
+
value: any;
|
|
38
|
+
}): boolean;
|
|
19
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsComponent, never>;
|
|
20
40
|
static ɵcmp: i0.ɵɵComponentDeclaration<SettingsComponent, "mj-settings", never, {}, {}, never, never, false, never>;
|
|
21
41
|
}
|
|
@@ -9,52 +9,97 @@ import * as i4 from "@memberjunction/ng-entity-permissions";
|
|
|
9
9
|
import * as i5 from "@memberjunction/ng-simple-record-list";
|
|
10
10
|
import * as i6 from "../single-role/single-role.component";
|
|
11
11
|
import * as i7 from "../single-user/single-user.component";
|
|
12
|
-
|
|
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) {
|
|
13
27
|
i0.ɵɵelementStart(0, "div");
|
|
14
28
|
i0.ɵɵelement(1, "mj-entity-permissions-selector-with-grid");
|
|
15
29
|
i0.ɵɵelementEnd();
|
|
16
30
|
} }
|
|
17
31
|
const _c0 = () => ["Name", "Email", "IsActive", "Type"];
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
i0.ɵɵelementStart(0, "div")(1, "mj-simple-record-list",
|
|
21
|
-
i0.ɵɵlistener("RecordSelected", function
|
|
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)); });
|
|
22
36
|
i0.ɵɵelementEnd()();
|
|
23
37
|
} if (rf & 2) {
|
|
24
38
|
i0.ɵɵadvance();
|
|
25
39
|
i0.ɵɵproperty("Columns", i0.ɵɵpureFunction0(1, _c0));
|
|
26
40
|
} }
|
|
27
|
-
function
|
|
41
|
+
function SettingsComponent_div_6_Template(rf, ctx) { if (rf & 1) {
|
|
28
42
|
i0.ɵɵelementStart(0, "div");
|
|
29
|
-
i0.ɵɵelement(1, "mj-single-user",
|
|
43
|
+
i0.ɵɵelement(1, "mj-single-user", 7);
|
|
30
44
|
i0.ɵɵelementEnd();
|
|
31
45
|
} if (rf & 2) {
|
|
32
|
-
const
|
|
46
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
33
47
|
i0.ɵɵadvance();
|
|
34
|
-
i0.ɵɵproperty("UserID",
|
|
48
|
+
i0.ɵɵproperty("UserID", ctx_r3.selectedUserID);
|
|
35
49
|
} }
|
|
36
50
|
const _c1 = () => ["Name", "Description"];
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
i0.ɵɵelementStart(0, "div")(1, "mj-simple-record-list",
|
|
40
|
-
i0.ɵɵlistener("RecordSelected", function
|
|
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));
|
|
59
|
+
} }
|
|
60
|
+
function SettingsComponent_div_8_Template(rf, ctx) { if (rf & 1) {
|
|
61
|
+
i0.ɵɵelementStart(0, "div");
|
|
62
|
+
i0.ɵɵelement(1, "mj-single-role", 9);
|
|
63
|
+
i0.ɵɵelementEnd();
|
|
64
|
+
} if (rf & 2) {
|
|
65
|
+
const ctx_r5 = i0.ɵɵnextContext();
|
|
66
|
+
i0.ɵɵadvance();
|
|
67
|
+
i0.ɵɵproperty("RoleName", ctx_r5.selectedRoleName);
|
|
68
|
+
} }
|
|
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)); });
|
|
41
73
|
i0.ɵɵelementEnd()();
|
|
42
74
|
} if (rf & 2) {
|
|
43
75
|
i0.ɵɵadvance();
|
|
44
76
|
i0.ɵɵproperty("Columns", i0.ɵɵpureFunction0(1, _c1));
|
|
45
77
|
} }
|
|
46
|
-
function
|
|
78
|
+
function SettingsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
|
|
47
79
|
i0.ɵɵelementStart(0, "div");
|
|
48
|
-
i0.ɵɵelement(1, "mj-single-
|
|
80
|
+
i0.ɵɵelement(1, "mj-single-application", 11);
|
|
49
81
|
i0.ɵɵelementEnd();
|
|
50
82
|
} if (rf & 2) {
|
|
51
|
-
const
|
|
83
|
+
const ctx_r7 = i0.ɵɵnextContext();
|
|
52
84
|
i0.ɵɵadvance();
|
|
53
|
-
i0.ɵɵproperty("
|
|
85
|
+
i0.ɵɵproperty("ApplicationName", ctx_r7.selectedApplicationName);
|
|
54
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 = {}));
|
|
55
97
|
export class SettingsComponent {
|
|
56
98
|
selectItem(item, changeRoute = true) {
|
|
57
|
-
|
|
99
|
+
if (typeof item === 'string')
|
|
100
|
+
this.currentItem = SettingsItem[item];
|
|
101
|
+
else
|
|
102
|
+
this.currentItem = item;
|
|
58
103
|
if (changeRoute)
|
|
59
104
|
this.changeRoute(item.toLowerCase());
|
|
60
105
|
}
|
|
@@ -65,10 +110,17 @@ export class SettingsComponent {
|
|
|
65
110
|
constructor(router, activatedRoute) {
|
|
66
111
|
this.router = router;
|
|
67
112
|
this.activatedRoute = activatedRoute;
|
|
68
|
-
this.currentItem =
|
|
113
|
+
this.currentItem = SettingsItem.Users;
|
|
69
114
|
this.baseRoute = '/settings';
|
|
70
115
|
this.selectedRoleName = '';
|
|
71
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
|
+
];
|
|
72
124
|
}
|
|
73
125
|
ngOnInit() {
|
|
74
126
|
// manually update the first time
|
|
@@ -87,61 +139,64 @@ export class SettingsComponent {
|
|
|
87
139
|
const firstSegment = segments.length > 1 ? segments[1] : '';
|
|
88
140
|
switch (firstSegment.trim().toLowerCase()) {
|
|
89
141
|
case 'entitypermissions':
|
|
90
|
-
this.selectItem(
|
|
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);
|
|
91
150
|
break;
|
|
92
151
|
case 'users':
|
|
93
|
-
this.selectItem(
|
|
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);
|
|
94
157
|
break;
|
|
95
158
|
case 'roles':
|
|
96
|
-
this.selectItem(
|
|
159
|
+
this.selectItem(SettingsItem.Roles, false);
|
|
97
160
|
break;
|
|
98
161
|
case 'role':
|
|
99
162
|
this.selectedRoleName = segments.length > 2 ? segments[2] : '';
|
|
100
|
-
this.selectItem(
|
|
101
|
-
break;
|
|
102
|
-
case 'user':
|
|
103
|
-
this.selectedUserID = segments.length > 2 ? parseInt(segments[2]) : 0;
|
|
104
|
-
this.selectItem('User', 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
|
+
}
|
|
110
172
|
selectRole(r) {
|
|
111
|
-
|
|
112
|
-
this.router.navigate(['/settings/role', r.Name]);
|
|
173
|
+
this.selectRoute('/settings/role', r.Name);
|
|
113
174
|
}
|
|
114
175
|
selectUser(r) {
|
|
115
|
-
|
|
116
|
-
|
|
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';
|
|
117
185
|
}
|
|
118
186
|
}
|
|
119
187
|
SettingsComponent.ɵfac = function SettingsComponent_Factory(t) { return new (t || SettingsComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute)); };
|
|
120
|
-
SettingsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsComponent, selectors: [["mj-settings"]], decls:
|
|
121
|
-
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)
|
|
122
|
-
i0.ɵɵ
|
|
123
|
-
i0.ɵɵtext(3, "Users");
|
|
124
|
-
i0.ɵɵelementEnd();
|
|
125
|
-
i0.ɵɵelementStart(4, "div", 2);
|
|
126
|
-
i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_4_listener() { return ctx.selectItem("Roles"); });
|
|
127
|
-
i0.ɵɵtext(5, "Roles");
|
|
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);
|
|
128
191
|
i0.ɵɵelementEnd();
|
|
129
|
-
i0.ɵɵelementStart(
|
|
130
|
-
i0.ɵɵ
|
|
131
|
-
i0.ɵɵtext(7, "Entity Permissions");
|
|
132
|
-
i0.ɵɵelementEnd()();
|
|
133
|
-
i0.ɵɵelementStart(8, "div", 3);
|
|
134
|
-
i0.ɵɵtemplate(9, SettingsComponent_div_9_Template, 2, 0, "div", 4)(10, SettingsComponent_div_10_Template, 2, 2, "div", 4)(11, SettingsComponent_div_11_Template, 2, 1, "div", 4)(12, SettingsComponent_div_12_Template, 2, 2, "div", 4)(13, SettingsComponent_div_13_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);
|
|
135
194
|
i0.ɵɵelementEnd()();
|
|
136
195
|
} if (rf & 2) {
|
|
137
196
|
i0.ɵɵproperty("fillWidth", false)("bottomMargin", 5);
|
|
138
197
|
i0.ɵɵadvance(2);
|
|
139
|
-
i0.ɵɵ
|
|
140
|
-
i0.ɵɵadvance(2);
|
|
141
|
-
i0.ɵɵclassProp("selected", ctx.currentItem === "Roles" || ctx.currentItem === "Role");
|
|
198
|
+
i0.ɵɵproperty("ngForOf", ctx.options);
|
|
142
199
|
i0.ɵɵadvance(2);
|
|
143
|
-
i0.ɵɵclassProp("selected", ctx.currentItem === "EntityPermissions");
|
|
144
|
-
i0.ɵɵadvance(3);
|
|
145
200
|
i0.ɵɵproperty("ngIf", ctx.currentItem === "EntityPermissions");
|
|
146
201
|
i0.ɵɵadvance();
|
|
147
202
|
i0.ɵɵproperty("ngIf", ctx.currentItem === "Users");
|
|
@@ -151,9 +206,13 @@ SettingsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsC
|
|
|
151
206
|
i0.ɵɵproperty("ngIf", ctx.currentItem === "Roles");
|
|
152
207
|
i0.ɵɵadvance();
|
|
153
208
|
i0.ɵɵproperty("ngIf", ctx.currentItem === "Role");
|
|
154
|
-
|
|
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}"] });
|
|
155
214
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SettingsComponent, [{
|
|
156
215
|
type: Component,
|
|
157
|
-
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
|
|
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"] }]
|
|
158
217
|
}], () => [{ type: i1.Router }, { type: i1.ActivatedRoute }], null); })();
|
|
159
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsComponent, { className: "SettingsComponent", filePath: "src\\lib\\settings\\settings.component.ts", lineNumber:
|
|
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
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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 "../application-entities-grid/application-entities-grid.component";
|
|
21
|
+
const _c0 = ["entityForm"];
|
|
22
|
+
function SingleApplicationComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵelementStart(0, "div");
|
|
24
|
+
i0.ɵɵelement(1, "kendo-loader");
|
|
25
|
+
i0.ɵɵelementEnd();
|
|
26
|
+
} }
|
|
27
|
+
function SingleApplicationComponent_div_2_ng_template_16_mj_application_entities_grid_0_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
i0.ɵɵelement(0, "mj-application-entities-grid", 11);
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r4 = i0.ɵɵnextContext(3);
|
|
31
|
+
i0.ɵɵproperty("ApplicationName", ctx_r4.ApplicationName)("ApplicationRecord", ctx_r4.Record);
|
|
32
|
+
} }
|
|
33
|
+
function SingleApplicationComponent_div_2_ng_template_16_Template(rf, ctx) { if (rf & 1) {
|
|
34
|
+
i0.ɵɵtemplate(0, SingleApplicationComponent_div_2_ng_template_16_mj_application_entities_grid_0_Template, 1, 2, "mj-application-entities-grid", 10);
|
|
35
|
+
} if (rf & 2) {
|
|
36
|
+
const ctx_r3 = i0.ɵɵnextContext(2);
|
|
37
|
+
i0.ɵɵproperty("ngIf", ctx_r3.ApplicationName && ctx_r3.Record);
|
|
38
|
+
} }
|
|
39
|
+
function SingleApplicationComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
41
|
+
i0.ɵɵelementStart(0, "div")(1, "table", 4)(2, "tbody")(3, "tr")(4, "th", 5);
|
|
42
|
+
i0.ɵɵtext(5, "Application");
|
|
43
|
+
i0.ɵɵelementEnd();
|
|
44
|
+
i0.ɵɵelementStart(6, "td");
|
|
45
|
+
i0.ɵɵtext(7);
|
|
46
|
+
i0.ɵɵelementStart(8, "kendo-svgicon", 6);
|
|
47
|
+
i0.ɵɵlistener("click", function SingleApplicationComponent_div_2_Template_kendo_svgicon_click_8_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.EditRecord()); });
|
|
48
|
+
i0.ɵɵelementEnd()()();
|
|
49
|
+
i0.ɵɵelementStart(9, "tr")(10, "th", 5);
|
|
50
|
+
i0.ɵɵtext(11, "Description");
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
52
|
+
i0.ɵɵelementStart(12, "td");
|
|
53
|
+
i0.ɵɵtext(13);
|
|
54
|
+
i0.ɵɵelementEnd()()()();
|
|
55
|
+
i0.ɵɵelementStart(14, "kendo-tabstrip", 7)(15, "kendo-tabstrip-tab", 8);
|
|
56
|
+
i0.ɵɵtemplate(16, SingleApplicationComponent_div_2_ng_template_16_Template, 1, 1, "ng-template", 9);
|
|
57
|
+
i0.ɵɵelementEnd()()();
|
|
58
|
+
} if (rf & 2) {
|
|
59
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
60
|
+
i0.ɵɵadvance(7);
|
|
61
|
+
i0.ɵɵtextInterpolate(ctx_r1.Record.Name);
|
|
62
|
+
i0.ɵɵadvance();
|
|
63
|
+
i0.ɵɵproperty("icon", ctx_r1.kendoSVGIcon("pencil"));
|
|
64
|
+
i0.ɵɵadvance(5);
|
|
65
|
+
i0.ɵɵtextInterpolate(ctx_r1.Record.Description);
|
|
66
|
+
i0.ɵɵadvance();
|
|
67
|
+
i0.ɵɵproperty("keepTabContent", true)("animate", false);
|
|
68
|
+
i0.ɵɵadvance();
|
|
69
|
+
i0.ɵɵproperty("selected", true);
|
|
70
|
+
} }
|
|
71
|
+
export class SingleApplicationComponent {
|
|
72
|
+
constructor(cdRef) {
|
|
73
|
+
this.cdRef = cdRef;
|
|
74
|
+
this.gridHeight = 750;
|
|
75
|
+
this.isLoading = false;
|
|
76
|
+
this.Record = null;
|
|
77
|
+
this.kendoSVGIcon = kendoSVGIcon;
|
|
78
|
+
this.showEntityEditingForm = false;
|
|
79
|
+
}
|
|
80
|
+
ngOnInit() {
|
|
81
|
+
this.Refresh();
|
|
82
|
+
}
|
|
83
|
+
Refresh() {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
if (this.ApplicationName && this.ApplicationName.length > 0) {
|
|
86
|
+
this.isLoading = true;
|
|
87
|
+
const md = new Metadata();
|
|
88
|
+
let a = md.Applications.find(a => a.Name === this.ApplicationName);
|
|
89
|
+
if (!a) {
|
|
90
|
+
// sometime we are creating a new role, so attempt to refresh our metadata
|
|
91
|
+
yield md.Refresh();
|
|
92
|
+
a = md.Applications.find(aa => aa.Name === this.ApplicationName);
|
|
93
|
+
if (!a)
|
|
94
|
+
throw new Error(`Application ${this.ApplicationName} not found`);
|
|
95
|
+
}
|
|
96
|
+
this.Record = yield md.GetEntityObject('Applications');
|
|
97
|
+
yield this.Record.Load(a.ID);
|
|
98
|
+
}
|
|
99
|
+
this.isLoading = false;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
EditRecord() {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
// show the dialog
|
|
105
|
+
this.showEntityEditingForm = true;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
onEntityFormClosed(result) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
this.showEntityEditingForm = false;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
SingleApplicationComponent.ɵfac = function SingleApplicationComponent_Factory(t) { return new (t || SingleApplicationComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
115
|
+
SingleApplicationComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleApplicationComponent, selectors: [["mj-single-application"]], viewQuery: function SingleApplicationComponent_Query(rf, ctx) { if (rf & 1) {
|
|
116
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
117
|
+
} if (rf & 2) {
|
|
118
|
+
let _t;
|
|
119
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.entityFormComponent = _t.first);
|
|
120
|
+
} }, inputs: { ApplicationName: "ApplicationName" }, 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", "Entities", 3, "selected"], ["kendoTabContent", ""], ["Mode", "Applications", 3, "ApplicationName", "ApplicationRecord", 4, "ngIf"], ["Mode", "Applications", 3, "ApplicationName", "ApplicationRecord"]], template: function SingleApplicationComponent_Template(rf, ctx) { if (rf & 1) {
|
|
121
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
122
|
+
i0.ɵɵtemplate(1, SingleApplicationComponent_div_1_Template, 2, 0, "div", 1)(2, SingleApplicationComponent_div_2_Template, 17, 6, "div", 1);
|
|
123
|
+
i0.ɵɵelementEnd();
|
|
124
|
+
i0.ɵɵelementStart(3, "mj-entity-form-dialog", 2, 3);
|
|
125
|
+
i0.ɵɵlistener("close", function SingleApplicationComponent_Template_mj_entity_form_dialog_close_3_listener($event) { return ctx.onEntityFormClosed($event); });
|
|
126
|
+
i0.ɵɵelementEnd();
|
|
127
|
+
} if (rf & 2) {
|
|
128
|
+
i0.ɵɵadvance();
|
|
129
|
+
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
130
|
+
i0.ɵɵadvance();
|
|
131
|
+
i0.ɵɵproperty("ngIf", !ctx.isLoading && ctx.Record);
|
|
132
|
+
i0.ɵɵadvance();
|
|
133
|
+
i0.ɵɵproperty("Record", ctx.Record)("Visible", ctx.showEntityEditingForm)("AutoRevertOnCancel", true)("HandleSave", true)("Width", 550)("Height", 450);
|
|
134
|
+
} }, dependencies: [i1.NgIf, i2.FillContainer, i3.SVGIconComponent, i4.TabStripComponent, i4.TabStripTabComponent, i4.TabContentDirective, i5.EntityFormDialog, i6.LoaderComponent, i7.ApplicationEntitiesGridComponent], 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}"] });
|
|
135
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleApplicationComponent, [{
|
|
136
|
+
type: Component,
|
|
137
|
+
args: [{ selector: 'mj-single-application', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n <div *ngIf=\"!isLoading && Record\">\r\n <table class=\"info-table\">\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\">Application</th>\r\n <td>{{Record.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>{{Record.Description}}</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=\"Entities\" [selected]=\"true\">\r\n <ng-template kendoTabContent>\r\n <mj-application-entities-grid *ngIf=\"ApplicationName && Record\" Mode=\"Applications\" [ApplicationName]=\"ApplicationName\" [ApplicationRecord]=\"Record\"></mj-application-entities-grid>\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]=\"Record\" \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}"] }]
|
|
138
|
+
}], () => [{ type: i0.ChangeDetectorRef }], { ApplicationName: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], entityFormComponent: [{
|
|
141
|
+
type: ViewChild,
|
|
142
|
+
args: ['entityForm']
|
|
143
|
+
}] }); })();
|
|
144
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleApplicationComponent, { className: "SingleApplicationComponent", filePath: "src\\lib\\single-application\\single-application.component.ts", lineNumber: 14 }); })();
|
|
@@ -148,8 +148,8 @@ export class SingleRoleComponent {
|
|
|
148
148
|
}
|
|
149
149
|
Refresh() {
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
this.isLoading = true;
|
|
151
152
|
const md = new Metadata();
|
|
152
|
-
this.RoleRecord = yield md.GetEntityObject('Roles');
|
|
153
153
|
let r = md.Roles.find(r => r.Name === this.RoleName);
|
|
154
154
|
if (!r) {
|
|
155
155
|
// sometime we are creating a new role, so attempt to refresh our metadata
|
|
@@ -158,7 +158,9 @@ export class SingleRoleComponent {
|
|
|
158
158
|
if (!r)
|
|
159
159
|
throw new Error(`Role ${this.RoleName} not found`);
|
|
160
160
|
}
|
|
161
|
+
this.RoleRecord = yield md.GetEntityObject('Roles');
|
|
161
162
|
yield this.RoleRecord.Load(r.ID);
|
|
163
|
+
this.isLoading = false;
|
|
162
164
|
});
|
|
163
165
|
}
|
|
164
166
|
EditRecord() {
|
|
@@ -302,10 +302,10 @@ UserRolesGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: User
|
|
|
302
302
|
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
303
303
|
i0.ɵɵadvance();
|
|
304
304
|
i0.ɵɵproperty("ngIf", !ctx.isLoading);
|
|
305
|
-
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.CheckboxControlValueAccessor, i3.NgControlStatus, i3.NgModel, i4.ButtonComponent, i5.LoaderComponent], styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n width: 150px;\r\n text-align: left;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}"] });
|
|
305
|
+
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.CheckboxControlValueAccessor, i3.NgControlStatus, i3.NgModel, i4.ButtonComponent, i5.LoaderComponent], styles: ["button[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n min-width: 150px;\r\n text-align: left;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), .grid[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}"] });
|
|
306
306
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserRolesGridComponent, [{
|
|
307
307
|
type: Component,
|
|
308
|
-
args: [{ selector: 'mj-user-roles-grid', template: "<div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n<div class=\"content\" *ngIf=\"!isLoading\">\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"saveUserRoles()\">Save</button>\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"cancelEdit()\">Cancel</button>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"Mode === 'Roles'\">User</th>\r\n <th *ngIf=\"Mode === 'Users'\">Role</th>\r\n <th (click)=\"flipAll()\">In Role</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let ur of userRoles\">\r\n <td *ngIf=\"Mode === 'Roles'\">{{ ur.User }}</td>\r\n <td *ngIf=\"Mode === 'Users'\">{{ ur.RoleName }}</td>\r\n <td (click)=\"flipState($event, ur, true)\">\r\n <input type=\"checkbox\" kendoCheckBox [(ngModel)]=\"ur.Selected\" (click)=\"flipState($event, ur, false)\">\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n</div>", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n/* Styles for the table with the 'grid' class */\r\n.grid {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Styles for th elements within the table with the 'grid' class */\r\n.grid th {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n/* Styles for td elements within the table with the 'grid' class */\r\n.grid td {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n/* Styles for the first child th and td within the table with the 'grid' class */\r\n.grid th:first-child,\r\n.grid td:first-child {\r\n width: 150px;\r\n text-align: left;\r\n}\r\n\r\n/* Styles for non-first-child th and td elements within the table with the 'grid' class */\r\n.grid th:not(:first-child),\r\n.grid td:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n/* Alternating row background colors for the table with the 'grid' class */\r\n.grid tr:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid tr:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}\r\n\r\n"] }]
|
|
308
|
+
args: [{ selector: 'mj-user-roles-grid', template: "<div *ngIf=\"isLoading\"><kendo-loader></kendo-loader></div>\r\n<div class=\"content\" *ngIf=\"!isLoading\">\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"saveUserRoles()\">Save</button>\r\n <button [disabled]=\"NumDirty === 0\" kendoButton (click)=\"cancelEdit()\">Cancel</button>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th *ngIf=\"Mode === 'Roles'\">User</th>\r\n <th *ngIf=\"Mode === 'Users'\">Role</th>\r\n <th (click)=\"flipAll()\">In Role</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let ur of userRoles\">\r\n <td *ngIf=\"Mode === 'Roles'\">{{ ur.User }}</td>\r\n <td *ngIf=\"Mode === 'Users'\">{{ ur.RoleName }}</td>\r\n <td (click)=\"flipState($event, ur, true)\">\r\n <input type=\"checkbox\" kendoCheckBox [(ngModel)]=\"ur.Selected\" (click)=\"flipState($event, ur, false)\">\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table> \r\n</div>", styles: ["button {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n width: 125px;\r\n}\r\n\r\n/* Styles for the table with the 'grid' class */\r\n.grid {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse;\r\n}\r\n\r\n/* Styles for th elements within the table with the 'grid' class */\r\n.grid th {\r\n background-color: #f2f2f2;\r\n color: black;\r\n font-weight: bold;\r\n text-align: center;\r\n border: 1px solid gray;\r\n padding: 0 8px;\r\n cursor: pointer;\r\n}\r\n\r\n/* Styles for td elements within the table with the 'grid' class */\r\n.grid td {\r\n border: 1px solid gray;\r\n height: 36px;\r\n text-align: center;\r\n padding: 0 8px;\r\n}\r\n\r\n/* Styles for the first child th and td within the table with the 'grid' class */\r\n.grid th:first-child,\r\n.grid td:first-child {\r\n min-width: 150px;\r\n text-align: left;\r\n}\r\n\r\n/* Styles for non-first-child th and td elements within the table with the 'grid' class */\r\n.grid th:not(:first-child),\r\n.grid td:not(:first-child) {\r\n width: 100px;\r\n}\r\n\r\n/* Alternating row background colors for the table with the 'grid' class */\r\n.grid tr:nth-child(odd) {\r\n background-color: white;\r\n}\r\n\r\n.grid tr:nth-child(even) {\r\n background-color: #e7f4ff;\r\n}\r\n\r\n"] }]
|
|
309
309
|
}], () => [{ type: i1.Router }], { RoleName: [{
|
|
310
310
|
type: Input
|
|
311
311
|
}], UserID: [{
|
package/dist/public-api.d.ts
CHANGED
|
@@ -2,4 +2,6 @@ export * from './lib/single-role/single-role.component';
|
|
|
2
2
|
export * from './lib/settings/settings.component';
|
|
3
3
|
export * from './lib/user-roles-grid/user-roles-grid.component';
|
|
4
4
|
export * from './lib/single-user/single-user.component';
|
|
5
|
+
export * from './lib/single-application/single-application.component';
|
|
6
|
+
export * from './lib/application-entities-grid/application-entities-grid.component';
|
|
5
7
|
export * from './lib/module';
|
package/dist/public-api.js
CHANGED
|
@@ -5,4 +5,6 @@ export * from './lib/single-role/single-role.component';
|
|
|
5
5
|
export * from './lib/settings/settings.component';
|
|
6
6
|
export * from './lib/user-roles-grid/user-roles-grid.component';
|
|
7
7
|
export * from './lib/single-user/single-user.component';
|
|
8
|
+
export * from './lib/single-application/single-application.component';
|
|
9
|
+
export * from './lib/application-entities-grid/application-entities-grid.component';
|
|
8
10
|
export * from './lib/module';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-explorer-settings",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.13",
|
|
4
4
|
"description": "MemberJunction: Reusable Angular components for the settings section of the MJ Explorer App",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"@angular/router": "~17.2.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@memberjunction/core-entities": "^0.9.
|
|
28
|
+
"@memberjunction/core-entities": "^0.9.167",
|
|
29
29
|
"@memberjunction/global": "^0.9.156",
|
|
30
30
|
"@memberjunction/core": "^0.9.177",
|
|
31
31
|
"@memberjunction/ng-container-directives": "^0.9.141",
|
|
32
|
-
"@memberjunction/ng-shared": "^0.9.
|
|
33
|
-
"@memberjunction/ng-entity-permissions": "^0.9.
|
|
34
|
-
"@memberjunction/ng-base-forms": "^0.9.
|
|
35
|
-
"@memberjunction/ng-entity-form-dialog": "^0.9.
|
|
36
|
-
"@memberjunction/ng-user-view-grid": "^0.9.
|
|
37
|
-
"@memberjunction/ng-simple-record-list": "^0.9.
|
|
32
|
+
"@memberjunction/ng-shared": "^0.9.35",
|
|
33
|
+
"@memberjunction/ng-entity-permissions": "^0.9.12",
|
|
34
|
+
"@memberjunction/ng-base-forms": "^0.9.4",
|
|
35
|
+
"@memberjunction/ng-entity-form-dialog": "^0.9.4",
|
|
36
|
+
"@memberjunction/ng-user-view-grid": "^0.9.218",
|
|
37
|
+
"@memberjunction/ng-simple-record-list": "^0.9.4",
|
|
38
38
|
"@progress/kendo-angular-dropdowns": "~15.1.0",
|
|
39
39
|
"@progress/kendo-angular-grid": "~15.1.0",
|
|
40
40
|
"@progress/kendo-angular-buttons": "~15.1.0",
|