@memberjunction/ng-explorer-settings 0.9.2 → 0.9.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/module.d.ts +14 -11
- package/dist/lib/module.js +20 -6
- package/dist/lib/roles-list/roles-list.component.d.ts +15 -0
- package/dist/lib/roles-list/roles-list.component.js +102 -0
- package/dist/lib/settings/settings.component.d.ts +17 -0
- package/dist/lib/settings/settings.component.js +148 -0
- package/dist/lib/single-role/single-role.component.js +1 -1
- package/dist/public-api.d.ts +2 -0
- package/dist/public-api.js +2 -0
- package/package.json +41 -38
package/dist/lib/module.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./single-role/single-role.component";
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/
|
|
6
|
-
import * as i5 from "@progress/kendo-angular-
|
|
7
|
-
import * as i6 from "@
|
|
8
|
-
import * as i7 from "@
|
|
9
|
-
import * as i8 from "@
|
|
10
|
-
import * as i9 from "@
|
|
11
|
-
import * as i10 from "@
|
|
12
|
-
import * as i11 from "@progress/kendo-angular-
|
|
3
|
+
import * as i2 from "./settings/settings.component";
|
|
4
|
+
import * as i3 from "./roles-list/roles-list.component";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@progress/kendo-angular-grid";
|
|
7
|
+
import * as i6 from "@angular/forms";
|
|
8
|
+
import * as i7 from "@progress/kendo-angular-dialog";
|
|
9
|
+
import * as i8 from "@progress/kendo-angular-excel-export";
|
|
10
|
+
import * as i9 from "@memberjunction/ng-compare-records";
|
|
11
|
+
import * as i10 from "@memberjunction/ng-container-directives";
|
|
12
|
+
import * as i11 from "@progress/kendo-angular-buttons";
|
|
13
|
+
import * as i12 from "@progress/kendo-angular-icons";
|
|
14
|
+
import * as i13 from "@progress/kendo-angular-dropdowns";
|
|
15
|
+
import * as i14 from "@memberjunction/ng-entity-permissions";
|
|
13
16
|
export declare class ExplorerSettingsModule {
|
|
14
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<ExplorerSettingsModule, never>;
|
|
15
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ExplorerSettingsModule, [typeof i1.SingleRoleComponent], [typeof
|
|
18
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ExplorerSettingsModule, [typeof i1.SingleRoleComponent, typeof i2.SettingsComponent, typeof i3.RolesListComponent], [typeof i4.CommonModule, typeof i5.GridModule, typeof i6.FormsModule, typeof i7.DialogsModule, typeof i8.ExcelExportModule, typeof i9.CompareRecordsModule, typeof i10.ContainerDirectivesModule, typeof i11.ButtonsModule, typeof i12.IconsModule, typeof i13.DropDownsModule, typeof i14.EntityPermissionsModule], [typeof i1.SingleRoleComponent, typeof i2.SettingsComponent, typeof i3.RolesListComponent]>;
|
|
16
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<ExplorerSettingsModule>;
|
|
17
20
|
}
|
package/dist/lib/module.js
CHANGED
|
@@ -11,6 +11,9 @@ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directiv
|
|
|
11
11
|
import { FormsModule } from '@angular/forms';
|
|
12
12
|
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
|
13
13
|
import { SingleRoleComponent } from './single-role/single-role.component';
|
|
14
|
+
import { SettingsComponent } from './settings/settings.component';
|
|
15
|
+
import { RolesListComponent } from './roles-list/roles-list.component';
|
|
16
|
+
import { EntityPermissionsModule } from '@memberjunction/ng-entity-permissions';
|
|
14
17
|
import * as i0 from "@angular/core";
|
|
15
18
|
export class ExplorerSettingsModule {
|
|
16
19
|
}
|
|
@@ -25,12 +28,15 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
25
28
|
ContainerDirectivesModule,
|
|
26
29
|
ButtonsModule,
|
|
27
30
|
IconsModule,
|
|
28
|
-
DropDownsModule
|
|
31
|
+
DropDownsModule,
|
|
32
|
+
EntityPermissionsModule] });
|
|
29
33
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ExplorerSettingsModule, [{
|
|
30
34
|
type: NgModule,
|
|
31
35
|
args: [{
|
|
32
36
|
declarations: [
|
|
33
|
-
SingleRoleComponent
|
|
37
|
+
SingleRoleComponent,
|
|
38
|
+
SettingsComponent,
|
|
39
|
+
RolesListComponent
|
|
34
40
|
],
|
|
35
41
|
imports: [
|
|
36
42
|
CommonModule,
|
|
@@ -42,14 +48,19 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
42
48
|
ContainerDirectivesModule,
|
|
43
49
|
ButtonsModule,
|
|
44
50
|
IconsModule,
|
|
45
|
-
DropDownsModule
|
|
51
|
+
DropDownsModule,
|
|
52
|
+
EntityPermissionsModule
|
|
46
53
|
],
|
|
47
54
|
exports: [
|
|
48
|
-
SingleRoleComponent
|
|
55
|
+
SingleRoleComponent,
|
|
56
|
+
SettingsComponent,
|
|
57
|
+
RolesListComponent
|
|
49
58
|
]
|
|
50
59
|
}]
|
|
51
60
|
}], null, null); })();
|
|
52
|
-
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ExplorerSettingsModule, { declarations: [SingleRoleComponent
|
|
61
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(ExplorerSettingsModule, { declarations: [SingleRoleComponent,
|
|
62
|
+
SettingsComponent,
|
|
63
|
+
RolesListComponent], imports: [CommonModule,
|
|
53
64
|
GridModule,
|
|
54
65
|
FormsModule,
|
|
55
66
|
DialogsModule,
|
|
@@ -58,4 +69,7 @@ ExplorerSettingsModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [C
|
|
|
58
69
|
ContainerDirectivesModule,
|
|
59
70
|
ButtonsModule,
|
|
60
71
|
IconsModule,
|
|
61
|
-
DropDownsModule
|
|
72
|
+
DropDownsModule,
|
|
73
|
+
EntityPermissionsModule], exports: [SingleRoleComponent,
|
|
74
|
+
SettingsComponent,
|
|
75
|
+
RolesListComponent] }); })();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { RoleEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class RolesListComponent implements OnInit {
|
|
6
|
+
private router;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
roles: RoleEntity[];
|
|
9
|
+
constructor(router: Router);
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
Refresh(): Promise<void>;
|
|
12
|
+
selectRole(r: RoleEntity): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RolesListComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RolesListComponent, "mj-roles-list", never, {}, {}, never, never, false, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 * as i0 from "@angular/core";
|
|
13
|
+
import * as i1 from "@angular/router";
|
|
14
|
+
import * as i2 from "@angular/common";
|
|
15
|
+
import * as i3 from "@memberjunction/ng-container-directives";
|
|
16
|
+
function RolesListComponent_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
+
i0.ɵɵelementStart(0, "div");
|
|
18
|
+
i0.ɵɵtext(1, "Loading...");
|
|
19
|
+
i0.ɵɵelementEnd();
|
|
20
|
+
} }
|
|
21
|
+
function RolesListComponent_table_2_tr_8_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
23
|
+
i0.ɵɵelementStart(0, "tr", 5);
|
|
24
|
+
i0.ɵɵlistener("click", function RolesListComponent_table_2_tr_8_Template_tr_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r5); const r_r3 = restoredCtx.$implicit; const ctx_r4 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r4.selectRole(r_r3)); });
|
|
25
|
+
i0.ɵɵelementStart(1, "td");
|
|
26
|
+
i0.ɵɵtext(2);
|
|
27
|
+
i0.ɵɵelementEnd();
|
|
28
|
+
i0.ɵɵelementStart(3, "td");
|
|
29
|
+
i0.ɵɵtext(4);
|
|
30
|
+
i0.ɵɵelementEnd()();
|
|
31
|
+
} if (rf & 2) {
|
|
32
|
+
const r_r3 = ctx.$implicit;
|
|
33
|
+
i0.ɵɵadvance(2);
|
|
34
|
+
i0.ɵɵtextInterpolate(r_r3.Name);
|
|
35
|
+
i0.ɵɵadvance(2);
|
|
36
|
+
i0.ɵɵtextInterpolate(r_r3.Description);
|
|
37
|
+
} }
|
|
38
|
+
function RolesListComponent_table_2_Template(rf, ctx) { if (rf & 1) {
|
|
39
|
+
i0.ɵɵelementStart(0, "table", 3)(1, "thead")(2, "tr")(3, "th");
|
|
40
|
+
i0.ɵɵtext(4, "Role");
|
|
41
|
+
i0.ɵɵelementEnd();
|
|
42
|
+
i0.ɵɵelementStart(5, "th");
|
|
43
|
+
i0.ɵɵtext(6, "Description");
|
|
44
|
+
i0.ɵɵelementEnd()()();
|
|
45
|
+
i0.ɵɵelementStart(7, "tbody");
|
|
46
|
+
i0.ɵɵtemplate(8, RolesListComponent_table_2_tr_8_Template, 5, 2, "tr", 4);
|
|
47
|
+
i0.ɵɵelementEnd()();
|
|
48
|
+
} if (rf & 2) {
|
|
49
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
50
|
+
i0.ɵɵadvance(8);
|
|
51
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.roles);
|
|
52
|
+
} }
|
|
53
|
+
export class RolesListComponent {
|
|
54
|
+
constructor(router) {
|
|
55
|
+
this.router = router;
|
|
56
|
+
this.isLoading = false;
|
|
57
|
+
this.roles = [];
|
|
58
|
+
}
|
|
59
|
+
ngOnInit() {
|
|
60
|
+
this.Refresh();
|
|
61
|
+
}
|
|
62
|
+
Refresh() {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const startTime = new Date().getTime();
|
|
65
|
+
this.isLoading = true;
|
|
66
|
+
const md = new Metadata();
|
|
67
|
+
const rv = new RunView();
|
|
68
|
+
const result = yield rv.RunView({
|
|
69
|
+
EntityName: 'Roles',
|
|
70
|
+
ResultType: 'entity_object'
|
|
71
|
+
});
|
|
72
|
+
if (result.Success) {
|
|
73
|
+
this.roles = result.Results;
|
|
74
|
+
this.roles.sort((a, b) => a.Name.localeCompare(b.Name));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new Error("Error loading roles: " + result.ErrorMessage);
|
|
78
|
+
}
|
|
79
|
+
this.isLoading = false;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
selectRole(r) {
|
|
83
|
+
// change the route to point to the /settings/role/{r.Name} route
|
|
84
|
+
this.router.navigate(['/settings/role', r.Name]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
RolesListComponent.ɵfac = function RolesListComponent_Factory(t) { return new (t || RolesListComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
|
|
88
|
+
RolesListComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RolesListComponent, selectors: [["mj-roles-list"]], decls: 3, vars: 2, consts: [["mjFillContainer", ""], [4, "ngIf"], ["class", "grid", 4, "ngIf"], [1, "grid"], [3, "click", 4, "ngFor", "ngForOf"], [3, "click"]], template: function RolesListComponent_Template(rf, ctx) { if (rf & 1) {
|
|
89
|
+
i0.ɵɵelementStart(0, "div", 0);
|
|
90
|
+
i0.ɵɵtemplate(1, RolesListComponent_div_1_Template, 2, 0, "div", 1)(2, RolesListComponent_table_2_Template, 9, 1, "table", 2);
|
|
91
|
+
i0.ɵɵelementEnd();
|
|
92
|
+
} if (rf & 2) {
|
|
93
|
+
i0.ɵɵadvance();
|
|
94
|
+
i0.ɵɵproperty("ngIf", ctx.isLoading);
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵproperty("ngIf", !ctx.isLoading);
|
|
97
|
+
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.FillContainer], styles: ["\n\r\ntable[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; \n\r\n}\r\n\r\nbutton[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2; \n\r\n color: black; \n\r\n font-weight: bold; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray; \n\r\n height: 36px; \n\r\n text-align: center;\r\n padding: 0 8px; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n width: 150px; \n\r\n text-align: left;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff; \n\r\n}"] });
|
|
98
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RolesListComponent, [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{ selector: 'mj-roles-list', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\">Loading...</div>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th>Role</th>\r\n <th>Description</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let r of roles\" (click)=\"selectRole(r)\">\r\n <td>{{ r.Name }}</td>\r\n <td>{{ r.Description }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n ", styles: ["/* Style for the whole table */\r\ntable {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; /* Ensures border collapse for a cleaner look */\r\n}\r\n\r\nbutton {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable th {\r\n background-color: #f2f2f2; /* Light gray background for headers */\r\n color: black; /* Black text color for headers */\r\n font-weight: bold; /* Bold font weight for headers */\r\n}\r\n\r\n/* Style for all table cells */\r\ntable th, table td {\r\n border: 1px solid gray; /* Gray border for cells */\r\n height: 36px; /* Fixed height for all rows */\r\n text-align: center;\r\n padding: 0 8px; /* Add some padding inside cells */\r\n}\r\n\r\n/* Specific styles for the first column */\r\ntable th:first-child, table td:first-child {\r\n width: 150px; /* Set width for the first column */\r\n text-align: left;\r\n}\r\n\r\n/* Specific styles for the \"Can\" columns */\r\ntable th:not(:first-child), table td:not(:first-child) {\r\n width: 100px; /* Set width for \"Can\" columns */\r\n}\r\n\r\ntable tr {\r\n cursor: pointer;\r\n}\r\n\r\n/* Alternating row background colors */\r\ntable tr:nth-child(odd) {\r\n background-color: white; /* Light color for odd rows */\r\n}\r\n\r\ntable tr:nth-child(even) {\r\n background-color: #e7f4ff; /* Light blue for even rows */\r\n}\r\n"] }]
|
|
101
|
+
}], () => [{ type: i1.Router }], null); })();
|
|
102
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RolesListComponent, { className: "RolesListComponent", filePath: "src\\lib\\roles-list\\roles-list.component.ts", lineNumber: 15 }); })();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SettingsComponent implements OnInit {
|
|
5
|
+
private router;
|
|
6
|
+
private activatedRoute;
|
|
7
|
+
currentItem: 'EntityPermissions' | 'Users' | 'Roles' | 'Role';
|
|
8
|
+
baseRoute: string;
|
|
9
|
+
selectedRoleName: string;
|
|
10
|
+
selectItem(item: 'EntityPermissions' | 'Users' | 'Roles' | 'Role', changeRoute?: boolean): void;
|
|
11
|
+
changeRoute(subPath: string): void;
|
|
12
|
+
constructor(router: Router, activatedRoute: ActivatedRoute);
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
updateComponentStateBasedOnPath(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SettingsComponent, "mj-settings", never, {}, {}, never, never, false, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { NavigationEnd } from '@angular/router';
|
|
3
|
+
import { filter } from 'rxjs/operators';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "@angular/router";
|
|
6
|
+
import * as i2 from "@angular/common";
|
|
7
|
+
import * as i3 from "@memberjunction/ng-entity-permissions";
|
|
8
|
+
import * as i4 from "../single-role/single-role.component";
|
|
9
|
+
import * as i5 from "../roles-list/roles-list.component";
|
|
10
|
+
function SettingsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
+
i0.ɵɵelementStart(0, "div");
|
|
12
|
+
i0.ɵɵelement(1, "mj-entity-permissions-selector-with-grid");
|
|
13
|
+
i0.ɵɵelementEnd();
|
|
14
|
+
} }
|
|
15
|
+
function SettingsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementStart(0, "div");
|
|
17
|
+
i0.ɵɵtext(1, " Users Component Goes Here ");
|
|
18
|
+
i0.ɵɵelementEnd();
|
|
19
|
+
} }
|
|
20
|
+
function SettingsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
|
|
21
|
+
i0.ɵɵelementStart(0, "div");
|
|
22
|
+
i0.ɵɵelement(1, "mj-roles-list");
|
|
23
|
+
i0.ɵɵelementEnd();
|
|
24
|
+
} }
|
|
25
|
+
function SettingsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
|
|
26
|
+
i0.ɵɵelementStart(0, "div");
|
|
27
|
+
i0.ɵɵelement(1, "mj-single-role", 5);
|
|
28
|
+
i0.ɵɵelementEnd();
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵadvance();
|
|
32
|
+
i0.ɵɵproperty("RoleName", ctx_r3.selectedRoleName);
|
|
33
|
+
} }
|
|
34
|
+
export class SettingsComponent {
|
|
35
|
+
selectItem(item, changeRoute = true) {
|
|
36
|
+
this.currentItem = item;
|
|
37
|
+
if (changeRoute)
|
|
38
|
+
this.changeRoute(item.toLowerCase());
|
|
39
|
+
}
|
|
40
|
+
changeRoute(subPath) {
|
|
41
|
+
// Constructs a navigation path relative to the /settings base route
|
|
42
|
+
this.router.navigate([this.baseRoute, subPath]);
|
|
43
|
+
}
|
|
44
|
+
constructor(router, activatedRoute) {
|
|
45
|
+
this.router = router;
|
|
46
|
+
this.activatedRoute = activatedRoute;
|
|
47
|
+
this.currentItem = 'EntityPermissions';
|
|
48
|
+
this.baseRoute = '/settings';
|
|
49
|
+
this.selectedRoleName = '';
|
|
50
|
+
}
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
// manually update the first time
|
|
53
|
+
this.updateComponentStateBasedOnPath();
|
|
54
|
+
// Listen to changes in the route
|
|
55
|
+
this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => {
|
|
56
|
+
this.updateComponentStateBasedOnPath();
|
|
57
|
+
});
|
|
58
|
+
// this.activatedRoute.url.subscribe(urlSegments => {
|
|
59
|
+
// const fullPath = window.location.pathname + window.location.search;
|
|
60
|
+
// // Split the fullPath into segments and query string as needed
|
|
61
|
+
// const [path, queryString] = fullPath.split('?');
|
|
62
|
+
// const segments = path.split('/').filter(segment => segment.length > 0);
|
|
63
|
+
// // Your logic to handle the segments and query string
|
|
64
|
+
// const firstSegment = segments.length > 1 ? segments[1] : '';
|
|
65
|
+
// switch (firstSegment.trim().toLowerCase()) {
|
|
66
|
+
// case 'entitypermissions':
|
|
67
|
+
// this.selectItem('EntityPermissions', false);
|
|
68
|
+
// break;
|
|
69
|
+
// case 'users':
|
|
70
|
+
// this.selectItem('Users', false);
|
|
71
|
+
// break;
|
|
72
|
+
// case 'roles':
|
|
73
|
+
// this.selectItem('Roles', false);
|
|
74
|
+
// break;
|
|
75
|
+
// case 'role':
|
|
76
|
+
// this.selectedRoleName = segments.length > 2 ? segments[2] : '';
|
|
77
|
+
// this.selectItem('Role', false);
|
|
78
|
+
// break;
|
|
79
|
+
// default:
|
|
80
|
+
// break;
|
|
81
|
+
// }
|
|
82
|
+
// });
|
|
83
|
+
}
|
|
84
|
+
updateComponentStateBasedOnPath() {
|
|
85
|
+
// On each navigation end, access the current URL from window.location
|
|
86
|
+
const fullPath = window.location.pathname + window.location.search;
|
|
87
|
+
// Split the fullPath into segments and query string as needed
|
|
88
|
+
const [path, queryString] = fullPath.split('?');
|
|
89
|
+
const segments = path.split('/').filter(segment => segment.length > 0);
|
|
90
|
+
// Place your switch-case logic here
|
|
91
|
+
const firstSegment = segments.length > 1 ? segments[1] : '';
|
|
92
|
+
switch (firstSegment.trim().toLowerCase()) {
|
|
93
|
+
case 'entitypermissions':
|
|
94
|
+
this.selectItem('EntityPermissions', false);
|
|
95
|
+
break;
|
|
96
|
+
case 'users':
|
|
97
|
+
this.selectItem('Users', false);
|
|
98
|
+
break;
|
|
99
|
+
case 'roles':
|
|
100
|
+
this.selectItem('Roles', false);
|
|
101
|
+
break;
|
|
102
|
+
case 'role':
|
|
103
|
+
this.selectedRoleName = segments.length > 2 ? segments[2] : '';
|
|
104
|
+
this.selectItem('Role', false);
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
SettingsComponent.ɵfac = function SettingsComponent_Factory(t) { return new (t || SettingsComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute)); };
|
|
112
|
+
SettingsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SettingsComponent, selectors: [["mj-settings"]], decls: 13, vars: 10, consts: [[1, "container"], [1, "options-container"], [1, "option-item", 3, "click"], [1, "display-container"], [4, "ngIf"], [3, "RoleName"]], template: function SettingsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
113
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
|
|
114
|
+
i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_2_listener() { return ctx.selectItem("Users"); });
|
|
115
|
+
i0.ɵɵtext(3, "Users");
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
i0.ɵɵelementStart(4, "div", 2);
|
|
118
|
+
i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_4_listener() { return ctx.selectItem("Roles"); });
|
|
119
|
+
i0.ɵɵtext(5, "Roles");
|
|
120
|
+
i0.ɵɵelementEnd();
|
|
121
|
+
i0.ɵɵelementStart(6, "div", 2);
|
|
122
|
+
i0.ɵɵlistener("click", function SettingsComponent_Template_div_click_6_listener() { return ctx.selectItem("EntityPermissions"); });
|
|
123
|
+
i0.ɵɵtext(7, "Entity Permissions");
|
|
124
|
+
i0.ɵɵelementEnd()();
|
|
125
|
+
i0.ɵɵelementStart(8, "div", 3);
|
|
126
|
+
i0.ɵɵtemplate(9, SettingsComponent_div_9_Template, 2, 0, "div", 4)(10, SettingsComponent_div_10_Template, 2, 0, "div", 4)(11, SettingsComponent_div_11_Template, 2, 0, "div", 4)(12, SettingsComponent_div_12_Template, 2, 1, "div", 4);
|
|
127
|
+
i0.ɵɵelementEnd()();
|
|
128
|
+
} if (rf & 2) {
|
|
129
|
+
i0.ɵɵadvance(2);
|
|
130
|
+
i0.ɵɵclassProp("selected", ctx.currentItem === "Users");
|
|
131
|
+
i0.ɵɵadvance(2);
|
|
132
|
+
i0.ɵɵclassProp("selected", ctx.currentItem === "Roles" || ctx.currentItem === "Role");
|
|
133
|
+
i0.ɵɵadvance(2);
|
|
134
|
+
i0.ɵɵclassProp("selected", ctx.currentItem === "EntityPermissions");
|
|
135
|
+
i0.ɵɵadvance(3);
|
|
136
|
+
i0.ɵɵproperty("ngIf", ctx.currentItem === "EntityPermissions");
|
|
137
|
+
i0.ɵɵadvance();
|
|
138
|
+
i0.ɵɵproperty("ngIf", ctx.currentItem === "Users");
|
|
139
|
+
i0.ɵɵadvance();
|
|
140
|
+
i0.ɵɵproperty("ngIf", ctx.currentItem === "Roles");
|
|
141
|
+
i0.ɵɵadvance();
|
|
142
|
+
i0.ɵɵproperty("ngIf", ctx.currentItem === "Role");
|
|
143
|
+
} }, dependencies: [i2.NgIf, i3.EntityPermissionsSelectorWithGridComponent, i4.SingleRoleComponent, i5.RolesListComponent], styles: [".container[_ngcontent-%COMP%] {\r\n display: flex;\r\n }\r\n \r\n .options-container[_ngcontent-%COMP%] {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n }\r\n \r\n .option-item[_ngcontent-%COMP%] {\r\n cursor: pointer;\r\n margin-bottom: 10px; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n }\r\n \r\n .display-container[_ngcontent-%COMP%] {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .selected[_ngcontent-%COMP%] {\r\n background-color: #007bff; \n\r\n color: white; \n\r\n padding: 5px 10px; \n\r\n border-radius: 4px; \n\r\n }"] });
|
|
144
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SettingsComponent, [{
|
|
145
|
+
type: Component,
|
|
146
|
+
args: [{ selector: 'mj-settings', template: "<div class=\"container\">\r\n <!-- Options container -->\r\n <div class=\"options-container\">\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'Users'\" (click)=\"selectItem('Users')\">Users</div>\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'Roles' || currentItem === 'Role'\" (click)=\"selectItem('Roles')\">Roles</div>\r\n <div class=\"option-item\" [class.selected]=\"currentItem === 'EntityPermissions'\" (click)=\"selectItem('EntityPermissions')\">Entity Permissions</div>\r\n </div>\r\n\r\n <!-- Display container -->\r\n <div class=\"display-container\">\r\n <div *ngIf=\"currentItem === 'EntityPermissions'\">\r\n <mj-entity-permissions-selector-with-grid></mj-entity-permissions-selector-with-grid>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Users'\">\r\n Users Component Goes Here\r\n </div>\r\n <div *ngIf=\"currentItem === 'Roles'\">\r\n <mj-roles-list></mj-roles-list>\r\n </div>\r\n <div *ngIf=\"currentItem === 'Role'\">\r\n <mj-single-role [RoleName]=\"selectedRoleName\"></mj-single-role>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container {\r\n display: flex;\r\n }\r\n \r\n .options-container {\r\n flex: 0 0 150px;\r\n padding: 10px;\r\n }\r\n \r\n .option-item {\r\n cursor: pointer;\r\n margin-bottom: 10px; /* Adds space between the options for better readability */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n }\r\n \r\n .display-container {\r\n flex: 1;\r\n padding: 10px;\r\n }\r\n\r\n .selected {\r\n background-color: #007bff; /* A blue background for selected item */\r\n color: white; /* White text color for better contrast */\r\n padding: 5px 10px; /* Optional: Adds some padding for a better visual appearance */\r\n border-radius: 4px; /* Optional: Adds rounded corners for a more polished look */\r\n }\r\n "] }]
|
|
147
|
+
}], () => [{ type: i1.Router }, { type: i1.ActivatedRoute }], null); })();
|
|
148
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SettingsComponent, { className: "SettingsComponent", filePath: "src\\lib\\settings\\settings.component.ts", lineNumber: 10 }); })();
|
|
@@ -242,7 +242,7 @@ SingleRoleComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleR
|
|
|
242
242
|
} }, dependencies: [i1.NgForOf, i1.NgIf, i2.CheckboxControlValueAccessor, i2.NgControlStatus, i2.NgModel, i3.FillContainer, i4.ButtonComponent], styles: ["\n\r\ntable[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; \n\r\n}\r\n\r\nbutton[_ngcontent-%COMP%] {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\r\n background-color: #f2f2f2; \n\r\n color: black; \n\r\n font-weight: bold; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\r\n border: 1px solid gray; \n\r\n height: 36px; \n\r\n text-align: center;\r\n padding: 0 8px; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child {\r\n width: 150px; \n\r\n text-align: left;\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:not(:first-child), table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:not(:first-child) {\r\n width: 100px; \n\r\n}\r\n\r\n\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd) {\r\n background-color: white; \n\r\n}\r\n\r\ntable[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(even) {\r\n background-color: #e7f4ff; \n\r\n}"] });
|
|
243
243
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleRoleComponent, [{
|
|
244
244
|
type: Component,
|
|
245
|
-
args: [{ selector: 'mj-single-role', template: "<div mjFillContainer>\r\n
|
|
245
|
+
args: [{ selector: 'mj-single-role', template: "<div mjFillContainer>\r\n <div *ngIf=\"isLoading\">Loading...</div>\r\n <button *ngIf=\"NumDirty > 0\" kendoButton (click)=\"saveUserRoles()\">Save</button>\r\n <span>{{this.RoleName}}</span>\r\n <table *ngIf=\"!isLoading\" class=\"grid\">\r\n <thead>\r\n <tr>\r\n <th>User</th>\r\n <th>In Role</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr *ngFor=\"let ur of userRoles\">\r\n <td>{{ ur.User }}</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>\r\n ", styles: ["/* Style for the whole table */\r\ntable {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n border-collapse: collapse; /* Ensures border collapse for a cleaner look */\r\n}\r\n\r\nbutton {\r\n margin-left: 5px;\r\n margin-top: 5px;\r\n}\r\n \r\ntable th {\r\n background-color: #f2f2f2; /* Light gray background for headers */\r\n color: black; /* Black text color for headers */\r\n font-weight: bold; /* Bold font weight for headers */\r\n}\r\n\r\n/* Style for all table cells */\r\ntable th, table td {\r\n border: 1px solid gray; /* Gray border for cells */\r\n height: 36px; /* Fixed height for all rows */\r\n text-align: center;\r\n padding: 0 8px; /* Add some padding inside cells */\r\n}\r\n\r\n/* Specific styles for the first column */\r\ntable th:first-child, table td:first-child {\r\n width: 150px; /* Set width for the first column */\r\n text-align: left;\r\n}\r\n\r\n/* Specific styles for the \"Can\" columns */\r\ntable th:not(:first-child), table td:not(:first-child) {\r\n width: 100px; /* Set width for \"Can\" columns */\r\n}\r\n\r\n/* Alternating row background colors */\r\ntable tr:nth-child(odd) {\r\n background-color: white; /* Light color for odd rows */\r\n}\r\n\r\ntable tr:nth-child(even) {\r\n background-color: #e7f4ff; /* Light blue for even rows */\r\n}\r\n"] }]
|
|
246
246
|
}], () => [], { RoleName: [{
|
|
247
247
|
type: Input
|
|
248
248
|
}], BottomMargin: [{
|
package/dist/public-api.d.ts
CHANGED
package/dist/public-api.js
CHANGED
package/package.json
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
2
|
+
"name": "@memberjunction/ng-explorer-settings",
|
|
3
|
+
"version": "0.9.7",
|
|
4
|
+
"description": "MemberJunction: Reusable Angular components for the settings section of the MJ Explorer App",
|
|
5
|
+
"main": "./dist/public-api.js",
|
|
6
|
+
"typings": "./dist/public-api.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"/dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" \u0026\u0026 exit 1",
|
|
12
|
+
"build": "ngc"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
|
|
16
|
+
],
|
|
17
|
+
"author": "",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@angular/compiler": "~17.2.2",
|
|
21
|
+
"@angular/compiler-cli": "~17.2.2"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@angular/common": "~17.2.2",
|
|
25
|
+
"@angular/core": "~17.2.2",
|
|
26
|
+
"@angular/forms": "~17.2.2",
|
|
27
|
+
"@angular/router": "~17.2.2"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@memberjunction/core-entities": "^0.9.162",
|
|
31
|
+
"@memberjunction/global": "^0.9.158",
|
|
32
|
+
"@memberjunction/core": "^0.9.177",
|
|
33
|
+
"@memberjunction/ng-container-directives": "^0.9.140",
|
|
34
|
+
"@memberjunction/ng-shared": "^0.9.30",
|
|
35
|
+
"@memberjunction/ng-entity-permissions": "^0.9.7",
|
|
36
|
+
"@progress/kendo-angular-dropdowns": "~15.1.0",
|
|
37
|
+
"@progress/kendo-angular-grid": "~15.1.0",
|
|
38
|
+
"@progress/kendo-angular-buttons": "~15.1.0",
|
|
39
|
+
"@progress/kendo-angular-dialog": "~15.1.0",
|
|
40
|
+
"tslib": "^2.3.0"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false
|
|
40
43
|
}
|