@memberjunction/ng-explorer-settings 0.9.2 → 0.9.5

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.
@@ -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 "@angular/common";
4
- import * as i3 from "@progress/kendo-angular-grid";
5
- import * as i4 from "@angular/forms";
6
- import * as i5 from "@progress/kendo-angular-dialog";
7
- import * as i6 from "@progress/kendo-angular-excel-export";
8
- import * as i7 from "@memberjunction/ng-compare-records";
9
- import * as i8 from "@memberjunction/ng-container-directives";
10
- import * as i9 from "@progress/kendo-angular-buttons";
11
- import * as i10 from "@progress/kendo-angular-icons";
12
- import * as i11 from "@progress/kendo-angular-dropdowns";
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 i2.CommonModule, typeof i3.GridModule, typeof i4.FormsModule, typeof i5.DialogsModule, typeof i6.ExcelExportModule, typeof i7.CompareRecordsModule, typeof i8.ContainerDirectivesModule, typeof i9.ButtonsModule, typeof i10.IconsModule, typeof i11.DropDownsModule], [typeof i1.SingleRoleComponent]>;
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
  }
@@ -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], imports: [CommonModule,
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], exports: [SingleRoleComponent] }); })();
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 <!-- We are going to do a simple custom grid here because Kendo Grid is way too much for this and doesn't show checkboxes even when not editing, this is cleaner and simpler -->\r\n <!-- Assuming your component's selector is 'app-permissions-grid' -->\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"] }]
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: [{
@@ -1,2 +1,4 @@
1
1
  export * from './lib/single-role/single-role.component';
2
+ export * from './lib/settings/settings.component';
3
+ export * from './lib/roles-list/roles-list.component';
2
4
  export * from './lib/module';
@@ -2,4 +2,6 @@
2
2
  * Public API Surface
3
3
  */
4
4
  export * from './lib/single-role/single-role.component';
5
+ export * from './lib/settings/settings.component';
6
+ export * from './lib/roles-list/roles-list.component';
5
7
  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.2",
3
+ "version": "0.9.5",
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,11 +25,12 @@
25
25
  "@angular/router": "~17.2.2"
26
26
  },
27
27
  "dependencies": {
28
- "@memberjunction/core-entities": "^0.9.156",
29
- "@memberjunction/global": "^0.9.153",
30
- "@memberjunction/core": "^0.9.172",
31
- "@memberjunction/ng-container-directives": "^0.9.136",
32
- "@memberjunction/ng-shared": "^0.9.25",
28
+ "@memberjunction/core-entities": "^0.9.159",
29
+ "@memberjunction/global": "^0.9.155",
30
+ "@memberjunction/core": "^0.9.174",
31
+ "@memberjunction/ng-container-directives": "^0.9.138",
32
+ "@memberjunction/ng-shared": "^0.9.28",
33
+ "@memberjunction/ng-entity-permissions": "^0.9.5",
33
34
  "@progress/kendo-angular-dropdowns": "~15.1.0",
34
35
  "@progress/kendo-angular-grid": "~15.1.0",
35
36
  "@progress/kendo-angular-buttons": "~15.1.0",